Advertisement
Advertisement
| 05.15.2008 at 12:06AM PDT, ID: 23404167 |
|
[x]
Attachment Details
|
||
|
[x]
The Solution Rating System
|
||
|
With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.
Your Input Matters If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support. Thank you! |
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: |
//linked list struct
struct linked_list
{
struct node *head;
int count;
};
//node struct
struct node
{
int data;
struct node *next;
};
// allocates a new list, inits object
struct linked_list* linked_list_new()
{
struct linked_list* newList;
newList = malloc(sizeof(struct linked_list));
newList->count = 0;
newList->head = NULL;
return newList;
}
// adds in FIFO fashion
void linked_list_add( struct linked_list* list, int data)
{
struct node* cur = list->head;
if (cur == NULL)
{
cur = malloc(sizeof(struct node));
cur->data = data;
cur->next = NULL;
list->head = cur;
return;
}
while(cur)
{
if(cur->next == NULL)
{
struct node* newNode;
newNode = malloc(sizeof(struct node));
newNode->data = data;
newNode->next = NULL;
cur->next = newNode;
list->count ++;
}
else
{
cur = cur->next;
}
}
}
|
| Microsoft |
| Apple |
| Internet |
| Gamers |
| Digital Living |
| Virus & Spyware |
| Hardware |
| Software |
| ITPro |
| Developer |
| Storage |
| OS |
| Database |
| Security |
| Programming |
| Web Development |
| Networking |
| Other |
| Community Support |
| 05.15.2008 at 12:10AM PDT, ID: 21571187 |
| 05.15.2008 at 12:12AM PDT, ID: 21571194 |
| 05.15.2008 at 12:14AM PDT, ID: 21571201 |
| 05.15.2008 at 12:17AM PDT, ID: 21571220 |
| 05.15.2008 at 12:20AM PDT, ID: 21571238 |
| 05.15.2008 at 12:21AM PDT, ID: 21571242 |
| 05.15.2008 at 12:27AM PDT, ID: 21571274 |
| 05.15.2008 at 12:32AM PDT, ID: 21571297 |
| 05.15.2008 at 12:38AM PDT, ID: 21571318 |
| 05.15.2008 at 12:39AM PDT, ID: 21571327 |
| 05.15.2008 at 12:39AM PDT, ID: 21571328 |
| 05.15.2008 at 12:44AM PDT, ID: 21571339 |
| 05.15.2008 at 12:55AM PDT, ID: 21571387 |
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: |
typedef enum {
LL_EMPLOYEE = 0,
LL_USER = 1,
LL_MANAGER = 2
} LL_Type;
void add_data(struct linked_list lists[3], const char *str) {
LL_Type listid = /* determine list type based on str */;
int data = /* get data from str */;
linked_list_add(&(lists[listid]), data);
}
/* and then : */
struct linked_list lists[3] = { 0 };
char str[128] = "";
while (/* read line into str */) {
add_data(lists, str);
}
|