Nivaar Exam Prep

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

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

  1. Question 1 Programming — Sphere Buoyancy and a Subsystem Trade Study
  2. Question 2 Programming — Self-Describing Integers
  3. Question 3 Programming — Magic Square Checker
  4. Question 4 File I/O — Average Word Length
  5. Question 5 File I/O — Balanced Parentheses
  6. Question 6 Object-Oriented Design — A C++ Set Class
  7. Question 7 Pointer-based Data Structures — Duplicating Every Node of a Linked List
  8. Question 8 Pointer-based Data Structures — Inorder Traversal
  9. Question 9 Algorithm Design — One-Pass 0/1 Array Partition

Start with Question 1 →

Pseudocode or any high-level language (e.g. C or C++) 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 walks (ch. 12), stacks and linear-time scans (ch. 10, 2), asymptotic analysis (ch. 3).
  • Weiss, Data Structures and Algorithm Analysis in C, 2nd ed. — arrays and dynamic 2-D allocation (ch. 1), linked lists (ch. 3), stacks (ch. 3.3), binary trees (ch. 4).
  • Deitel & Deitel, C++ How to Program, 10th ed. — class design, templates and the Rule of Three (ch. 9–12), file streams (ch. 14).
  • Kernighan & Ritchie, The C Programming Language, 2nd ed. — character/file I/O idioms (ch. 1, 7), pointers and structures (ch. 5–6).
  • Stroustrup, The C++ Programming Language, 4th ed. — value semantics, const-correctness and templates (ch. 3, 16–18).

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.