Nivaar Exam Prep

25-Comp-A4 Program Design and Data Structures: December 2017

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

  1. Question 1 Programming — Floyd's Triangle and the Three-Way Gold-Bar Division
  2. Question 2 Programming — Hailstone (Collatz) Sequence
  3. Question 3 Programming — Saddle Point in a 2-D Array
  4. Question 4 File I/O — Whitespace-Insensitive File Comparison
  5. Question 5 File I/O — Merging Two Sorted Files
  6. Question 6 Object-Oriented Design — A C++ Matrix Class
  7. Question 7 Pointer-Based Data Structures — Doubly Linked List and a Stack Module
  8. Question 8 Binary Trees — Traversals and Reconstruction
  9. Question 9 Algorithm Design — Recursive Palindrome Test

Start with Question 1 →

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.

Reference texts for this subject.

  • Cormen, Leiserson, Rivest & Stein, Introduction to Algorithms, 4th ed. — tree traversals and BSTs (ch. 12), recursion and divide-and-conquer (ch. 2, 4), asymptotic analysis (ch. 3).
  • Weiss, Data Structures and Algorithm Analysis in C, 2nd ed. — linked lists and stacks (ch. 3), binary trees (ch. 4).
  • Deitel & Deitel, C++ How to Program, 10th ed. — class design and operator overloading (ch. 9–11), file streams (ch. 14).
  • Kernighan & Ritchie, The C Programming Language, 2nd ed. — arrays and file I/O (ch. 1, 7), pointers, structures and linked lists (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.