NivaarExam PrepOfficial exam papers ↗

25-Comp-A4 Program Design and Data Structures: May 2016

Nivaar worked solution (AI-drafted; not reviewed by a licensed engineer)

  1. Question 1 Programming — Horoscope Sign and Element Compatibility
  2. Question 2 Programming — Self-Describing Integers and a Crypto-Arithmetic Solver
  3. Question 3 Object-Oriented Design — A C++ Set Class
  4. Question 4 Pointer-based Data Structures — Sorted Doubly Linked List
  5. Question 5 Pointer-based Data Structures — Binary Tree Traversal
  6. Question 6 File I/O — Names Common to Three Sorted Files
  7. Question 7 File I/O — Merging Two Sorted Files
  8. Question 8 Algorithm Design and Sorting — Deduplicating a Large Array

Start with Question 1 →

Paper format. 98-Comp-A4 Program Design and Data Structures, May 2016 — 3 hours, closed book, no calculator permitted. Eight questions of equal weight (20 marks each: some split as (a) 10 + (b) 10); candidates answer any five, so a complete paper is 100 marks. Pseudocode or any high-level language is accepted, and the examiner's note states explicitly that marking emphasises the operation of the program, not syntactic details. All eight questions are answered below, because the whole set is the more useful revision resource. Answers are given in C or C++ as the question dictates; each is compilable as written, but a clear, correctly reasoned pseudocode answer would earn the same marks.

Reference texts for this subject.

  • Cormen, Leiserson, Rivest & Stein, Introduction to Algorithms, 4th ed. — tree traversals (ch. 12), sorting and Quicksort (ch. 7), asymptotic analysis (ch. 3).
  • Weiss, Data Structures and Algorithm Analysis in C, 2nd ed. — linked lists (ch. 3), binary search trees (ch. 4).
  • Deitel & Deitel, C++ How to Program, 10th ed. — class design and templates (ch. 9–12), file streams (ch. 14).
  • Kernighan & Ritchie, The C Programming Language, 2nd ed. — character/array I/O idioms (ch. 1, 7), pointers and structures (ch. 5–6).
  • Stroustrup, The C++ Programming Language, 4th ed. — class templates and value semantics (ch. 3, 25–27).

The Computer Engineering citation list is built around architecture and networking texts (Patterson & Hennessy, Tanenbaum, Mano); this subject is programming and data structures, so the works above are cited instead.