Department of Computer Science and Engineering
CourseCode/CourseName: 23CS1402/COMPUTATIONAL THINKING
UNIT I – MCQ – SET A
Year/Semester :II/IV Max Time : 30 Mins
Regulation :2023 Max Marks : 30
1. In an algorithm, a ________ is used to represent the sequence of steps. CO1
o A) Flowchart
o B) Code
o C) Function
o D) Statement
o Answer: A) Flowchart
2. What is time complexity of fun()? CO1
int fun(int n)
int count = 0;
for (int i = n; i > 0; i /= 2)
for (int j = 0; j < i; j++)
count += 1;
return count;
o A) O(n2)
o B) O(n*log(n))
o C) O(n)
o D) O(n*log(n*Log(n)))
o Answer:B) O(n*log(n))
3. What is the time taken for a computer (that could execute 2 3 CO1
complexity 𝑇(𝑛) = 3𝑛 2 ?
instructions per second) to execute 103 instructions of algorithm A with
A) 250 × 106
B) 3 × 106
o
C) 375 × 106
o
o
D) 125 × 106
Answer: c) 𝟑𝟕𝟓 × 𝟏𝟎?
o
o
4. Which notation is used to describe the growth rate of an algorithm in CO1
the worst case?
o A) Big O notation
o B) Big Theta notation
o C) Big Omega notation
o D) Little o notation
o Answer: A) Big O notation
5. Find the odd one from the following for time complexity. CO1
o A) Run Time
o B) Compile Time
o C) Execution Time
o D) Storage Time
o Answer: d) Storage Time
6. Predicting the future stock price comes under which of the following CO1
algorithms?
o A) Recursion Algorithm
o B) Exact Algorithm
o C) Non-Deterministic Algorithm
o D) Deterministic Algorithm
o Answer: c) Non-Deterministic Algorithm
7. What is the purpose of asymptotic analysis? CO1
o A) To calculate memory usage
o B) To measure the input size of the problem
o C) To determine the efficiency of an algorithm
o D) To define a problem-solving strategy
o Answer: C) To determine the efficiency of an algorithm
8. Which of the following is a feature of computational problems? CO1
a) Always have a solution
b) Can be expressed in terms of an algorithm
c) Require human intervention
d) Cannot be optimized
Answer: b) Can be expressed in terms of an algorithm
9. What does Big Omega notation describe? CO1
o A) Worst-case complexity
o B) Best-case complexity
o C) Exact time complexity
o D) None of the above
o Answer: B) Best-case complexity
10. Which of the following is not a part of an algorithm’s control flow? CO1
o A) Sequence
o B) Branching
o C) Looping
o D) Variables
o Answer: D) Variables
11. Given ‘n’ vertices of a graph. What is the maximum number of edges CO1
possible?
a) 𝑛(𝑛−1) 2
b) nP2
c) n!
d) nC2 / nP2
Answer: a) 𝒏(𝒏−𝟏)
12. Consider a printer job where the jobs are executed based on job created CO1
time. Which of the following principles is used?
o First Come First Serve (FCFS)
o Weight-Based Priority Execution
o Last Come First Serve (LCFS)
o Round Robin Method
o Answer: a) First Come First Serve (FCFS)
13. Which of these is used for mathematical analysis of recursive CO1
algorithms?
o A) Recursion Tree
o B) Master Theorem
o C) Flowchart
o D) Program analysis
o Answer: B) Master Theorem
14. The average-case time complexity considers: CO1
o A) The best scenario for an algorithm
o B) The time for the worst input
o C) The time for random input cases
o D) None of the above
o Answer: C) The time for random input cases
15. A ________ represents a non-recursive algorithm. CO1
o A) Quick Sort
o B) Merge Sort
o C) Heap Sort
o D) Selection Sort
o Answer: D) Selection Sort
16. Problems that cannot be solved within a reasonable amount of computer CO1
resources are called:
o Insolvable problems
o Complex problems
o Intractable problems
o Challenging problems
o Answer: c) Intractable problems
17. Which of the following is an example of a non-recursive algorithm? CO1
o A) Quick Sort
o B) Binary Search
o C) Merge Sort
o D) Fibonacci Sequence
o Answer: B) Binary Search
18. What does Big Omega notation represent? CO1
o A) Worst-case complexity
o B) Lower bound of an algorithm's time complexity
o C) Average-case complexity
o D) None of the above
o Answer: B) Lower bound of an algorithm's time
complexity
19. Which of the following is a building block of an algorithm? CO1
o A) Control structures
o B) Flowcharts
o C) Data types
o D) Programming languages
o Answer: A) Control structures
20. A flowchart is used to: CO1
o A) Show the input-output relationship of an algorithm
o B) Illustrate the steps and decision-making process in an
algorithm
o C) Write the algorithm in code
o D) All of the above
o Answer: B) Illustrate the steps and decision-making
process in an algorithm
21. Which of the following is an advantage of recursive algorithms? CO1
o A) They are faster
o B) They are easier to implement for divide-and-conquer
problems
o C) They require less memory
o D) They do not have a base case
o Answer: B) They are easier to implement for divide-
and-conquer problems
22. What is the purpose of a flowchart in algorithm design? CO1
o A) To illustrate the algorithm’s steps and decision points
o B) To write the actual code of the algorithm
o C) To define the data types used
o D) To perform time complexity analysis
o Answer: A) To illustrate the algorithm’s steps and
decision points
23. Which of the following is a common notation used for analyzing the CO1
performance of algorithms?
o A) Big O
o B) Big Beta
o C) Little o
o D) Alpha notation
o Answer: A) Big O
24. In the worst-case time complexity, the algorithm’s performance is CO1
represented by:
o A) The best possible scenario
o B) The worst possible scenario
o C) The average scenario
o D) None of the above
o Answer: B) The worst possible scenario
25. Which type of algorithm can be considered for problems that naturally CO1
divide into smaller subproblems?
o A) Non-recursive algorithms
o B) Greedy algorithms
o C) Divide-and-conquer algorithms
o D) Dynamic programming algorithms
o Answer: C) Divide-and-conquer algorithms
26. Which of these is not a property of pseudocode? CO1
a) Easy to understand
b) Machine-executable
c) Language-independent
d) Algorithmic
Answer: b) Machine-executable
27. Which asymptotic notation describes the average-case time CO1
complexity of an algorithm?
o Big-O (O)
o Theta (Θ)
o Omega (Ω)
o Theta (Θ) for worst-case
o Answer: b) Theta (Θ)
28. The notation Omega (Ω) describes the ________ time complexity of CO1
an algorithm.
o Upper bound
o Lower bound
o Average-case
o Worst-case
o Answer: b) Lower bound
29. Which of the following is true about high-level programming CO1
languages?
o They are machine-dependent
o They are easier for humans to read and write
o They require manual memory management
o They are not suitable for algorithm design
o Answer: b) They are easier for humans to read and write
30. The best-case time complexity of an algorithm represents:A) The CO1
minimum time required
o B) The maximum time required
o C) The average time required
o D) None of the above
o Answer: A) The minimum time required
Department of CSE
Course Code / Course Name :23CS1402/COMPUTATIONAL THINKING
UNIT I – MCQ – SET B
Year/Semester :II/IV Max Time : 30 Mins
Regulation :2023 Max Marks : 30
1. Which of the following is a computational problem? CO1
a) Adding two numbers
b) Solving a jigsaw puzzle
c) Finding the shortest path in a graph
d) All of the above
Answer: d
2. What is an optimization problem? CO1
a) Finding a solution for a problem
b) Finding the best solution from all feasible solutions
c) Sorting a list in ascending order
d) Performing a computation without errors
Answer: b
3. Which is NOT a characteristic of a computational problem? CO1
a) It has input and output.
b) It requires a defined set of steps to solve.
c) It must always have a unique solution.
d) It can be solved using algorithms.
Answer: c
4. Which of these problems can be solved in polynomial time? CO1
a) Sorting an array
b) Traveling Salesman Problem
c) Knapsack Problem
d) Subset Sum Problem
Answer: a
5. Which term describes problems with no efficient solution but easy CO1
verification?
a) P
b) NP
c) NP-complete
d) NP-hard
Answer: b
6. What is the first step in designing an algorithm? CO1
a) Implementing the code
b) Understanding the problem
c) Testing the solution
d) Analyzing the complexity
Answer: b
7. Which of the following is an example of a greedy algorithm? CO1
a) Quick Sort
b) Dijkstra’s Algorithm
c) Binary Search
Department of CSE
Course Code / Course Name :23CS1402/COMPUTATIONAL THINKING
d) Depth-First Search
Answer: b
8. Which sorting algorithm is based on the divide-and-conquer CO1
approach?
a) Merge Sort
b) Bubble Sort
c) Selection Sort
d) Insertion Sort
Answer: a
9. Dynamic programming is used when a problem has: CO1
a) Non-overlapping subproblems
b) Overlapping subproblems
c) No subproblems
d) Independent subproblems
Answer: b
10. What is the key characteristic of a randomized algorithm? CO1
a) Deterministic execution
b) Use of random numbers
c) Guaranteed optimal solution
d) No use of loops
Answer: b
11. Which of the following is a control flow statement? CO1
a) Variable declaration
b) For loop
c) Function definition
d) Array initialization
Answer: b
12. What does a function return in most programming languages? CO1
a) Control flow
b) A value or result
c) A loop structure
d) None of the above
Answer: b
13. What is the purpose of a conditional statement? CO1
a) To repeat code
b) To make decisions based on conditions
c) To define a block of reusable code
d) To declare variables
Answer: b
14. Which of the following is an example of iteration? CO1
a) If-else
b) For loop
c) Switch-case
d) Variable declaration
Answer: b
15. What is a key advantage of using functions in algorithms? CO1
a) Makes the algorithm faster
Department of CSE
Course Code / Course Name :23CS1402/COMPUTATIONAL THINKING
b) Reduces memory usage
c) Enhances modularity and reusability
d) Avoids conditional statements
Answer: c
16. What is a pseudocode? CO1
a) A flowchart representation
b) A programming language
c) A textual representation of an algorithm
d) None of the above
Answer: c
17. In a flowchart, what does a diamond shape represent? CO1
a) A process
b) A decision point
c) An input/output operation
d) A terminal point
Answer: b
18. Which of the following is a key advantage of pseudocode? CO1
a) Language independence
b) Execution speed
c) Complex syntax
d) None of the above
Answer: a
19. What is a limitation of flowcharts? CO1
a) Cannot represent conditions
b) Difficult to represent algorithms visually
c) Becomes complicated for large algorithms
d) Cannot show sequential steps
Answer: c
20. What is the purpose of a decision table? CO1
a) To represent code visually
b) To list all possible outcomes of decisions
c) To show the exact syntax of code
d) To replace pseudocode entirely
Answer: b
21. Which of the following is an oral algorithm for making tea? CO1
a) Boil water → Add tea leaves → Steep → Serve
b) Mix tea leaves and water → Serve
c) Add sugar → Serve
d) Boil water → Serve
Answer: a
22. Why should oral algorithms use clear steps? CO1
a) To reduce ambiguity
b) To increase memory usage
c) To make tasks more complex
d) To replace written instructions
Answer: a
23. What is the first step in creating an oral algorithm? CO1
a) Implementing the task
b) Testing the task
c) Understanding the objective
Department of CSE
Course Code / Course Name :23CS1402/COMPUTATIONAL THINKING
d) Ignoring all conditions
Answer: c
24. Which of the following is NOT a feature of oral algorithms? CO1
a) Informal language
b) Ambiguous instructions
c) Sequential steps
d) Real-world applicability
Answer: b
25. How can oral algorithms be optimized? CO1
a) By removing unnecessary steps
b) By adding extra steps
c) By ignoring sequence
d) By using random instructions
Answer: a
26. What does Big O notation represent? CO1
a) Lower bound of an algorithm’s complexity
b) Upper bound of an algorithm’s complexity
c) Average complexity of an algorithm
d) Exact complexity of an algorithm
Answer: b
27. What is the time complexity of a binary search? CO1
a) O(1)
b) O(log n)
c) O(n)
d) O(n log n)
Answer: b
28. Which of the following is NOT a property of asymptotic notations? CO1
a) Transitivity
b) Reflexivity
c) Symmetry
d) Multiplicative constants
Answer: c
29. Which of the following complexities is the best? CO1
a) O(n)
b) O(n log n)
c) O(1)
d) O(n²)
Answer: c
30. What is the purpose of Omega (Ω) notation? CO1
a) To describe upper bound
b) To describe average case
c) To describe lower bound
d) To describe exact complexity
Answer: c
Department of CSE
Course Code / Course Name :23CS1402/COMPUTATIONAL THINKING
UNIT I – MCQ – SET C
Year/Semester :II/IV Max Time : 30 Mins
Regulation :2023 Max Marks : 30
1. What is backtracking used for? CO1
a) To solve optimization problems only
b) To explore all possible solutions for a problem
c) To sort data in linear time
d) To perform binary search
Answer: b
2. Which of these problems can be solved using backtracking? CO1
a) N-Queens Problem
b) Dijkstra's Algorithm
c) Quick Sort
d) Matrix Multiplication
Answer: a
3. What happens when a constraint is violated in backtracking? CO1
a) The algorithm stops entirely.
b) The algorithm backtracks to a previous state.
c) The algorithm continues with the current state.
d) The algorithm ignores the constraint.
Answer: b
4. How does backtracking differ from brute force? CO1
a) Backtracking systematically prunes impossible solutions.
b) Backtracking does not require recursion.
c) Backtracking guarantees an optimal solution.
d) Backtracking solves problems in linear time.
Answer: a
5. Which data structure is commonly used to implement CO1
backtracking?
a) Stack
b) Queue
c) Linked List
d) Heap
Answer: a
6. What does the best-case analysis of an algorithm focus on? CO1
a) The average input scenario
b) The simplest possible input
c) The most complex input
d) None of the above
Answer: b
7. What is the worst-case complexity of linear search? CO1
a) O(1)
b) O(log n)
c) O(n)
d) O(n²)
Department of CSE
Course Code / Course Name :23CS1402/COMPUTATIONAL THINKING
UNIT I – MCQ – SET C
Answer: c
8. In average-case analysis, what is assumed about the input? CO1
a) All inputs are equally likely
b) Inputs are arranged in ascending order
c) Inputs are always the worst-case scenario
d) Inputs are predefined
Answer: a
9. What is the primary goal of analyzing best, worst, and average CO1
cases?
a) To guarantee faster runtime
b) To understand the algorithm’s performance for all inputs
c) To ensure the algorithm is bug-free
d) To reduce memory usage
Answer: b
10. Which of the following is a true statement about average-case CO1
complexity?
a) It is always better than the worst case.
b) It depends on the distribution of input.
c) It cannot be calculated for recursive algorithms.
d) It is always equal to the best case.
Answer: b
11. What is the primary objective of an algorithm? CO1
a) To solve a problem efficiently
b) To provide an exact solution always
c) To ensure code compiles without errors
d) To replace all manual processes
Answer: a
12. Which of the following algorithms is NOT comparison-based? CO1
a) Merge Sort
b) Bubble Sort
c) Radix Sort
d) Quick Sort
Answer: c
13. Which algorithm uses a divide-and-conquer approach? CO1
a) Kruskal’s Algorithm
b) Merge Sort
c) Bellman-Ford Algorithm
d) Depth-First Search
Answer: b
14. What type of problems are solved by greedy algorithms? CO1
a) Problems requiring a global solution
b) Problems that allow local optimization
c) Problems that involve recursion
d) Problems that are deterministic
Answer: b
15. What is the time complexity of Binary Search? CO1
a) O(n)
b) O(log n)
c) O(n log n)
d) O(1)
Answer: b
Department of CSE
Course Code / Course Name :23CS1402/COMPUTATIONAL THINKING
UNIT I – MCQ – SET C
16. Which of the following is an example of a control statement? CO1
a) Variable declaration
b) Function call
c) If-else
d) Array initialization
Answer: c
17. What does a function typically include? CO1
a) Input parameters, logic, and return value
b) Variables only
c) Loop structures
d) File handling code
Answer: a
18. Which control flow statement is used to execute a block of code CO1
multiple times?
a) If statement
b) Loop statement
c) Function definition
d) Switch case
Answer: b
19. What is a key characteristic of the state in an algorithm? CO1
a) It always involves recursion.
b) It represents the current status of all variables.
c) It ignores input values.
d) It cannot change during execution.
Answer: b
20. Which of the following is NOT a building block of an algorithm? CO1
a) Statements
b) Functions
c) Control Flow
d) Operating System
Answer: d
21. What does pseudocode help achieve? CO1
a) Syntax-specific implementation
b) Language independence
c) High execution speed
d) Complex debugging
Answer: b
22. Which symbol is used to represent a process in a flowchart? CO1
a) Diamond
b) Rectangle
c) Circle
d) Parallelogram
Answer: b
23. Which of the following is NOT typically part of a flowchart? CO1
a) Start/End symbol
b) Input/Output symbol
c) Programming syntax
Department of CSE
Course Code / Course Name :23CS1402/COMPUTATIONAL THINKING
UNIT I – MCQ – SET C
d) Decision symbol
Answer: c
24. Why is pseudocode preferred in algorithm design? CO1
a) It is directly executable.
b) It provides an abstract representation of logic.
c) It avoids using conditional statements.
d) It eliminates debugging requirements.
Answer: b
25. Which symbol in a flowchart represents input/output operations? CO1
a) Rectangle
b) Parallelogram
c) Diamond
d) Oval
Answer: b
26. What is the purpose of Theta (Θ) notation? CO1
a) Describes only upper bound
b) Describes both upper and lower bounds
c) Describes the best case
d) Describes average-case performance
Answer: b
27. What does the term "asymptotic" refer to in asymptotic analysis? CO1
a) Performance of small input sizes
b) Performance for very large input sizes
c) Performance for zero input size
d) Performance in real-time systems
Answer: b
28. Which of these complexities grows the fastest as nnn increases? CO1
a) O(n log n)
b) O(n²)
c) O(n³)
d) O(2^n)
Answer: d
29. What is the best-case time complexity of Quick Sort? CO1
a) O(n²)
b) O(n log n)
c) O(n)
d) O(1)
Answer: b
30. Which notation describes the smallest growth rate? CO1
a) O(n²)
b) O(log n)
c) O(1)
d) O(n log n)
Answer: c
Department of CSE
Course Code / Course Name :23CS1402/COMPUTATIONAL THINKING
UNIT I – MCQ – SET D
Year/Semester :II/IV Max Time : 30 Mins
Regulation :2023 Max Marks : 30
1. Why is worst-case analysis commonly used? CO1
a) It provides the fastest execution scenario.
b) It guarantees performance limits.
c) It is easier to calculate than average case.
d) It ignores extreme inputs.
Answer: b
2. Which of the following statements is true about average-case CO1
analysis?
a) It always equals the worst case.
b) It is not affected by input distribution.
c) It gives a probabilistic performance estimate.
d) It provides the exact runtime of the algorithm.
Answer: c
3. What is the worst-case complexity of Merge Sort? CO1
a) O(n)
b) O(log n)
c) O(n log n)
d) O(n²)
Answer: c
4. In which scenario is the best case equal to the worst case? CO1
a) Binary Search
b) Bubble Sort
c) Linear Search
d) Selection Sort
Answer: d
5. What determines the average case of an algorithm? CO1
a) Input size
b) Input distribution
c) Algorithm design
d) Compiler efficiency
Answer: b
6. What does the recurrence relation represent? CO1
a) Relationship between variables
b) Recursive computation time
c) Iterative computation time
d) Space complexity
Answer: b
7. What is the recurrence relation for the Tower of Hanoi problem? CO1
a) T(n)=2T(n−1)+1T(n) = 2T(n-1) + 1T(n)=2T(n−1)+1
b) T(n)=T(n−1)+O(n)T(n) = T(n-1) + O(n)T(n)=T(n−1)+O(n)
c) T(n)=2nT(n) = 2^nT(n)=2n
d) T(n)=nT(n−1)+O(1)T(n) = nT(n-1) + O(1)T(n)=nT(n−1)+O(1)
Department of CSE
Course Code / Course Name :23CS1402/COMPUTATIONAL THINKING
UNIT I – MCQ – SET D
Answer: a
8. Which of the following tools is used to solve recurrence relations? CO1
a) Master Theorem
b) Hash Tables
c) Divide-and-Conquer
d) Sorting Algorithms
Answer: a
9. What is the primary difference between recursive and iterative CO1
approaches?
a) Recursive uses stack memory; iterative uses loops.
b) Recursive is faster than iterative.
c) Iterative can solve all recursive problems.
d) Recursive ignores base cases.
Answer: a
10. What is the time complexity of a recursive Fibonacci algorithm? CO1
a) O(n)
b) O(log n)
c) O(2^n)
d) O(n²)
Answer: c
11. What is the main principle of backtracking? CO1
a) Iterating through all possible solutions
b) Solving sub-problems independently
c) Exploring and abandoning infeasible paths
d) Dividing the problem into two equal parts
Answer: c
12. Which problem is a classic example of backtracking? CO1
a) Prim’s Algorithm
b) Traveling Salesman Problem
c) Sudoku Solver
d) Floyd-Warshall Algorithm
Answer: c
13. How does backtracking handle constraints? CO1
a) By ignoring constraints
b) By validating constraints at each step
c) By solving the problem iteratively
d) By sorting the input
Answer: b
14. What does backtracking ensure during problem solving? CO1
a) Only one solution is found.
b) All possible solutions are explored.
c) The solution is found in logarithmic time.
d) The memory usage is minimal.
Answer: b
15. Which data structure is most suitable for implementing CO1
backtracking?
a) Queue
b) Stack
c) Tree
d) Linked List
Answer: b
Department of CSE
Course Code / Course Name :23CS1402/COMPUTATIONAL THINKING
UNIT I – MCQ – SET D
16. Which algorithm finds the shortest path in a weighted graph? CO1
a) Kruskal’s Algorithm
b) Dijkstra’s Algorithm
c) Bubble Sort
d) Quick Sort
Answer: b
17. What type of algorithm is Depth-First Search (DFS)? CO1
a) Greedy Algorithm
b) Divide-and-Conquer
c) Backtracking Algorithm
d) Dynamic Programming
Answer: c
18. Which algorithm is based on dynamic programming? CO1
a) Bellman-Ford Algorithm
b) Kruskal’s Algorithm
c) Merge Sort
d) Binary Search
Answer: a
19. What is the purpose of the Divide-and-Conquer approach? CO1
a) To solve large problems directly
b) To divide a problem into smaller, solvable sub-problems
c) To ensure recursive implementation
d) To minimize memory usage
Answer: b
20. Which of the following algorithms uses a greedy approach? CO1
a) Prim’s Algorithm
b) Merge Sort
c) Depth-First Search
d) Tower of Hanoi
Answer: a
21. What does the diamond symbol in a flowchart represent? CO1
a) A process
b) A decision
c) Start/End
d) Input/Output
Answer: b
22. What is an advantage of using flowcharts? CO1
a) They are always concise.
b) They improve code readability.
c) They visually represent logic flow.
d) They eliminate errors.
Answer: c
23. Which of the following is NOT a part of pseudocode? CO1
a) Mathematical expressions
b) Language-specific syntax
c) Loops
d) Conditional statements
Answer: b
Department of CSE
Course Code / Course Name :23CS1402/COMPUTATIONAL THINKING
UNIT I – MCQ – SET D
24. What does a parallelogram in a flowchart indicate? CO1
a) Input/Output operations
b) Decision-making
c) Process execution
d) Loops
Answer: a
25. Why is pseudocode considered language-independent? CO1
a) It uses a high-level, abstract approach.
b) It avoids control structures.
c) It is directly executable.
d) It provides the shortest path to solutions.
Answer: a
26. What does the Master Theorem help solve? CO1
a) Sorting problems
b) Recurrence relations
c) Graph traversal
d) Asymptotic complexity for non-recursive algorithms
Answer: b
27. What is the time complexity of iterative binary search? CO1
a) O(log n)
b) O(n)
c) O(n²)
d) O(1)
Answer: a
28. Which of the following simplifies recurrence relations? CO1
a) Divide-and-Conquer
b) Iterative Substitution
c) Backtracking
d) Heuristic Methods
Answer: b
29. Which mathematical method evaluates recursive algorithms? CO1
a) Big-O Notation
b) Recurrence Relations
c) Asymptotic Notation
d) Flowcharting
Answer: b
30. What is the complexity of the recursive factorial function? CO1
a) O(1)
b) O(n)
c) O(n²)
d) O(log n)
Answer: b
Department of CSE
Course Code / Course Name :23CS1402/COMPUTATIONAL THINKING
UNIT I – MCQ – SET E
Year/Semester :II/IV Max Time : 30 Mins
Regulation :2023 Max Marks : 30
1. What is a key feature of a "state" in algorithms? CO1
a) It is immutable.
b) It tracks variable values at a specific point in time.
c) It is always dynamic.
d) It exists only in iterative algorithms.
Answer: b
2. What does a loop structure achieve in an algorithm? CO1
a) Executes a set of statements repeatedly
b) Validates input values
c) Ensures program termination
d) Divides the problem into sub-problems
Answer: a
3. Which control statement is used to skip the current iteration of a CO1
loop?
a) Break
b) Continue
c) Return
d) Goto
Answer: b
4. Which function type does not return any value? CO1
a) Pure function
b) Recursive function
c) Void function
d) Nested function
Answer: c
5. What is the main purpose of control flow in an algorithm? CO1
a) To manage the sequence of execution
b) To optimize memory usage
c) To provide variable declarations
d) To handle user input
Answer: a
6. Which of these is an example of a sequential control structure? CO1
a) If-else statement
b) Switch statement
c) Simple statements executed one after another
d) Nested loops
Answer: c
7. What is the function of a "return" statement in an algorithm? CO1
a) Terminates the algorithm
b) Outputs a value and exits the current function
c) Repeats a block of code
d) Calls another function
Answer: b
8. What is an advantage of modular design in algorithms? CO1
Department of CSE
Course Code / Course Name :23CS1402/COMPUTATIONAL THINKING
UNIT I – MCQ – SET E
a) It eliminates the need for variables.
b) It improves readability and reusability.
c) It makes algorithms language-specific.
d) It increases complexity.
Answer: b
9. Which part of an algorithm checks conditions? CO1
a) Iterative blocks
b) Conditional statements
c) Sequential blocks
d) Function declarations
Answer: b
10. What type of loop executes at least once, regardless of the CO1
condition?
a) For loop
b) While loop
c) Do-while loop
d) Infinite loop
Answer: c
11. Which of these is an example of a sequential control structure? CO1
a) If-else statement
b) Switch statement
c) Simple statements executed one after another
d) Nested loops
Answer: c
12. What is the function of a "return" statement in an algorithm? CO1
a) Terminates the algorithm
b) Outputs a value and exits the current function
c) Repeats a block of code
d) Calls another function
Answer: b
13. What is an advantage of modular design in algorithms? CO1
a) It eliminates the need for variables.
b) It improves readability and reusability.
c) It makes algorithms language-specific.
d) It increases complexity.
Answer: b
14. Which part of an algorithm checks conditions? CO1
a) Iterative blocks
b) Conditional statements
c) Sequential blocks
d) Function declarations
Answer: b
15. What type of loop executes at least once, regardless of the CO1
condition?
a) For loop
b) While loop
c) Do-while loop
d) Infinite loop
Answer: c
Department of CSE
Course Code / Course Name :23CS1402/COMPUTATIONAL THINKING
UNIT I – MCQ – SET E
16. What is the output of Kruskal’s algorithm? CO1
a) Minimum spanning tree
b) Shortest path tree
c) Maximum flow in a network
d) Topological order
Answer: a
17. Which algorithm is used to detect cycles in a graph? CO1
a) Dijkstra’s Algorithm
b) Depth-First Search (DFS)
c) Prim’s Algorithm
d) Binary Search
Answer: b
18. Which algorithm efficiently solves the single-source shortest path CO1
problem in a graph with negative weights?
a) Floyd-Warshall Algorithm
b) Dijkstra’s Algorithm
c) Bellman-Ford Algorithm
d) Prim’s Algorithm
Answer: c
19. Which data structure is ideal for implementing Dijkstra’s CO1
algorithm?
a) Stack
b) Priority Queue
c) Binary Tree
d) Linked List
Answer: b
20. Which sorting algorithm uses the Divide-and-Conquer approach? CO1
a) Bubble Sort
b) Quick Sort
c) Insertion Sort
d) Selection Sort
Answer: b
21. Which notation provides the tightest bound for an algorithm’s CO1
performance?
a) O(n)
b) Θ(n)
c) Ω(n)
d) O(n²)
Answer: b
22. What is the property of Big-O notation? CO1
a) Represents the exact runtime
b) Describes upper bound performance
c) Represents only average-case complexity
d) Ensures optimal memory usage
Department of CSE
Course Code / Course Name :23CS1402/COMPUTATIONAL THINKING
UNIT I – MCQ – SET E
Answer: b
23. What does the notation Ω(n) represent? CO1
a) Upper bound
b) Average case
c) Best-case performance
d) Lower bound
Answer: d
24. For which of the following is O(n log n) time complexity typical? CO1
a) Linear Search
b) Bubble Sort
c) Merge Sort
d) Binary Search
Answer: c
25. What is the purpose of asymptotic analysis? CO1
a) To find the exact time taken by an algorithm
b) To evaluate an algorithm’s efficiency as input size grows
c) To analyze hardware performance
d) To calculate average-case complexity only
Answer: b
26. What is the primary goal of mathematical analysis in algorithms? CO1
a) To optimize code readability
b) To analyze runtime and space complexity
c) To eliminate recursion
d) To compare programming languages
Answer: b
27. What does the recurrence relation T(n)=2T(n/2)+O(n)T(n) = CO1
2T(n/2) + O(n)T(n)=2T(n/2)+O(n) represent?
a) Linear Search
b) Merge Sort
c) Bubble Sort
d) Depth-First Search
Answer: b
28. Which theorem is commonly used to solve recurrence relations? CO1
a) Pythagoras Theorem
b) Master Theorem
c) Euler’s Theorem
d) Fermat’s Theorem
Answer: b
29. What is the time complexity of the recursive Tower of Hanoi CO1
problem?
a) O(n)
b) O(2^n)
c) O(n²)
d) O(log n)
Answer: b
30. Which method is used to convert a recursive algorithm into a non- CO1
Department of CSE
Course Code / Course Name :23CS1402/COMPUTATIONAL THINKING
UNIT I – MCQ – SET E
recursive algorithm?
a) Memoization
b) Iterative Substitution
c) Loop Unrolling
d) Backtracking
Answer: b
Department of CSE
Course Code / Course Name :23CS1402/COMPUTATIONAL THINKING
UNIT I – FB – SET A
Year/Semester :II/IV Max Time : 30 Mins
Regulation :2023 Max Marks : 30
1. Backtracking is a problem-solving technique that involves exploring all CO1
possible solutions and __________ when a solution path is determined
to be infeasible.
Answer: abandoning the path
2. In the N-Queens problem, backtracking tries to place a queen on the CO1
chessboard in such a way that no two queens are in the same
__________.
Answer: row, column, or diagonal
3. Backtracking is often used to solve problems where there are multiple CO1
__________ solutions to a problem, and each solution must be checked
for validity.
Answer: possible
4. In backtracking, if a current path is found to be invalid, the algorithm CO1
__________ and tries a different path.
Answer: backtracks
5. A key advantage of backtracking over brute-force search is that it can CO1
__________ infeasible solutions quickly, thereby saving time.
Answer: eliminate
6. A computational problem is a question or task that can be solved by a CO1
__________ algorithm.
Answer: well-defined
7. In computational theory, a problem is considered computationally CO1
__________ if it can be solved using a finite amount of time and
resources.
Answer: solvable
8. A problem that can be solved using an algorithm in a reasonable CO1
amount of time is classified as a __________ problem.
Answer: tractable
9. The process of determining whether a computational problem can be CO1
solved within given constraints is known as __________ analysis.
Answer: complexity
10. A problem is said to be __________ if it cannot be solved by any CO1
algorithm in finite time.
Answer: undecidable
11. An algorithm is a __________ sequence of instructions to solve a CO1
problem.
Department of CSE
Course Code / Course Name :23CS1402/COMPUTATIONAL THINKING
UNIT I – FB – SET A
Answer: step-by-step
12. The efficiency of an algorithm is measured by its __________ and CO1
memory consumption.
Answer: time complexity
13. An algorithm that solves a problem by breaking it down into smaller CO1
sub-problems and solving them recursively is known as a __________
algorithm.
Answer: divide-and-conquer
14. An algorithm that always chooses the best option at each step, without CO1
considering future consequences, is called a __________ algorithm.
Answer: greedy
15. An algorithm that guarantees finding the optimal solution to a problem CO1
is called an __________ algorithm.
Answer: exact
16. A statement in an algorithm is a single __________ that performs a CO1
specific action.
Answer: operation
17. The state of an algorithm refers to the __________ of all variables at a CO1
given point in time.
Answer: value
18. The flow of control in an algorithm determines the order in which CO1
__________ are executed.
Answer: statements
19. A function is a block of code designed to perform a specific task and CO1
may or may not return a __________.
Answer: value
20. The three main types of control flow structures in algorithms are CO1
sequence, __________, and iteration.
Answer: selection
21. Pseudocode is an informal way of representing an algorithm using CO1
__________ language constructs.
Answer: natural
22. A flowchart uses symbols like rectangles, diamonds, and ovals to CO1
visually represent the __________ of an algorithm.
Answer: logic
23. In programming languages, a function is defined using the __________ CO1
keyword in many languages like Python, Java, or C++.
Answer: def
24. In pseudocode, a decision structure is often represented by a CO1
Department of CSE
Course Code / Course Name :23CS1402/COMPUTATIONAL THINKING
UNIT I – FB – SET A
__________ symbol.
Answer: diamond
25. The flowchart symbol that represents the start or end of an algorithm is CO1
typically a __________.
Answer: oval
26. Big O notation (O(n)) represents the __________ bound of an CO1
algorithm.
Answer: upper
27. Big-Omega notation (Ω(n)) describes the __________ bound of an CO1
algorithm.
Answer: lower
28. Big-Theta notation (Θ(n)) provides a __________ bound for an CO1
algorithm's performance.
Answer: tight
29. If an algorithm has a time complexity of O(n log n), its performance CO1
grows __________ with the input size.
Answer: moderately
30. The asymptotic notation that describes the best-case time complexity is CO1
__________.
Answer: Omega (Ω)
Department of CSE
Course Code / Course Name :23CS1402/COMPUTATIONAL THINKING
UNIT I – FB – SET B
Year/Semester :II/IV Max Time : 30 Mins
Regulation :2023 Max Marks : 30
1. In backtracking, each decision point is referred to as a __________. CO1
Answer: node
2. Backtracking is particularly useful for problems where the search space CO1
is __________.
Answer: large
3. In backtracking, the process of eliminating infeasible solutions is CO1
referred to as __________.
Answer: pruning
4. The key idea behind backtracking is to make a decision, explore the CO1
resulting __________, and undo the decision if necessary.
Answer: state
5. The basic principle of backtracking is to explore a path as far as CO1
possible and then __________ when a dead-end is reached.
Answer: backtrack
6. The process of analyzing a problem’s requirements and determining if it CO1
can be solved with a finite number of steps is known as __________.
Answer: computational analysis
7. A __________ problem is one where it is impossible to find a solution CO1
algorithm in finite time.
Answer: undecidable
8. A __________ problem can be solved by any algorithm that has a CO1
definite number of steps to reach a solution.
Answer: computationally solvable
9. In identifying computational problems, a __________ is the exact CO1
description of the input and output that needs to be addressed.
Answer: specification
10. The __________ problem is one where the solution can be easily CO1
verified, but finding the solution itself is computationally difficult.
Answer: NP-complete
11. A control flow structure in an algorithm defines the __________ of CO1
execution.
Answer: order
12. An algorithm’s state at any point in its execution is represented by the CO1
values of all its __________.
Answer: variables
13. A __________ structure allows an algorithm to make a decision based CO1
on a condition (if-else).
Department of CSE
Course Code / Course Name :23CS1402/COMPUTATIONAL THINKING
Answer: conditional
14. A __________ structure in an algorithm repeatedly executes a block of CO1
code as long as a condition is true.
Answer: loop
15. In an algorithm, a __________ is a reusable block of code that performs CO1
a specific task.
Answer: function
16. An algorithm is said to have optimal performance if it is the most CO1
solution for a given problem.
Answer: efficient
17. The performance of an algorithm is analyzed by measuring its CO1
__________ complexity and __________ complexity.
Answer: time, space
18. The primary goal of designing an algorithm is to find a balance between CO1
__________ and __________.
Answer: correctness, efficiency
19. An algorithm is __________ if it always produces the correct output for CO1
any valid input.
Answer: correct
20. The process of comparing the performance of different algorithms is CO1
known as __________.
Answer: algorithm analysis
21. In best-case analysis, we focus on the __________ possible scenario for CO1
an algorithm's performance.
Answer: optimal
22. Worst-case analysis determines the maximum time an algorithm will CO1
take based on the __________ input size.
Answer: largest
23. Average-case analysis considers the expected performance of an CO1
algorithm based on __________ inputs.
Answer: random
24. For a linear search algorithm, the best-case time complexity is O(1) CO1
when the __________ element is at the beginning of the array.
Answer: target
25. The worst-case time complexity for a bubble sort algorithm is O(n²) CO1
when the list is in __________ order.
Answer: reverse
26. A recursive algorithm solves a problem by breaking it down into CO1
smaller __________ of the same problem.
Answer: sub-problems
27. In recursive algorithms, the __________ case defines when the CO1
recursion should stop.
Answer: base
28. The time complexity of the recursive Fibonacci function is exponential, CO1
specifically O(2^n), due to overlapping __________.
Answer: subproblems
Department of CSE
Course Code / Course Name :23CS1402/COMPUTATIONAL THINKING
29. In non-recursive algorithms, the solution is typically achieved by using CO1
__________ instead of recursion.
Answer: iteration
30. A recurrence relation is a mathematical equation that describes the time CO1
complexity of a __________ algorithm.
Answer: recursive
Department of CSE
Course Code / Course Name :23CS1402/COMPUTATIONAL THINKING
UNIT I – FB – SET C
Year/Semester :II/IV Max Time : 30 Mins
Regulation :2023 Max Marks : 30
1. In backtracking, the decision tree is used to explore all possible CO1
__________ for the problem.
Answer: solutions
2. The __________ condition is used in backtracking to determine CO1
whether a path is feasible.
Answer: feasibility
3. Backtracking is particularly useful in solving problems such as the CO1
__________ problem, where there are multiple constraints.
Answer: Sudoku
4. One advantage of backtracking over brute force is that it can eliminate CO1
large sections of the search space by using __________.
Answer: pruning
5. The backtracking approach is applied in many puzzle-solving CO1
algorithms, including the __________ puzzle.
Answer: n-queens
6. The time complexity of a recursive algorithm can often be determined CO1
by solving its __________ relation.
Answer: recurrence
7. Recursion involves solving a problem by dividing it into smaller CO1
__________ of the same problem.
Answer: subproblems
8. The time complexity of a non-recursive algorithm is usually more CO1
straightforward to determine because it involves fewer __________.
Answer: recursive calls
9. The solution to a recurrence relation for a recursive algorithm can often CO1
be found using the __________ method.
Answer: iterative substitution
10. In non-recursive algorithms, the solution is typically found through CO1
__________ rather than function calls.
Answer: iteration
11. In worst-case analysis, we examine the scenario where the algorithm CO1
takes the __________ time.
Answer: maximum
12. The average case time complexity considers the performance of an CO1
algorithm across all __________ inputs.
Answer: possible
13. For a sorting algorithm, the worst case occurs when the list is in CO1
__________ order.
Answer: reverse
14. Best-case analysis is used to determine the minimum time required by CO1
an algorithm when the input is __________.
Department of CSE
Course Code / Course Name :23CS1402/COMPUTATIONAL THINKING
UNIT I – FB – SET C
Answer: favorable
15. In the case of QuickSort, the best case occurs when the pivot element CO1
splits the array into __________ halves.
Answer: equal
16. Big-O notation describes the __________ of an algorithm in terms of its CO1
worst-case performance.
Answer: upper bound
17. In Big-Theta notation (Θ(n)), the function grows at the same rate as the CO1
input size for both the best and worst cases, making it a __________
bound.
Answer: tight
18. Big-Omega (Ω) notation expresses the __________ bound of an CO1
algorithm.
Answer: lower
19. The growth rate of the function n² is __________ than the growth rate CO1
of the function n log n.
Answer: faster
20. An algorithm with time complexity O(n log n) is considered CO1
__________ than one with time complexity O(n²).
Answer: more efficient
21. In pseudocode, a __________ is used to represent a process or action CO1
step.
Answer: action word (e.g., "print", "set", etc.)
22. A flowchart symbol with a rectangular shape represents a __________. CO1
Answer: process
23. The programming language that emphasizes readability and clarity of CO1
code is known as a __________ programming language.
Answer: high-level
24. In pseudocode, __________ is used to indicate that an algorithm should CO1
terminate or end.
Answer: end
25. A __________ is used in flowcharts to show the flow of execution CO1
between various steps.
Answer: arrow
26. A recursive algorithm often involves a base case that returns a result CO1
without making any further __________.
Answer: recursive calls
27. To solve a recurrence relation, the __________ method is used to find CO1
the time complexity of recursive algorithms.
Answer: master
28. In recursive algorithms, the time complexity often involves a CO1
combination of the __________ cost and the cost of solving
subproblems.
Answer: recursive
29. A non-recursive algorithm typically uses __________ to iterate over the CO1
Department of CSE
Course Code / Course Name :23CS1402/COMPUTATIONAL THINKING
UNIT I – FB – SET C
problem’s elements.
Answer: loops
30. In analyzing recursive algorithms, the recurrence relation expresses the total CO1
work done as a function of the size of the __________.
Answer: input
Department of CSE
Course Code / Course Name :23CS1402/COMPUTATIONAL THINKING
UNIT I – FB – SET D
Year/Semester :II/IV Max Time : 30 Mins
Regulation :2023 Max Marks : 30
1. Backtracking algorithms are often used to solve __________ problems CO1
that require finding all possible solutions.
Answer: combinatorial
2. In backtracking, the process of constructing solutions step-by-step and CO1
abandoning solutions that do not work is known as __________.
Answer: backtrack pruning
3. The __________ function is used in backtracking to systematically CO1
explore each option at every decision point.
Answer: recursive
4. A common backtracking problem is the __________ problem, where CO1
the goal is to place N queens on an N x N chessboard such that no two
queens attack each other.
Answer: N-queens
5. Backtracking is usually applied to problems with a __________ space, CO1
meaning there are many potential solutions to evaluate.
Answer: search
6. A problem is said to be __________ if it has no algorithmic solution CO1
that can be completed in a finite number of steps.
Answer: undecidable
7. An important part of computational problem identification is CO1
determining whether the problem is solvable using an algorithm that
runs in __________ time.
Answer: polynomial
8. A problem is considered __________ if it can be solved by a CO1
deterministic machine in polynomial time.
Answer: P-complete
9. In computational complexity, a problem that can be solved by a non- CO1
deterministic machine in polynomial time is considered to belong to the
__________ class.
Answer: NP
10. When analyzing computational problems, it is important to categorize CO1
them into problems of __________ and __________ based on whether
they are efficiently solvable.
Answer: tractable, intractable
11. A __________ algorithm is one in which every decision leads to an CO1
immediate solution, often used in greedy algorithms.
Answer: heuristic
12. A correct algorithm should not only produce the right output but also CO1
run in an __________ amount of time.
Answer: efficient
13. An algorithm that works by solving the problem in subproblems and CO1
combining their solutions is a __________ algorithm.
Answer: divide-and-conquer
14. In an algorithm, the __________ defines the order of operations CO1
performed, including the branching, decision-making, and loops.
Department of CSE
Course Code / Course Name :23CS1402/COMPUTATIONAL THINKING
UNIT I – FB – SET D
Answer: control flow
15. A binary search algorithm works by repeatedly dividing the search CO1
space in half, resulting in a time complexity of O(log n) in the
__________ case.
Answer: average
16. A statement in an algorithm can be either an __________, which CO1
modifies the state of variables, or a control flow statement, which alters
the program's execution path.
Answer: assignment
17. In the context of algorithms, the __________ indicates a possible path CO1
or outcome, depending on the conditions of the problem.
Answer: branch
18. A control flow structure used to repeat a set of instructions a number of CO1
times is called a __________.
Answer: loop
19. Functions in algorithms help to organize code into reusable blocks that CO1
can be invoked with different __________.
Answer: arguments
20. The state of an algorithm at any moment refers to the current values of CO1
all __________ involved in the computation.
Answer: variables
21. Pseudocode is a tool for designing algorithms that uses __________ CO1
structure and natural language elements.
Answer: informal
22. Flowcharts help to represent algorithms visually, where the process is CO1
typically represented by a __________.
Answer: rectangle
23. In pseudocode, the term “__________” is used to indicate an action, CO1
such as a computation or variable assignment.
Answer: do
24. A __________ in a flowchart represents the beginning and end of an CO1
algorithm or a process.
Answer: oval
25. A structured programming language is one that encourages the use of CO1
__________ programming principles, such as modularity and control
flow.
Answer: structured
26. Big-O notation provides an upper bound for the time complexity, CO1
meaning the algorithm's running time will not exceed the __________.
Answer: worst-case
27. In Big-O notation, O(n log n) indicates a performance improvement CO1
over O(n²), especially when the input size is __________.
Answer: large
Department of CSE
Course Code / Course Name :23CS1402/COMPUTATIONAL THINKING
UNIT I – FB – SET D
28. The Big-Omega (Ω) notation expresses the __________ performance of CO1
an algorithm, indicating its best-case time complexity.
Answer: lower-bound
29. When using Big-Theta (Θ) notation, the algorithm is guaranteed to CO1
perform within the same order of magnitude for both the best and
__________ cases.
Answer: worst
30. The time complexity of an algorithm can be described as O(n), where n CO1
represents the __________ of input data.
Answer: size
Department of CSE
Course Code / Course Name :23CS1402/COMPUTATIONAL THINKING
UNIT I – FB – SET E
Year/Semester :II/IV Max Time : 30 Mins
Regulation :2023 Max Marks : 30
1. The worst-case time complexity of a sorting algorithm represents the CO1
time required to sort an array when it is in __________ order.
Answer: reverse
2. In the average case, we assume that every input is equally likely, and CO1
the algorithm's time complexity is based on the __________ of all
possible inputs.
Answer: average
3. For QuickSort, the best-case time complexity occurs when the pivot CO1
element divides the list into __________ parts.
Answer: equal
4. The time complexity for bubble sort in the worst case is O(n²), which CO1
occurs when the input array is in __________ order.
Answer: reverse
5. The time complexity of selection sort remains O(n²) regardless of the CO1
order of the input, which means its best, worst, and average cases are all
__________.
Answer: O(n²)
6. The time complexity of the binary search algorithm is O(log n), which CO1
makes it __________ efficient than a linear search.
Answer: more
7. In recursive algorithms, the function calls are stacked in a __________, CO1
where each function call waits for the result of the next.
Answer: call stack
8. An iterative version of an algorithm often uses a __________ to control CO1
the number of repetitions rather than a recursive call.
Answer: loop
9. The primary advantage of using recursion in an algorithm is that it CO1
simplifies problems that can be broken down into __________
subproblems.
Answer: smaller
10. A divide-and-conquer approach splits a problem into smaller CO1
subproblems that are __________ solved and then merged together.
Answer: independently
11. Backtracking algorithms can be used to solve problems like the CO1
__________ problem, where the goal is to explore all possible subsets.
Answer: subset-sum
12. In backtracking, the __________ step is where we systematically search CO1
for a solution by moving to the next possibility.
Answer: recursive
13. The __________ approach in backtracking refers to abandoning a path CO1
as soon as it is determined not to lead to a solution.
Answer: pruning
14. One classic example of a problem that can be solved using backtracking CO1
Department of CSE
Course Code / Course Name :23CS1402/COMPUTATIONAL THINKING
is the __________ problem, where we try to find a valid coloring for a
graph.
Answer: graph coloring
15. Backtracking is less efficient than dynamic programming in cases CO1
where the solution requires overlapping subproblems, because it does
not store intermediate results, unlike __________.
Answer: memoization
16. The class of problems that can be solved in polynomial time by a non- CO1
deterministic machine is called the __________ class.
Answer: NP
17. A __________ problem can be solved by a deterministic machine in CO1
polynomial time.
Answer: P
18. A computational problem that can be solved efficiently in both time and CO1
space is said to be __________.
Answer: tractable
19. The __________ problem is an example of a problem that is NP- CO1
complete, meaning it is as hard as the hardest problems in NP.
Answer: traveling salesman
20. A problem that is solvable by a Turing machine in a finite amount of CO1
time is called a __________ problem.
Answer: decidable
21. In best-case analysis, the time complexity of an algorithm is determined CO1
by the most __________ possible input scenario.
Answer: favorable
22. The time complexity of bubble sort in the worst case, when the array is CO1
sorted in reverse order, is O(__________).
Answer: n²
23. Average-case analysis takes into account the probability distribution of CO1
all possible inputs and calculates the expected __________ of an
algorithm.
Answer: time complexity
24. In QuickSort, the worst-case time complexity occurs when the pivot CO1
divides the array into unbalanced partitions, resulting in a time
complexity of O(__________).
Answer: n²
25. The time complexity of a sorting algorithm is often compared in terms CO1
of its best-case, worst-case, and __________ case performance.
Answer: average
26. A recursive function that calls itself without a proper base case can lead CO1
to a __________ error, resulting in infinite recursion.
Answer: stack overflow
27. The complexity of recursive algorithms is often determined by solving CO1
the __________ relation associated with the recursion.
Answer: recurrence
28. The non-recursive version of a problem generally uses __________ to CO1
solve subproblems, rather than recursion.
Answer: iteration
29. A recurrence relation like T(n) = 2T(n/2) + O(n) can be solved using the CO1
__________ theorem to determine its time complexity.
Answer: master
Department of CSE
Course Code / Course Name :23CS1402/COMPUTATIONAL THINKING
30. A non-recursive version of the Fibonacci sequence algorithm has a time CO1
complexity of O(n) because it only requires __________ steps to
compute the nth Fibonacci number.
Answer: linear
Department of CSE
Course Code / Course Name :23CS1402/COMPUTATIONAL THINKING
UNIT I – T or F / MATCH – SET A
Year/Semester :II/IV Max Time : 30 Mins
Regulation :2023 Max Marks : 30
1. T or F Question 1 CO1
2. T or F Question 2 CO1
3. T or F Question 3 CO1
4. T or F Question 4 CO1
5. . CO1
6. . CO1
7. . CO1
8. . CO1
9. . CO1
10. . CO1
11. . CO1
12. . CO1
13. . CO1
14. . CO1
15. . CO1
16. . CO1
17. . CO1
18. . CO1
19. . CO1
20. T or F Question 20 CO1
Match the following CO1
21. Match Question 1 Options CO1
22. Match Question 2 Options CO1
23. . . CO1
24. . . CO1
25. . . CO1
26. . . CO1
27. . . CO1
28. . . CO1
29. . . CO1
30. Match Question 10 Options CO1
Department of CSE
Course Code / Course Name :23CS1402/COMPUTATIONAL THINKING
UNIT I – T or F / MATCH – SET B
Year/Semester :II/IV Max Time : 30 Mins
Regulation :2023 Max Marks : 30
1. T or F Question 1 CO1
2. T or F Question 2 CO1
3. T or F Question 3 CO1
4. T or F Question 4 CO1
5. . CO1
6. . CO1
7. . CO1
8. . CO1
9. . CO1
10. . CO1
11. . CO1
12. . CO1
13. . CO1
14. . CO1
15. . CO1
16. . CO1
17. . CO1
18. . CO1
19. . CO1
20. T or F Question 20 CO1
Match the following
21. Match Question 1 Options CO1
22. Match Question 2 Options CO1
23. . . CO1
24. . . CO1
25. . . CO1
26. . . CO1
27. . . CO1
28. . . CO1
29. . . CO1
30. Match Question 10 Options CO1
Department of CSE
Course Code / Course Name :23CS1402/COMPUTATIONAL THINKING
UNIT I – T or F / MATCH – SET C
Year/Semester :II/IV Max Time : 30 Mins
Regulation :2023 Max Marks : 30
1. T or F Question 1 CO1
2. T or F Question 2 CO1
3. T or F Question 3 CO1
4. T or F Question 4 CO1
5. . CO1
6. . CO1
7. . CO1
8. . CO1
9. . CO1
10. . CO1
11. . CO1
12. . CO1
13. . CO1
14. . CO1
15. . CO1
16. . CO1
17. . CO1
18. . CO1
19. . CO1
20. T or F Question 20 CO1
Match the following
21. Match Question 1 Options CO1
22. Match Question 2 Options CO1
23. . . CO1
24. . . CO1
25. . . CO1
26. . . CO1
27. . . CO1
28. . . CO1
29. . . CO1
30. Match Question 10 Options CO1
Department of CSE
Course Code / Course Name :23CS1402/COMPUTATIONAL THINKING
UNIT I – T or F / MATCH – SET D
Year/Semester :II/IV Max Time : 30 Mins
Regulation :2023 Max Marks : 30
1. T or F Question 1 CO1
2. T or F Question 2 CO1
3. T or F Question 3 CO1
4. T or F Question 4 CO1
5. . CO1
6. . CO1
7. . CO1
8. . CO1
9. . CO1
10. . CO1
11. . CO1
12. . CO1
13. . CO1
14. . CO1
15. . CO1
16. . CO1
17. . CO1
18. . CO1
19. . CO1
20. T or F Question 20 CO1
Match the following
21. Match Question 1 Options CO1
22. Match Question 2 Options CO1
23. . . CO1
24. . . CO1
25. . . CO1
26. . . CO1
27. . . CO1
28. . . CO1
29. . . CO1
30. Match Question 10 Options CO1
Department of CSE
Course Code / Course Name :23CS1402/COMPUTATIONAL THINKING
UNIT I – T or F / MATCH – SET E
Year/Semester :II/IV Max Time : 30 Mins
Regulation :2023 Max Marks : 30
1. T or F Question 1 CO1
2. T or F Question 2 CO1
3. T or F Question 3 CO1
4. T or F Question 4 CO1
5. . CO1
6. . CO1
7. . CO1
8. . CO1
9. . CO1
10. . CO1
11. . CO1
12. . CO1
13. . CO1
14. . CO1
15. . CO1
16. . CO1
17. . CO1
18. . CO1
19. . CO1
20. T or F Question 20 CO1
Match the following
21. Match Question 1 Options CO1
22. Match Question 2 Options CO1
23. . . CO1
24. . . CO1
25. . . CO1
26. . . CO1
27. . . CO1
28. . . CO1
29. . . CO1
30. Match Question 10 Options CO1
Department of CSE
Course Code / Course Name :23CS1402/COMPUTATIONAL THINKING
UNIT I – SHORT QUESTIONS – SET A
Year/Semester :II/IV Max Time : 30 Mins
Regulation :2023 Max Marks : 30
1. Differentiate between computational thinking and logical thinking. CO1
Ans: Logical thinking is the process of evaluating a problem and
coming up with a logical solution.
Whereas computational thinking can be thought of as an extension of
logical thinking. The computers use logic in their computation but it
does not mean that they think logically.
2. Compare Time Efficiency and Space Efficiency? [APRIL/MAY CO1
2018 ]
Time Efficiency measured by counting the number of times the
algorithms basic operation is executed. Space Efficiency is measured by
counting the number of extra memory units consumed by the algorithm
3. Write four properties of computational thinking. CO1
Ans: Properties of Computational Thinking:
Decomposition
Abstraction
Pattern Recognition
Algorithm Design
4. Which computational thinking technique breaks down the problem CO1
into smaller parts?
Ans: Decomposition is the technique that breaks down a complex
problem or system into smaller parts that are more manageable and
easier to understand. The smaller parts can then be examined and
solved, or designed individually, as they are simpler to work with.
5. Why do we need to think computationally? CO1
To help us to program
To help us solve complex problems more easily
To help us to think like a computer
6. Which of the following is NOT a computational thinking CO1
technique?
Decomposition
Pattern recognition
Coding
7. What is the purpose of using asymptotic notation in algorithms? CO1
Answer: Asymptotic notation is used to describe the efficiency or time
complexity of an algorithm.
8. Show the Euclid Algorithm MAY/JUNE 2016,APR/MAY 2018 CO1
Department of CSE
Course Code / Course Name :23CS1402/COMPUTATIONAL THINKING
UNIT I – SHORT QUESTIONS – SET A
Algorithm Euclid(m,n)
Step 1: While n not equal do
Step 2: r = m mod r
Step 3: m=n
Step 4: n=r
Step 5: return n
9. What does Big Theta notation represent? CO1
Answer: Big Theta notation provides both upper and lower bounds for
the time complexity of an algorithm.
10. To create a successful computer program, how many CO1
computational thinking techniques are usually required?
You said: Four
Correct: All four techniques are usually required to make sure that a
complex problem is solved.
11. What is Big ‘Oh’ Notation? [MAY/JUNE 2013, MAY/JUNE 2012] CO1
The Big ‘Oh’ notation provides an upper bound for the function t.A
function t(n) is said to be in O(g(n)), if there exist some positive
constant C and some non negative number No, such that , t(n)<=Cg(n),
for all n>=no
12. How does a recursive algorithm work? CO1
Answer: A recursive algorithm solves a problem by calling itself with a
smaller problem until it reaches the base case.
13. What is the purpose of the base case in recursion? CO1
Answer: The base case prevents infinite recursion by defining a
stopping condition.
14. What is the average-case time complexity used for? CO1
Answer: It is used to determine the expected time an algorithm takes
for typical inputs.
15. The telephone numbers usually have 9 digits. Out of these 9, the CO1
first two digits represent the area code and are it remained constant
within a given area. The last 7 digits represent the number and it
cannot begin with 0. How many different telephone numbers are
possible with a given area code?
Ans: The telephone numbers in a certain country have 9 digits. The first
2 digits are the area code (03) and are the same within a given area.
Department of CSE
Course Code / Course Name :23CS1402/COMPUTATIONAL THINKING
UNIT I – SHORT QUESTIONS – SET A
Since, there is no restriction of repetition of the numbers, the remaining
7 digits of the local number can be filled up using 10 different digits 0,
1, 2, ... , 9. Therefore, the total number of arrangements = 107 .
But, the local number cannot begin with 0.
16. From city A to city B, there are 4 different roads and from city B to CO1
city C there are 2 different roads. Draw a map of given situation
and identify how many possible routes are there that someone can
follow to reach from city A to city C by passing by city B?
Ans: City A to City B (4 Roads); City B to City C( 2 Roads)
So, Number of possible routes from City A--- >City B--- > City C are
4X2=8
17. What is the difference between Big O and Big Omega notations? CO1
Answer: Big O represents the upper bound (worst-case), while Big
Omega represents the lower bound (best-case) of an algorithm’s time
complexity.
18. Why is it important to analyze the time complexity of an CO1
algorithm?
Answer: Time complexity analysis helps to understand how the
algorithm performs as the input size increases, allowing for
optimization and efficiency improvements.
19. How is a recursive algorithm different from a non-recursive CO1
algorithm?
Answer: A recursive algorithm calls itself, whereas a non-recursive
algorithm does not involve self-calls.
20. Which of the following does NOT contain a pattern? CO1
You said: My dog likes swimming
Correct: 'My dog likes swimming' does not contain a pattern.
21. How can an algorithm be represented? CO1
As a flowchart
As pseudocode
As a flowchart or pseudocode
22. What is the correct symbol for a process instruction in a flowchart? CO1
You said: A rectangle
Correct: A rectangle is how a process is represented in a flowchart.
Department of CSE
Course Code / Course Name :23CS1402/COMPUTATIONAL THINKING
UNIT I – SHORT QUESTIONS – SET A
23. What is the advantage of using a divide-and-conquer approach in CO1
algorithms?
Answer: It allows a complex problem to be broken down into smaller,
more manageable sub problems, making the solution more efficient.
24. What is the purpose of the base case in recursion? CO1
Answer: The base case stops the recursion from continuing indefinitely
by providing a condition to terminate the recursive calls.
25. What is the difference between Big O and Big Theta notations? CO1
Answer: Big O provides an upper bound on the time complexity, while
Big Theta provides both an upper and lower bound, describing the exact
growth rate of the algorithm.
26. How do you measure the efficiency of an algorithm? CO1
The efficiency of an algorithm is typically measured by analyzing its
time complexity and space complexity.
27. Euclid’s Algorithm for Computing gcd(m, n) CO1
Euclid’s algorithm is a classical method for finding the greatest
common divisor (gcd) of two integers mmm and nnn. The algorithm
works based on the following recursive relation:
1. If n=0n = 0n=0, then the gcd is mmm.
2. Otherwise, compute gcd(n,mmod n)gcd(n, m \mod
n)gcd(n,mmodn), where \mod is the modulo operation (the
remainder when mmm is divided by nnn).
28. Define Recursion. CO1
Recursion is a process in which a function calls itself directly or
indirectly to solve a smaller instance of the problem.
29. What do you mean by worst-case efficiency of an algorithm? CO1
The worst-case efficiency of an algorithm refers to the maximum
amount of time or space the algorithm will require, given the worst
possible input of a specific size. It is usually measured using Big-O
notation and represents the highest time or space complexity for any
possible input.
30. List out the desirable properties of an algorithm. CO1
Department of CSE
Course Code / Course Name :23CS1402/COMPUTATIONAL THINKING
UNIT I – SHORT QUESTIONS – SET A
1. Correctness: The algorithm must correctly solve the problem it
is intended to solve.
2. Efficiency: The algorithm should have a reasonable time and
space complexity, especially for large inputs.
3. Finiteness: The algorithm must terminate after a finite number
of steps.
Department of CSE
Course Code / Course Name :23CS1402/COMPUTATIONAL THINKING
UNIT I – SHORT QUESTIONS – SET B
Year/Semester :II/IV Max Time : 30 Mins
Regulation :2023 Max Marks : 30
1. What is a computational problem? CO1
Answer: A computational problem is a task that can be solved using an
algorithm or a sequence of steps involving data manipulation.
2. What is an algorithm? CO1
Answer: An algorithm is a step-by-step procedure to solve a problem
or perform a task.
3. What is the difference between "if-else" and "switch-case"? CO1
A: "If-else" handles conditions sequentially, while "switch-case" is
more efficient for multiple discrete values.
4. How do break and continue statements affect control flow? CO1
A: Break exits a loop or switch, while continue skips the current
iteration and proceeds to the next.
5. Why is function decomposition important? CO1
A: It breaks a problem into smaller, manageable parts, making
algorithms easier to develop and debug.
6. What is the difference between "if-else" and "switch-case"? CO1
A: "If-else" handles conditions sequentially, while "switch-case" is
more efficient for multiple discrete values.
7. How do break and continue statements affect control flow? CO1
A: Break exits a loop or switch, while continue skips the current
iteration and proceeds to the next.
8. What are the main types of control flow? CO1
Answer: The main types of control flow are sequential, conditional (if-
else), and iterative (loops).
9. What is Big-O notation? CO1
Answer: Big-O notation describes the upper bound of an algorithm's
time or space complexity, indicating the worst-case scenario.
10. What is the best case complexity? CO1
Answer: Best case complexity refers to the minimum time or space
required by an algorithm under the best possible input conditions.
11. What is the worst-case time complexity? CO1
Answer: Worst-case time complexity is the maximum time an
algorithm takes to complete, given the largest possible input.
12. What is average-case complexity? CO1
Answer: Average-case complexity measures the expected performance
of an algorithm across all possible inputs.
13. How can pseudocode help in debugging? CO1
A: By allowing step-by-step verification of the algorithm's logic before
implementation.
14. What is the main disadvantage of pseudocode? CO1
A: It cannot be executed directly, requiring translation into a
programming language.
15. How does indentation in pseudocode improve readability? CO1
A: It visually separates blocks of code, making the structure clear.
Department of CSE
Course Code / Course Name :23CS1402/COMPUTATIONAL THINKING
16. What is the difference between a problem and an algorithm? CO1
Answer: A problem is a question or task to be solved, while an
algorithm is a defined method to solve that problem.
17. What are the two types of problems in computing? CO1
Answer: The two types are decision problems (yes/no answers) and
optimization problems (finding the best solution).
18. What is a statement in an algorithm? CO1
Answer: A statement is a single instruction or operation in an
algorithm.
19. What is meant by "state" in an algorithm? CO1
Answer: The state refers to the current condition or values of the
variables at any point during the execution of the algorithm.
20. What is control flow in an algorithm? CO1
Answer: Control flow determines the order in which the operations or
statements are executed in an algorithm.
21. Why should oral algorithms be specific? CO1
A: To ensure that the task is completed accurately without ambiguity.
22. How can oral algorithms be used in collaborative tasks? CO1
A: By assigning specific steps to team members for better coordination.
23. What is the difference between an oral and written algorithm? CO1
A: Oral algorithms are spoken and less formal, while written algorithms
are documented and precise.
24. How does memoization optimize recursive algorithms? CO1
A: By storing previously computed results to avoid redundant
calculations.
25. What is the iterative approach to calculate Fibonacci numbers? CO1
A: Use a loop to compute each number using the sum of the two
preceding numbers.
26. How can you transform a recursive algorithm into an iterative one? CO1
A: By replacing recursive calls with a stack or loop structure.
27. How is average-case complexity calculated? CO1
A: By averaging the time taken over all possible inputs.
28. Can the best-case complexity be misleading? CO1
A: Yes, as it represents an ideal scenario that may rarely occur.
29. Why is worst-case complexity emphasized in critical systems? CO1
A: To ensure reliable performance under the most demanding
conditions.
30. What is the relationship between Big O, Omega, and Theta? CO1
A: Big O represents the upper bound, Omega the lower bound, and Theta the
exact bound of complexity.
Department of CSE
Course Code / Course Name :23CS1402/COMPUTATIONAL THINKING
UNIT I – SHORT QUESTIONS – SET C
Year/Semester :II/IV Max Time : 30 Mins
Regulation :2023 Max Marks : 30
1. What is backtracking? CO1
A: Backtracking is a problem-solving technique that involves exploring
all possible solutions and abandoning paths that do not lead to a
solution.
2. What is the base condition in backtracking? CO1
A: The base condition determines when the algorithm should stop
exploring further paths, often when a valid solution is found or all
possibilities are exhausted.
3. Name one example problem where backtracking is used. CO1
A: Backtracking is commonly used in solving the N-Queens problem.
4. How does backtracking differ from brute force? CO1
A: Backtracking systematically eliminates paths that cannot lead to a
solution, reducing unnecessary computations compared to brute force.
5. What is the role of recursion in backtracking? CO1
A: Recursion helps backtracking by managing the exploration of paths
and automatically returning to previous states.
6. What is a computational problem? CO1
A: A computational problem is a task or question that can be solved
using computational methods and algorithms.
7. What are decision problems? CO1
A: Decision problems are computational problems with a yes or no
answer.
8. How are problems classified based on input and output? CO1
A: Problems are classified as decision problems, optimization
problems, and search problems.
9. Why is problem identification important in computing? CO1
A: Identifying the problem is essential to determine the appropriate
computational method and algorithm.
10. Give an example of a well-known computational problem. CO1
A: The Traveling Salesman Problem is a well-known computational
problem.
11. What are the basic building blocks of algorithms? CO1
A: Statements, state, control flow, and functions.
12. What is control flow in an algorithm? CO1
A: Control flow determines the order in which instructions are executed
in an algorithm.
13. What is a function in programming? CO1
A: A function is a block of code designed to perform a specific task.
14. What is the role of state in an algorithm? CO1
A: State represents the current values of variables during the execution
Department of CSE
Course Code / Course Name :23CS1402/COMPUTATIONAL THINKING
UNIT I – SHORT QUESTIONS – SET C
of an algorithm.
15. What is the difference between sequential and conditional statements? CO1
A: Sequential statements execute in order, while conditional statements
execute based on a condition.
16. What is pseudocode? CO1
A: Pseudocode is a high-level representation of an algorithm using
plain language and programming structures.
17. What is a flowchart? CO1
A: A flowchart is a diagram that represents the flow of steps in an
algorithm using symbols.
18. Why are programming languages used to write algorithms? CO1
A: Programming languages convert algorithms into executable code for
computers.
19. What is the advantage of pseudocode over a programming language? CO1
A: Pseudocode is easy to understand and can be used by non-
programmers.
20. Name a common flowchart symbol and its use. CO1
A: A diamond represents a decision point in a flowchart.
21. What is an oral algorithm? CO1
A: An oral algorithm is a verbal explanation of the steps needed to
complete a task.
22. Give an example of an oral algorithm for making tea. CO1
A: Boil water → Add tea leaves → Pour into a cup → Add milk/sugar
→ Serve.
23. How does sequencing affect oral algorithms? CO1
A: Proper sequencing ensures the task is completed correctly.
24. Why are oral algorithms helpful? CO1
A: They simplify problem-solving and task explanation for non-
technical users.
25. Can oral algorithms be converted into pseudocode? CO1
A: Yes, oral algorithms can be converted into pseudocode for better
clarity.
26. What is an oral algorithm? CO1
A: An oral algorithm is a verbal explanation of the steps needed to
complete a task.
27. Give an example of an oral algorithm for making tea. CO1
A: Boil water → Add tea leaves → Pour into a cup → Add milk/sugar
→ Serve.
28. How does sequencing affect oral algorithms? CO1
A: Proper sequencing ensures the task is completed correctly.
29. Why are oral algorithms helpful? CO1
Department of CSE
Course Code / Course Name :23CS1402/COMPUTATIONAL THINKING
UNIT I – SHORT QUESTIONS – SET C
A: They simplify problem-solving and task explanation for non-
technical users.
30. Can oral algorithms be converted into pseudocode? CO1
A: Yes, oral algorithms can be converted into pseudocode for better
clarity.
Department of CSE
Course Code / Course Name :23CS1402/COMPUTATIONAL THINKING
UNIT I – SHORT QUESTIONS – SET D
Year/Semester :II/IV Max Time : 30 Mins
Regulation :2023 Max Marks : 30
1. What is asymptotic notation? CO1
A: Asymptotic notation describes the growth rate of an algorithm's
complexity.
2. Name the three main types of asymptotic notations. CO1
A: Big O, Omega (Ω), and Theta (Θ).
3. What does Big O notation represent? CO1
A: Big O represents the worst-case time complexity of an algorithm.
4. What does Omega notation represent? CO1
A: Omega represents the best-case time complexity of an algorithm.
5. What is the significance of Theta notation? CO1
A: Theta gives the average-case time complexity when the upper and
lower bounds are the same.
6. What is best-case analysis? CO1
A: Best-case analysis evaluates the minimum time an algorithm takes to
complete.
7. What is worst-case analysis? CO1
A: Worst-case analysis evaluates the maximum time an algorithm takes
to complete.
8. What is average-case analysis? CO1
A: Average-case analysis evaluates the expected time for an algorithm
under typical input.
9. Why is worst-case analysis commonly used? CO1
A: It provides an upper limit on runtime, ensuring reliability.
10. Can best-case complexity ever equal worst-case complexity? CO1
A: Yes, for some algorithms like binary search under specific
conditions.
11. How is a recursive algorithm analyzed? CO1
A: By solving its recurrence relation.
12. What is a recurrence relation? CO1
A: A mathematical equation defining the time complexity of a recursive
algorithm.
13. How do non-recursive algorithms differ in analysis? CO1
A: Non-recursive algorithms are analyzed using direct computation or
iteration.
14. Give an example of a recurrence relation. CO1
A: T(n) = T(n/2) + O(1) for binary search.
15. Name a method used to solve recurrence relations. CO1
A: The Master Theorem is commonly used.
16. What is the significance of pruning in backtracking? CO1
Department of CSE
Course Code / Course Name :23CS1402/COMPUTATIONAL THINKING
UNIT I – SHORT QUESTIONS – SET D
A: Pruning reduces the number of paths explored by discarding paths
that cannot lead to a solution.
17. Name a constraint satisfaction problem that uses backtracking. CO1
A: Solving Sudoku puzzles.
18. What is the role of a stack in backtracking? CO1
A: A stack is used to manage recursive calls and return to previous
states.
19. Can backtracking solve optimization problems? CO1
A: Yes, backtracking can be adapted for optimization, though it may
not be the most efficient method.
20. How is backtracking related to Depth-First Search (DFS)? CO1
A: Backtracking uses a DFS-like approach to explore all possibilities
systematically.
21. What is a search problem in computing? CO1
A: A problem where the goal is to find a specific solution from a set of
possibilities.
22. How do computational problems differ from mathematical problems? CO1
A: Computational problems require algorithmic solutions, while
mathematical problems rely on logical derivations.
23. What is an optimization problem? CO1
A: A problem where the goal is to find the best solution from a set of
feasible solutions.
24. What is the significance of input size in computational problems? CO1
A: Input size determines the complexity and resource requirements for
solving a problem.
25. What is a real-world example of a computational problem? CO1
A: Finding the shortest route between two locations in a map.
26. What are the steps to develop an algorithm? CO1
A: Understand the problem → Design the algorithm → Analyze its
performance → Test the implementation.
27. What is a divide-and-conquer algorithm? CO1
A: An algorithm that divides a problem into smaller subproblems,
solves them, and combines the results.
28. Name an algorithm that uses the divide-and-conquer approach. CO1
A: Merge Sort.
29. What is a greedy algorithm? CO1
A: An algorithm that makes the locally optimal choice at each step to
find a global solution.
30. What is dynamic programming? CO1
A: A method for solving complex problems by breaking them down
into overlapping subproblems and solving them optimally.
Department of CSE
Course Code / Course Name :23CS1402/COMPUTATIONAL THINKING
UNIT I – SHORT QUESTIONS – SET E
Year/Semester :II/IV Max Time : 30 Mins
Regulation :2023 Max Marks : 30
1. What is a loop in control flow? CO1
A: A structure that repeats a block of code as long as a condition is met.
2. What are conditional statements in algorithms? CO1
A: Statements that execute different code blocks based on a condition.
3. What is the difference between a local and global variable in functions? CO1
A: Local variables are defined within a function, while global variables
are accessible throughout the program.
4. What is iteration in algorithms? CO1
A: Iteration is the repetition of a set of instructions until a condition is
met.
5. How do functions improve modularity in algorithms? CO1
A: Functions encapsulate specific tasks, making the algorithm easier to
understand and maintain.
6. What is the difference between pseudocode and flowchart? CO1
A: Pseudocode is textual, while a flowchart is visual.
7. How do you represent a loop in a flowchart? CO1
A: Using an arrow that creates a cycle, often involving a decision point.
8. Why is pseudocode language-independent? CO1
A: It uses plain language and does not depend on syntax rules of any
programming language.
9. What is a limitation of flowcharts? CO1
A: Flowcharts become complex and difficult to interpret for large
algorithms.
10. What is a decision table in algorithm design? CO1
A: A tabular method for representing and analyzing decision-making
conditions.
11. How can an oral algorithm be used in cooking? CO1
A: By listing the steps to prepare a dish sequentially.
12. Can oral algorithms be ambiguous? CO1
A: Yes, if steps are not clearly defined or if they rely on assumptions.
13. What is the first step in creating an oral algorithm? CO1
A: Understand the task and define the objective.
14. What makes an oral algorithm efficient? CO1
A: Clarity, conciseness, and logical sequencing.
15. How are oral algorithms communicated in a team? CO1
A: By using simple, understandable language and ensuring all members
Department of CSE
Course Code / Course Name :23CS1402/COMPUTATIONAL THINKING
UNIT I – SHORT QUESTIONS – SET E
follow the same steps.
16. What is the purpose of asymptotic analysis? CO1
A: To evaluate an algorithm’s efficiency relative to input size.
17. What does O(1) complexity mean? CO1
A: The algorithm runs in constant time regardless of input size.
18. What does O(n²) complexity indicate? CO1
A: The runtime grows quadratically with the input size.
19. How is asymptotic notation helpful in comparing algorithms? CO1
A: It provides a high-level view of performance, ignoring constants and
lower-order terms.
20. What is the property of transitivity in asymptotic notations? CO1
A: If f(n) = O(g(n)) and g(n) = O(h(n)), then f(n) = O(h(n)).
21. What affects the average-case complexity of an algorithm? CO1
A: The distribution of input data.
22. Give an example where best-case complexity is different from worst- CO1
case complexity.
A: In linear search, best-case complexity is O(1), and worst-case
complexity is O(n).
23. Why is average-case analysis more realistic than best-case analysis? CO1
A: It considers typical scenarios rather than extremes.
24. Can worst-case complexity be equal to average-case complexity? CO1
A: Yes, for some algorithms like bubble sort in specific situations.
25. How is best-case analysis useful? CO1
A: It helps determine the minimum resources required for an algorithm.
26. What is the iterative substitution method? CO1
A: A method to solve recurrence relations by repeatedly substituting
terms.
27. What is the significance of the base case in recursion? CO1
A: It stops the recursion and prevents infinite loops.
28. How is the time complexity of a non-recursive algorithm determined? CO1
A: By counting the number of basic operations in loops and
conditionals.
29. Give an example of a problem solved using recursion. CO1
A: Calculating the factorial of a number.
30. What is tail recursion? CO1
A: A type of recursion where the recursive call is the last operation in
the function.
Year/Semester :II/IV Max Time : 30 Mins
Regulation :2023 Max Marks : 30
Each question should have sub divisions.
1. A. Provide an example of a simple algorithm that involves statements, state, CO1
control flow, and functions. Break down the algorithm and explain how each
building block works.
Department of CSE
Course Code / Course Name :23CS1402/COMPUTATIONAL THINKING
UNIT I – SHORT QUESTIONS – SET E
B. Define best case, worst case, and average case analysis in the context of
algorithm performance. Why are these cases important for evaluating an
algorithm?
2. A. Describe the main differences between pseudo-code and programming CO1
languages. When would pseudo-code be more beneficial than writing code in a
programming language?
[Link] is the significance of creating oral algorithms for everyday tasks?
Provide an example of a common daily task and explain how you would create
an oral algorithm to describe it.
3. A. What are asymptotic notations? Discuss the importance of using Big- CO1
O, Big-Ω, and Big-Θ notations in analyzing the efficiency of algorithms.
B. Define Big-O notation. How is it used to describe the upper bound of
an algorithm’s time complexity?
4. A. Define best case, worst case, and average case analysis in the context CO1
of algorithm performance. Why are these cases important for evaluating
an algorithm?
B. Provide an example of an algorithm and explain how to analyze its
best case, worst case, and average case complexities.
5. A. Explain the difference between recursive and non-recursive CO1
algorithms. How does the recursive approach impact the space and time
complexity of an algorithm?
B. Provide an example of a recursive algorithm (e.g., Fibonacci
30.
sequence) and analyze its time complexity using recurrence relations.