Courses / Computer Science XII (HSSC-II) – FBISE Complete SLO-Based Course
Unit 2 Review, Situational Quiz and Unit Test
Unit 2 – Computational Thinking and Algorithms · 45 min read · 16 MCQs to check yourself
Unit 2: Computational Thinking and Algorithms – review
This unit carries about 15% of the marks in the FBISE model paper (Table of Specifications).
SLO checklist – tick each one you can do
| SLO | Students should be able to… | Lesson(s) |
|---|---|---|
| CS-12-B-01 | Understand and evaluate computational solutions in terms of efficiency, clarity and correctness | 2.1 |
| CS-12-B-02 | Understand and apply complex algorithms on data structures such as trees and binary search | 2.2, 2.3, 2.4 |
Unit test
CS XII Unit 2 Test – Computational Thinking and Algorithms – 12 MCQs online (15 min). Full paper:
| Section | Questions | Marks |
|---|---|---|
| A – MCQs (online here) | 12 × 1 | 12 |
| B – Short questions | 4 × 3 | 12 |
| C – Long questions | 1 × 6 | 6 |
| Total | 30 |
Then take CS XII Monthly Test 1.
Practise these before the test
Long questions
- Two students write programs to check if a number is in a list of 1,000,000 student IDs. Ali uses linear search on the unsorted list; Sara sorts the list once and then uses binary search. Evaluate both solutions in terms of efficiency, clarity and correctness, and recommend one for a system that performs thousands of searches per minute. (6)
- A hospital wants software for (a) the order in which walk-in patients see a doctor, (b) the “undo last entry” feature for receptionists, and (c) storing departments and sub-departments. Recommend a data structure for each, justify your choice and show the main operations with a short Python example. (2 + 2 + 2)
- A company manages its organisational hierarchy using a tree: CEO has children CTO and CFO; CTO has Eng and IT; CFO has Finance; Eng has DevOps; IT has Security. The company wants to find the Security department. (a) Search Security using DFS and BFS. (b) Outline the sequence of node visits in the selected search method. (3 + 3)
- Construct a binary search tree by inserting 40, 20, 60, 10, 30, 50, 70, 25. Write its in-order, pre-order and post-order traversals and explain one property you notice. (2 + 3 + 1)
- Trace the binary search algorithm to find 60 in the list [5, 12, 18, 25, 33, 41, 47, 52, 60, 68, 75]. Show low, high and mid in a table, give the number of comparisons, and compare it with linear search for the same list. (4 + 2)
Short questions
- How do we assess the effectiveness of a computational solution?
- Differentiate between time complexity and space complexity with one example each.
- Write two Python functions to find the sum of 1 to n – one using a loop and one using a formula. Which is more efficient and why?
- What is an edge case? Give three edge cases for a function that returns the average of a list of marks.
- Why is clarity important in a computational solution? Give three practices that improve it.
- Differentiate between a stack and a queue with one real-life example of each.
- Explain how undo and redo work in a text editor using stacks.
- Write a Python program to implement a queue of print jobs using enqueue and dequeue operations.
Model answers are listed under each lesson of this unit (and below for the extra review questions).
This lesson ends with a quiz of 16 MCQs. Open the lesson on PrepOasis to take it and save your progress.
Previous: 2.4 Binary Search: Algorithm, Tracing and Applications · Next: 3.1 Programming Paradigms: Procedural, Object-Oriented and Functional
All lessons in Computer Science XII (HSSC-II) – FBISE Complete SLO-Based Course