WorksheetsINTRO TO DSA
Total questions: 15
Worksheet time: 8mins
Computational problems deal with which two main aspects?
Syntax and semantics
Data and operations
Storage and retrieval
Algorithms and flowcharts
Which stage of an ADT concerns how the data is stored?
Specification
Representation
Implementation
Abstraction
Which stage of an ADT specifies what operations can be performed from the user’s point of view?
Representation
Implementation
Specification
Abstraction
Which of the following is an example of an ADT?
Integer
Array
Queue
Character
In recursion, what is the basis case?
The condition that stops recursion
The repeating part of recursion
The input that causes infinite recursion
The loop variable initialization
In recursion, the recursive step refers to:
The smallest possible solution
Rewriting the problem in terms of a smaller version of itself
Declaring variables inside the function
Converting recursion into iteration
Who is considered the origin of the word “Algorithm”?
Alan Turing
Charles Babbage
Abu Ja’far Muhammed Ibn Musa Al-Khwarizmi
John von Neumann
Which of the following is an example of a recursive definition?
x = y + z
Fib(n) = Fib(n-1) + Fib(n-2)
p = q × r
sum = A + B
Which notation describes the worst-case growth rate of an algorithm?
Which approach to problem solving breaks down the problem into halves (e.g., PowerR2, SumArrayR3)?
Divide and Conquer
Brute Force
Greedy Algorithm
Dynamic Programming
In the Tower of Hanoi problem, what is NOT allowed?
Moving one disk at a time
Moving disks between pegs
Placing a larger disk on a smaller disk
Using a temporary peg
Which of the following is a difference between iteration and recursion?
Iteration requires a loop; recursion requires a function call to itself
Iteration is always faster than recursion
Recursion cannot solve problems
Iteration cannot use conditions
Backtracking is mainly used in problems like:
Sorting numbers
Searching in arrays
Constraint satisfaction problems (e.g., N-Queens, Sudoku)
Arithmetic calculations
Which of the following best defines an algorithm?
A set of code written in Java
A flowchart representation of a program
A well-defined procedure that transforms input into output
A recursive function only
What does “Programs = Data Structures + Algorithms” imply?
Programs are only algorithms
Programs are only data
Programs combine both data representation and operations
Programs do not use algorithms
