![]() |
Priority Linked Lists?
Hello World, i just started learning the ropes of Linked lists. I get the basic gist of it. Although i am baffled with a question that i clearly do not understand.
here is the main question: You are rerquired to write a C program on Linux which design, implement and test a function: sort list(), which will sort such a list according to the priority value computed by whatever function is passed as its second argument. The frst argument is to be a pointer to the head of the list. Since the OS will have other structures with pointers to IORB's, the list must be sorted in place. within this question i am given this snippet typedef struct iorb { short base_pri; struct iorb *link; char filler[110]; } IORB; OK so this is what i do not understand: 1. What is char filler[110] used for? 2. Obviously base_pri means prioity but what exactly is it used for? comparing IORBS? 3. The Bubble sort is easy to implement, but what argument besides *head must i pass? What i do know is a have to build a linked list to simulate disk I/O in systems programming. but it is pretty difficult witout first understanding what the question is actually asking of me. any suggestions will be appreciated. and any non-suggestions also :) thanks in advance - tr3molo |
Re: New Fix
Ok World i have figured it out. But now i have a new problem. I have searced these forums and cannot find a solid solution to my problem. Basically i have to you a bubble sort to sort out my linked lists using the base_pri values. My code looks some what like this
Code:
typedef struct iorb i'm really hoping someone may be able to help, as ive been stuck for a while now. cheers in advance tr3molo |
| All times are GMT +5.5. The time now is 23:27. |