Class 9 Computer & AI Chapter 5: Logic, Algorithms & Complexity — practice questions with answers
Free practice for Class 9 Computer & AI, Chapter 5: Logic, Algorithms & Complexity. Try the solved questions below, then take a free test with instant marking and explanations.
44 questions13 easy, 23 medium, 8 hardNCERT · CBSE · State boards
Sample questions with solutions
Q1. When is A AND B true?
- Only when both A and B are true
- When at least one is true
- When both are false
- Always
Show answer
Answer: A. Only when both A and B are true
Why: T AND F = F. [AI for New Learner — Senior 1, Ch 5]
Why: T AND F = F. [AI for New Learner — Senior 1, Ch 5]
Q2. When is A OR B true?
- When at least one of A and B is true
- Only when both are true
- Only when both are false
- Never
Show answer
Answer: A. When at least one of A and B is true
Why: T OR F = T. [AI for New Learner — Senior 1, Ch 5]
Why: T OR F = T. [AI for New Learner — Senior 1, Ch 5]
Q3. What does Big-O notation describe?
- How the work an algorithm does grows as the input size n grows
- The exact running time in seconds
- The size of the computer
- The number of programmers
Show answer
Answer: A. How the work an algorithm does grows as the input size n grows
Why: Speed is a feature. [AI for New Learner — Senior 1, Ch 5]
Why: Speed is a feature. [AI for New Learner — Senior 1, Ch 5]
Q4. What is the Big-O of looping through every item of a list once?
- O(n)
- O(1)
- O(n²)
- O(log n)
Show answer
Answer: A. O(n)
Why: Doubling n doubles the work. [AI for New Learner — Senior 1, Ch 5]
Why: Doubling n doubles the work. [AI for New Learner — Senior 1, Ch 5]
Q5. What is the Big-O of comparing every pair of items in a list?
- O(n²)
- O(n)
- O(1)
- O(log n)
Show answer
Answer: A. O(n²)
Why: Doubling n means 4× the work. [AI for New Learner — Senior 1, Ch 5]
Why: Doubling n means 4× the work. [AI for New Learner — Senior 1, Ch 5]
Q6. What must be true before binary search can be used?
- The data must be sorted
- The data must be small
- The data must be text
- The data must be random
Show answer
Answer: A. The data must be sorted
Why: Halving only works on sorted data. [AI for New Learner — Senior 1, Ch 5]
Why: Halving only works on sorted data. [AI for New Learner — Senior 1, Ch 5]
Practise all 44 questions free
Timed test, marked instantly, with the correct answer and explanation for every question and a chapter-wise report.
Start the free testFrequently asked questions
How many practice questions are there for Class 9 Computer & AI Chapter 5: Logic, Algorithms & Complexity?
44 questions (13 easy, 23 medium, 8 hard). A few are solved on this page; the free test shows the answer and explanation for every question after you submit.
Is this chapter from the NCERT book?
Yes — it follows the NCERT Class 9 Computer & AI syllabus, used by CBSE and many state boards.