Hello
I am clueless on this one...so I will need alot of help, or if you are willing straight code.
I have an array of size 10.
I need to take a linked list and iterate through it. In the array is a structure. I get a digit from structure.d_pop. Based on this digit I need to place that node into the array Eg.
Digit 0 goes to the list in array[0]
Digit q goes into the list in array [1]
... and so on.
I do not know how to go about placing these nodes int the array, sinc the array will only hold the address of th first item in the list.
I need to initialize and then do it. Here is the code I have thus far
Code:struct info{ string fips; string d_name; string r_code; int d_pop; int sd_enrol; int st_need; }; struct node { info node_struct; node *nxt; }; void bucket_sort(int digit) { node buckets[10]; node *temp; temp = start_ptr; int i; do { if (temp == NULL) { } else { if(get_digit(temp->node_struct,digit) == 0) { } temp = temp->nxt; } }while (temp != NULL); }



LinkBack URL
About LinkBacks


