Page copy protected against web site content infringement by Copyscape
CS-62 'C' Programming & Data Structure

Sponsors

Sponsors

Sponsors

Sponsors

Partners

Copyscape

Page copy protected against web site content infringement by Copyscape

Sponsors

CS-62 'C' Programming & Data Structure

There are six questions in this assignment.  Answer all the questions. You may use illustrations and diagrams to enhance your explanations. 

  1. What are priority Queues? How can priority queues be implemented? Explain.   (2 marks)
  2. Write a program in ‘C’ programming language to add two polynomials
    using linked list. (4 marks)
  3. Write a non-recursive function in ‘C’ programming language to reverse a doubly linked list. (4 marks)
  4. Let G=(V,E) be an undirected graph. Use depth-first search to develop a
    program using ‘C’ language to convert each edge in G to a directed edge such that the resulting graph is strongly connected, or determine that this is not possible (5 marks)
  5. Consider a linked list with n integers. Each node of the list is numbered
    from ‘1’ to ‘n’. Develop a program using ‘C’ language to split this list into 4 lists so that:

    first list contains nodes numbered 1,5, 9, 13- - -
    second list contains nodes numbered 2, 6, 10, 14- - -
    third list contains nodes numbered 3, 7, 11, 15- - -
    and fourth list contains nodes numbered 4,8, 12, 16- - -    (5 marks)
  6. Write a program in ‘C’ programming language to list the nodes of a binary tree in the following way: List the root, then nodes at depth 1, followed by nodes at depth 2, and so on. (5 marks)