March 27th, 2012, 12:36 PM
Check if swapped is true.
Yes -> start bubble sort at the beginning again
set isSwapped to false
call bubblesort starting at item 0.
No -> Just...
March 27th, 2012, 10:13 AM
I had to include a file as its what my assignment is asking for... I changed my variables to yours and made some changes to the code but its still outputting bogus numbers, do i still need more code?...
March 26th, 2012, 05:02 PM
Ok i only just saw the last two replies I did this today its a bit off but i tried.
Ok this is what ive done so far..
#include <iostream>
using namespace::std;
int bubblesort( int...
March 25th, 2012, 11:03 AM
I know there needs to be a part where values[i] is compared to values[i-1] i jus dont kno where to place this condition... and also what i need to take out..
March 25th, 2012, 10:46 AM
I have a recursive selection sort, so im thinking i can make this code into a bubble sort, I'm not exactly sure what i should change or what the REAL difference is in the coding for the 2 types of...
March 24th, 2012, 12:37 PM
Ok ive tried, bare with me if theyre any stupid errors
#include<stdio.h>
#include<conio.h>
#include<iostream.h>
void function(int a[],int n.length, int i){
...
March 24th, 2012, 10:42 AM
#include <iostream>
using namespace std;
void MyFunction(int a)
{
cout << "i = " << a << "\n";
if(a < 2)
{
March 24th, 2012, 09:10 AM
Its some homework I have to do.. I have googled recursion and tried finding bubble sorts using it but i cant find any that dont have loops or that work so ive come here..
March 23rd, 2012, 11:28 PM
its jus what ive been asked to do.. Ive gotten suggestions about recursion but im still a bit lost as to how id implement it with the whole base case condition etc etc
March 23rd, 2012, 11:12 PM
Ive written a long program that should be a bubble sort , unfortunately I cant use loops ...is there any way i can shorten this and make it indeed a bubble sort? Its sorting atm but its not entirely...