Well I have been working on this current project(Not just this section) for the past 18 hours straight and I am still soldiering on.
I still can't get this bubbleSort to work or an insertionSort for that matter. I have tried many methods and I just can't get it right. I can sort most arrays fine generally but at the moment I am really struggling to sort alphabetically using objects.
I am storing my objects like this
Employee( string &, string &, string &);
void setFirstName( string & );
void setLastName( string & );
void settaxFileNumber( string & );
My current spinoff of bubbleSort now looks like this:
void bubbleSort(Employee * employees, int size)
int temp = 0;
int swaps = 0;
int left = 0;
int right = 1;
while(swaps < 0);
if(employees[right] < employees[left])
temp = employees[left];
employees[left] = employees[right];
employees[right] = temp;
I know this isn't a do my work for me site I really want to learn this. I know I am not using employees->getLastName() in this code but I figured a simplified version of my current code my help you help me.
I apologize that I suck at life right now... No sleep does that to a person.