tags:

views:

76

answers:

1

what i don't understand in my task here what kind of list i can use, and if it should have 2 attributes key and value ? or only value? with pointers to another node ofc

the task: "design a function which create a list using input from the keyboard _ the prefered solution. Assume that some magic stops the input; so the length of a list is not known in advance.(alternative solution: a function which creates explicitly a fixed list. However, all other function can not assume any knowledge about the length of lists). Necessary utilities( additional functions to be created): a function which deallocates the memory used for lists and a function which prints the content of the list. let the element of lists contain a letter. Design a function which create a copy of such list.

can't also understand the list line !!!!!???

+1  A: 

write a loop that creates a linked list of numbers a user enters on the command line.

In pseudocode:

Node* head = NULL;
while (true) {
  input = get_input_from_command_line();
  if (input is MAGIC_STOP_WORD) break;
  head = insertNode(head, input);
}

printList(head);
Stephen
Other than the "is" line, your pseudo-code looks suspiciously like C :-)
paxdiablo
It's a good enough description so that it might get the algorithm across while far enough from being compilable to still pose a challenge. Thumbs up from me.
sbi
I shall call it pseudo-C! :P I figured c like syntax would help more, the OP sounds a little overwhelmed.
Stephen