Unit 1 - Practice Quiz

CSE408 60 Questions
0 Correct 0 Wrong 60 Left
0/60

1 What is an algorithm?

Algorithms Easy
A. A type of data structure
B. A hardware component of a computer
C. A programming language
D. A sequence of unambiguous instructions for solving a problem

2 Which of the following is typically the first step in algorithmic problem solving?

Fundamentals of Algorithmic Problem Solving: Easy
A. Proving the algorithm's correctness
B. Understanding the problem
C. Designing the algorithm
D. Analyzing the algorithm

3 What are the two primary metrics used to analyze an algorithm's efficiency?

Analyzing Algorithm Easy
A. Speed and Cost
B. Memory and Bandwidth
C. Lines of code and Variables
D. Time and Space

4 Which of the following is an example of a linear data structure?

Linear Data Structure Easy
A. Tree
B. Graph
C. Heap
D. Array

5 A tree data structure is fundamentally a type of:

Graphs and Trees Easy
A. Stack
B. Linear data structure
C. Cyclic graph
D. Acyclic connected graph

6 How is the input size typically measured for an algorithm operating on an array?

Measuring of Input Size Easy
A. By the time it takes to compile
B. By the number of lines of code
C. By the physical size of the computer
D. By the number of elements in the array

7 Instead of measuring exact physical time (e.g., seconds), algorithm efficiency is typically measured by counting:

Units for Measuring Running Time Easy
A. The hardware clock cycles
B. The total bytes of memory
C. The basic operations
D. The number of loops

8 Which case analysis provides an upper bound on the running time of an algorithm?

Worst-Case, Best-Case, and Average-Case Efficiencies Easy
A. Worst-case
B. Average-case
C. Best-case
D. Null-case

9 Which case analysis determines the minimum time required to execute the algorithm?

Worst-Case, Best-Case, and Average-Case Efficiencies Easy
A. Worst-case
B. Best-case
C. Average-case
D. Amortized-case

10 Which of the following functions grows the fastest as increases?

Asymptotic Notations and Basic Efficiency Classes: Easy
A.
B.
C.
D.

11 What does Big- notation describe?

O(Big-oh)-notation Easy
A. An asymptotic lower bound
B. An asymptotic tight bound
C. An exact bound
D. An asymptotic upper bound

12 What does Big-Omega () notation describe?

Big-omega notation Easy
A. An asymptotic lower bound
B. An asymptotic tight bound
C. The exact running time in seconds
D. An asymptotic upper bound

13 What does Big-Theta () notation represent?

Big-theta notation Easy
A. Both upper and lower asymptotic bounds (tight bound)
B. Only the upper bound
C. Only the lower bound
D. The worst-case only

14 If and , then is bounded by:

Useful Property Involving the Asymptotic Notations Easy
A.
B.
C.
D.

15 When comparing two functions and , if , what does this imply?

Using Limits for Comparing Orders of Growth Easy
A. No conclusion can be drawn
B. and have the same order of growth
C. has a smaller order of growth than
D. has a larger order of growth than

16 An algorithm whose running time is independent of the input size has an order of growth denoted by:

Order of Growth Easy
A.
B.
C.
D.

17 Which data structure follows the Last-In-First-Out (LIFO) principle?

Linear Data Structure Easy
A. Queue
B. Linked List
C. Stack
D. Array

18 Which data structure follows the First-In-First-Out (FIFO) principle?

Linear Data Structure Easy
A. Tree
B. Queue
C. Stack
D. Graph

19 In a graph, the entities that are connected to each other are called:

Graphs and Trees Easy
A. Edges
B. Roots
C. Vertices (or Nodes)
D. Leaves

20 Which algorithm design technique solves a problem by breaking it down into smaller, overlapping subproblems and storing the results?

Basic Algorithm Design Techniques Easy
A. Greedy Approach
B. Dynamic Programming
C. Divide and Conquer
D. Brute Force

21 Which of the following best describes the characteristics of an algorithm?

Algorithms Medium
A. Infiniteness, definiteness, input, output, efficiency
B. Infiniteness, precision, input, output, effectiveness
C. Finiteness, definiteness, input, output, effectiveness
D. Finiteness, ambiguity, input, effectiveness

22 When designing an algorithm, what is typically the primary concern immediately after understanding the problem?

