Skip to content
πŸ“š Free notes, MCQ tests & past papers β€” FBISE & BISE Rawalpindi
πŸ“’ Latest Updates

FBISE 10th Class Computer Science Unit 2 Computational Thinking & Algorithms: Short and Long Questions with Answers 2027

Reviewed by Sadia Shahid, Senior Science teacher (Maths, Physics, Chemistry, Biology, Computer Science)

Here are the important short and long questions of Unit 2, Computational Thinking & Algorithms, from the Federal Board (FBISE) 10th Class Computer Science course (SSC-II, Matric Part II), solved in full for the Annual Examination 2027.

Unit 2: Computational Thinking & Algorithms
Class 10th Class (SSC-II), Federal Board
Subject Computer Science
Contents Short and long questions with answers
Exam FBISE Annual Examination 2027

Short Questions with Answers: Unit 2

25. What is a searching algorithm? Give one example. [1+1]

  • A searching algorithm is a step-by-step procedure used to find a particular item (key) in a list or data structure.

  • Examples: linear search, binary search.

26. What are the necessary conditions for binary search? (Any two) [1+1]

  • The list must be sorted (in ascending or descending order).

  • The elements must be accessible directly by index (e.g. stored in an array), so the middle element can be found.

27. Why is abstraction important in program development? (Two reasons) [1+1]

  • It hides unnecessary details and focuses on important features, making complex problems easier to understand and solve.

  • It allows code to be reused and modified easily, as details can be changed without affecting the whole program.

28. What is a sorting algorithm? Why is sorting important? [1+1]

  • A sorting algorithm arranges data in a particular order (ascending or descending), e.g. bubble sort, selection sort.

  • Sorting is important because sorted data is easier to search (binary search), read, analyse and present.

29. Briefly explain exclusion and inclusion principles in counting problems. [2]

  • Inclusion-exclusion principle: to count elements in the union of sets, add the sizes of sets and subtract the overlaps: |A βˆͺ B| = |A| + |B| βˆ’ |A ∩ B|.

  • It avoids counting common elements twice, e.g. 20 students like cricket, 15 like hockey, 5 like both β‡’ 20 + 15 βˆ’ 5 = 30 students.

30. Briefly explain the concept of modularity in software development. [2]

  • Modularity means dividing a large program into smaller, independent parts called modules (functions or procedures), each performing a specific task.

  • Modules can be written, tested and debugged separately and reused in other programs, which makes software easier to manage.

31. How does abstraction help in creating generalized solutions? [2]

  • Abstraction removes specific details and keeps only the common, essential features of a problem.

  • This lets one solution (e.g. a function to find the area of any rectangle with parameters length and width) work for many similar problems instead of a single case.

32. Differentiate between searching and sorting algorithms. (Two points) [1+1]

  • Searching finds the position of a particular item in a list; sorting arranges all items in a particular order.

  • Searching does not change the list; sorting rearranges the list. Examples: linear/binary search vs bubble/selection sort.

33. Briefly describe the pigeonhole principle. Give one example. [1+1]

  • Pigeonhole principle: if n items are placed into m containers and n > m, then at least one container must contain more than one item.

  • Example: among any 13 people, at least two were born in the same month (12 months).

34. A company wants to develop a system that quickly retrieves customer data from a large database. Which search algorithm would be most suitable for this task, and how does it improve efficiency? [2]

  • Binary search is most suitable (data is kept sorted, e.g. by customer ID).

  • It compares the key with the middle element and discards half the list each time, so a list of 1,000,000 records needs only about 20 comparisons instead of up to 1,000,000 in linear search.

35. List any two characteristics of an algorithm. [1+1]

  • Finiteness: it must end after a finite number of steps.

  • Definiteness: each step must be clear and unambiguous. (Also: input, output, effectiveness.)

36. Why is it beneficial to break a program into smaller modules? (Give any two reasons) [2]

  • Each module can be written, tested and debugged separately, so errors are easy to find and fix.

  • Modules can be reused in other programs, and different programmers can work on different modules at the same time.

Long Questions with Answers: Unit 2

5. Make trace table to sort the given data: [3, 1, 4, 1, 5, 9, 2, 6] [5]

  • Bubble sort (compare adjacent pairs and swap if out of order):

Initial: 3, 1, 4, 1, 5, 9, 2, 6

Pass 1: 1, 3, 1, 4, 5, 2, 6, 9 (swaps: 3β†”οΈŽ1, 4β†”οΈŽ1, 9β†”οΈŽ2, 9β†”οΈŽ6)

Pass 2: 1, 1, 3, 4, 2, 5, 6, 9 (swaps: 3β†”οΈŽ1, 5β†”οΈŽ2)

Pass 3: 1, 1, 3, 2, 4, 5, 6, 9 (swap: 4β†”οΈŽ2)

Pass 4: 1, 1, 2, 3, 4, 5, 6, 9 (swap: 3β†”οΈŽ2)

Pass 5: 1, 1, 2, 3, 4, 5, 6, 9 (no swaps β€” list is sorted)

  • Sorted list (ascending): 1, 1, 2, 3, 4, 5, 6, 9

6. Differentiate between searching algorithms and sorting algorithms. Give one example each. [2.5+2.5]

  • Searching algorithms find the location of a given item (key) in a list; sorting algorithms arrange items in a particular order.

  • Searching returns the position of the item or “not found”; sorting returns the rearranged list.

  • Searching does not change the data; sorting changes the order of data.

  • Binary search requires sorted data, so sorting is often done before searching.

  • Examples: searching β€” linear search, binary search; sorting β€” bubble sort, selection sort, insertion sort.

7. Describe any five properties of a good algorithm. [5]

  • Input: an algorithm has zero or more well-defined inputs.

  • Output: it produces at least one result (output).

  • Definiteness: every step is clear and unambiguous.

  • Finiteness: it must end after a finite number of steps.

  • Effectiveness: each step is simple and can be carried out exactly (also generality/independence of language).

8. Identify the use of a searching algorithm. Compare the linear search with the binary search algorithm. [1+4]

  • Use: a searching algorithm is used to find whether an item is present in a list and to locate its position (e.g. finding a contact in a phone, a record in a database).

  • Linear search checks each element one by one from the start; binary search repeatedly divides the sorted list into halves and checks the middle element.

  • Linear search works on both sorted and unsorted lists; binary search works only on sorted lists.

  • Linear search is slow for large lists (up to n comparisons); binary search is fast (about logβ‚‚n comparisons), e.g. 1000 items need at most 10 comparisons.

  • Linear search is simple to write; binary search is more complex.

You can find the other units of 10th Class Computer Science on the main page: FBISE 10th Class Computer Science short and long questions, all units.

Questions follow the FBISE SSC-II Computer Science syllabus and paper pattern. Please confirm all dates and figures on the official website: www.fbise.edu.pk

Need help with 10th Class Computer Science? Join our live online classes for the Federal Board. Book a free demo class.

All chapters of this subject

πŸ“Œ Struggling with this chapter? Join our live online tuition β€” one-to-one or small group classes with experienced teachers. Book a free demo class β†’

Ask a question about this topic

Your email address will not be published. Required fields are marked *