Skip to content

Punjab (PTB) · Chapter test · Free

1st Year Computer Chapter 3 TestAlgorithms and Problem Solving

30 marks · 40 minutes · 21 questions. Covers: CHAP 3:Algorithms and Problem Solving.

Your school name

1st Year Computer Chapter 3 Test

1st Year · Computer · Punjab (PTB)

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

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

  1. What is Class P in computational complexity?

    1. Problems that take forever to solve

    2. Problems that are unsolvable

    3. Problems that can be solved efficiently

    4. Problems with no inputs

  2. Why is Bubble Sort not recommended for large datasets?

    1. It uses too much memory

    2. It requires sorting the list multiple times

    3. It has a high time complexity of O(n²)

    4. It only works with small lists

  3. Time complexity of Depth-First Search (DFS) in a graph is:

    1. O(n log n)

    2. O(V)

    3. O(V + E)

    4. O(n)

  4. What is unique about Class NP problems?

    1. They can't be solved at all

    2. Their solutions are impossible to verify

    3. Solutions can be verified quickly

    4. They never have solutions.

  5. Backtracking is most similar to which real-world activity?

    1. Writing a story

    2.  Exploring a maze

    3. Solving a math problem

    4. Watching a movie

  6. Which of the following is true about Selection Sort?

    1. It is always the fastest sorting algorithm

    2. It is easy to understand and implement but not efficient for large datasets

    3. It sorts the list in only one pass

    4. It works well with large datasets but not with small ones

  7. What does BFS explore in a graph?

    1. Nodes one by one

    2. Nodes level by level

    3. Nodes randomly

    4. Only leaf nodes

  8. Which sorting algorithm is based on Divide and Conquer?

    1. Bubble Sort

    2. Selection Sort

    3. Merge Sort

    4. Insertion Sort

  9. Which Big O notation represents the fastest performance?

    1. O(n²)

    2. O(n)

    3. 0(1)

    4. d O(log n)

  10. What is true about NP-Hard problems?

    1. They are easy to solve

    2. They have no solution

    3. They are at least as hard as the hardest NP problems

    4. They can always be solved in polynomial time

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

  1. Why is the GCD problem considered solvable?

  2. What is the main application of BFS in real-world scenarios?

  3. What is the time complexity of selection sort?

  4. When is Dynamic Programming most effective?

  5. What kind of problems are in Class P?

  6. How does Dynamic Programming improve efficiency?

  7. What is a solvable problem in computer science?

  8. How does Linear Search work?

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

  1. Discuss the differences between time complexity and space complexity. How do they impact the choice of an algorithm for a specific problem?

  2. Discuss the advantages and disadvantages of using Bubble sort for sorting large datasets. 

  3. Explain how Dynamic Programming can optimize the calculation of the Fibonacci sequence.