Fundamentals of Algorithmic Problem Solving: Medium
A. Ascertaining the capabilities of the computational device
B. Deciding on appropriate data structures
C. Choosing between exact and approximate problem solving
D. Proving the algorithm's correctness

23 Which design technique is characterized by dividing a problem into smaller instances of the same problem, solving them recursively, and then combining their solutions?

Basic Algorithm Design Techniques Medium
A. Dynamic Programming
B. Backtracking
C. Greedy Approach
D. Divide and Conquer

24 Which of the following is NOT typically considered when analyzing an algorithm's efficiency?

Analyzing Algorithm Medium
A. Simplicity of the code syntax
B. Space efficiency
C. Optimality
D. Time efficiency

25 Which linear data structure is most appropriate for evaluating postfix mathematical expressions?

Linear Data Structure Medium
A. Queue
B. Linked List
C. Stack
D. Hash Table

26 In a simple undirected graph with vertices, what is the maximum number of edges?

Graphs and Trees Medium
A.
B.
C.
D.

27 For a matrix multiplication algorithm involving two matrices, what is the most appropriate measure of input size?

Measuring of Input Size Medium
A. The total sum of all elements
B. The value of the largest element in the matrices
C. The dimension of the matrices
D. The number of rows in the first matrix only

28 Why is counting the number of basic operations preferred over measuring actual execution time in seconds?

Units for Measuring Running Time Medium
A. It depends on the compiler used
B. It depends on the hardware speed
C. It is independent of hardware and software environments
D. It is easier to program

29 Which of the following functions has the highest order of growth?

Order of Growth Medium
A.
B.
C.
D.

30 In Sequential Search on an array of size , what is the average-case number of key comparisons for a successful search (assuming all positions are equally likely)?

Worst-Case, Best-Case, and Average-Case Efficiencies Medium
A.
B.
C.
D.

31 If , which of the following is true regarding its Big-O notation?

O(Big-oh)-notation Medium
A.
B.
C.
D.

32 What does formally imply?

Big-omega notation Medium
A. There exist positive constants and such that for all .
B.
C. There exist positive constants and such that for all .
D. grows strictly slower than .

33 Which of the following statements is equivalent to ?

Big-theta notation Medium
A. Neither nor applies to
B. but
C. and
D. but

34 If and , what is the tightest bound for ?

Useful Property Involving the Asymptotic Notations Medium
A.
B.
C.
D.

35 If , where is a constant, what can be concluded?

Using Limits for Comparing Orders of Growth Medium
A. has a smaller order of growth than
B. has a larger order of growth than
C. No conclusion can be drawn
D. and have the same order of growth

36 Which of the following sorting algorithms exhibits a worst-case time complexity of but an average-case of ?

Worst-Case, Best-Case, and Average-Case Efficiencies Medium
A. Merge Sort
B. Quick Sort
C. Bubble Sort
D. Heap Sort

37 What is the primary advantage of a Doubly Linked List over a Singly Linked List?

Fundamental Data Structure: Medium
A. It provides access time to the -th element
B. It requires less memory per node
C. It allows traversal in both forward and backward directions
D. It inherently prevents cycle formation

38 In a binary search tree (BST), an inorder traversal yields the elements in which order?

Graphs and Trees Medium
A. Ascending order
B. Descending order
C. Random order
D. Level-by-level order

39 Evaluate the limit to determine the relative order of growth.

Using Limits for Comparing Orders of Growth Medium
A. , meaning grows faster than
B. $0$, meaning grows faster than
C. $0$, meaning grows faster than
D. $1$, meaning they have the same order of growth

40 What defines the 'basic operation' of an algorithm?

Fundamentals of the Analysis of Algorithm Efficiency: Medium
A. The first operation written in the pseudo-code
B. The operation that consumes the most time or is executed the most frequently
C. The return statement of the algorithm
D. The initialization of loop counters

41 Evaluate the limit where and . What does the result imply about their asymptotic relationship?

Using Limits for Comparing Orders of Growth Hard
A. The limit is a positive constant, implying
B. The limit is $0$, implying
C. The limit is undefined, so they are asymptotically incomparable
D. The limit is , implying

42 Which of the following statements about Big-O notation is FALSE for positive functions and ?

