[prev] [index] [next]

Tips for Next Quiz (cont)

Sample practice question
  • Use list.h and list.c
    to write a program that
    • creates a linked list from all odd integers between 1 and 99
    • inserts the even numbers from 2 to 100 at the right place
    • deletes every multiple of 3
    • prints the resulting list after each stage

    1->3->5->7->9->...->99
    1->2->3->4->5->6->7->8->9->10->...->99->100
    1->2->4->5->7->8->10->...->100
    

  • Use only 1 linked list. Do not use any other data structure
  • Avoid memory leaks