Skip to content

Federal (FBISE) · Chapter test · Free

2nd Year Computer Chapter 2 Test2. Computational Thinking & Algorithms 2

30 marks · 40 minutes · 21 questions. Covers: 2. Computational Thinking & Algorithms 2.

Your school name

2nd Year Computer Chapter 2 Test

2nd Year · Computer · Federal (FBISE)

Name: ____________Roll No: ________Class/Section: ________Date: ________Total marks: 30Time: 40 minutes

Q1. Multiple choice questions (Attempt all · 10 × 1 = 10)

  1. The factorial function example demonstrates:
    1. Sorting
    2. Searching
    3. Clear vs less clear code
    4. Looping
  2. Which of the following best describes a data structure?
    1. A method of arranging data
    2. A way to store and organize data in memory
    3. A physical interface design
    4. A location and easy interaction detection
  3. Arrays are efficient because:
    1. They are slow in accessing elements
    2. They need extra data
    3. Memory locations are contiguous
    4. None of these
  4. Each node of a linked list contains:
    1. Data and index
    2. Only data
    3. Only pointer
    4. Data and pointer
  5. Arrays are the simplest data structure used in:
    1. Mathematics
    2. Programming
    3. Graphics
    4. Database
  6. Adding an element to a queue is called:
    1. Pop
    2. Push
    3. Enqueue
    4. Dequeue
  7. Circular linked list forms a:
    1. Chain
    2. Line
    3. Circle
    4. Queue
  8. In a singly linked list, each node has:
    1. Data only
    2. Pointer only
    3. Data and next reference
    4. Two pointers
  9. The bottom nodes in a tree are known as:
    1. Parent nodes
    2. Child nodes
    3. Leaf nodes
    4. Root nodes
  10. In a doubly linked list, each node has:
    1. Two pointers
    2. One pointer
    3. Three pointers
    4. No pointer

Q2. Short questions (Attempt any 6 of 8 · 6 × 2 = 12)

  1. What are the two parts of a singly linked list node?
  2. What is clarity in an algorithm?
  3. What are arrays used for?
  4. Differentiate between connected and directed graph.
  5. What is the time complexity of Euclidean Algorithm?
  6. Define quadratic time complexity.
  7. What is a singly linked list?
  8. Which type of complexity does Merge Sort have?

Q3. Long questions (Attempt any 2 of 3 · 2 × 4 = 8)

  1. Describe the difference between Stack and Queue. How does their operation affect algorithm design? Provide one real-life example for each data structure.
  2. Compare and evaluate the efficiency of Bubble Sort and Merge Sort in sorting a list of 1,000 student names. Discuss in terms of time complexity and clarity. Which is more suitable and why?
  3. Explain the importance of tree traversal and its traversal techniques. Compare in-order traversal with examples and their use cases. Compare in-order, pre-order, and post-order traversal with examples and their use cases.