O(Big-oh)-notation Hard
A. If , then
B. If , then
C. If and , then
D. If , then

43 Consider an algorithm that searches a sorted array of distinct elements by probing the element at index , then performs a linear search. What is the average-case efficiency if the search key is known to be in the array and uniformly distributed?

Worst-Case, Best-Case, and Average-Case Efficiencies Hard
A.
B.
C.
D.

44 Let and . What is the relationship between and ?

Big-theta notation Hard
A.
B.
C.
D. They are not asymptotically comparable

45 Consider the recurrence relation . What is the asymptotic time complexity of ?

Analyzing Algorithm Hard
A.
B.
C.
D.

46 Rank the following functions by order of growth from slowest to fastest: , , , .

Order of Growth Hard
A.
B.
C.
D.

47 In a connected undirected graph with vertices and edges, a DFS tree is constructed. Which of the following edges CANNOT exist in relative to the DFS tree?

Graphs and Trees Hard
A. Back edges to an ancestor
B. Cross edges between different subtrees
C. Forward edges to a descendant
D. Tree edges

48 When analyzing the time complexity of an algorithm that tests whether an integer is prime by trial division up to , what is the appropriate measure of the input size and the resulting complexity?

Measuring of Input Size Hard
A. , Time
B. , Time
C. , Time
D. , Time

49 Which of the following limits proves that ?

Useful Property Involving the Asymptotic Notations Hard
A.
B.
C.
D.

50 Which design technique is MOST intrinsically linked to solving overlapping subproblems by storing their results?

Basic Algorithm Design Techniques Hard
A. Backtracking
B. Divide and Conquer
C. Greedy Method
D. Dynamic Programming

51 Let be a polynomial of degree with a positive leading coefficient, and be a polynomial of degree with a positive leading coefficient. Under what condition is ?

Big-omega notation Hard
A.
B.
C. only
D.

52 Why is counting the number of basic operations preferred over measuring the actual execution time in seconds when analyzing algorithmic efficiency?

Units for Measuring Running Time Hard
A. Execution time in seconds cannot be converted into asymptotic notation.
B. Actual time depends on specific hardware, compiler, and environmental factors, whereas operation count is machine-independent.
C. Basic operations always take exactly 1 nanosecond, making the calculation perfectly precise.
D. Basic operations naturally account for operating system context switches.

53 You are implementing a Queue using exactly two Stacks. What is the amortized time complexity of the enqueue and dequeue operations, respectively?

Linear Data Structure Hard
A. and
B. and
C. and
D. and

54 Which phase of algorithmic problem solving immediately follows the design of the algorithm and precedes coding?

Fundamentals of Algorithmic Problem Solving: Hard
A. Analyzing the algorithm's efficiency
B. Understanding the problem
C. Testing the algorithm
D. Proving the algorithm's correctness

55 Given the nested loops:

for i = 1 to n
for j = 1 to i^2
for k = 1 to n/2
count++

What is the exact asymptotic order of the count variable?

Analyzing Algorithm Hard
A.
B.
C.
D.

56 An algorithm requires operations. What class of problems typically exhibits this extremely slow-growing complexity?

Algorithms Hard
A. Interpolation search on uniformly distributed sorted data
B. Computing the Fibonacci sequence recursively
C. Binary search on an unbalanced tree
D. Finding the maximum in an unsorted array

57 For the QuickSelect algorithm used to find the -th smallest element in an unsorted array of size , what are the expected average-case and strict worst-case time complexities, respectively?

Worst-Case, Best-Case, and Average-Case Efficiencies Hard
A. and
B. and
C. and
D. and

58 A hash table uses open addressing with linear probing. The load factor is close to 1. What happens to the expected number of probes for an unsuccessful search?

Fundamental Data Structure: Hard
A. It approaches
B. It approaches
C. It approaches
D. It remains regardless of

59 If and , what can be definitively deduced about the relationship between and ?

Useful Property Involving the Asymptotic Notations Hard
A.
B.
C.
D. No definitive asymptotic relationship can be deduced

60 Let and . Evaluate the limit comparison between and .

Using Limits for Comparing Orders of Growth Hard
A. , so
B. The limit is a constant, so
C. The limit does not exist, and the functions are not asymptotically comparable using Big-O, Big-Omega, or Big-Theta
D. , so