Unit 1 MCQs Introduction
ECAP538 60 questions. Pick an option to check it.
0 of 60 answered 0 right 0 wrong , 60 left
Unit mastery 0% no weak questions yet
-
Question 1 of 60 Elementary data structures Easy
Which principle describes how elements are removed from a stack?
-
Question 2 of 60 Elementary data structures Easy
Which principle is normally followed by a queue?
-
Question 3 of 60 Elementary data structures Easy
Which data structure stores elements that are commonly accessed using an index?
-
Question 4 of 60 Basic computational models Easy
In the basic Random Access Machine model, how are simple operations usually treated?
-
Question 5 of 60 Basic computational models Easy
What is the main purpose of a computational model in algorithm analysis?
-
-
Question 6 of 60 Basic computational models Easy
What does commonly represent when analysing an algorithm?
-
Question 7 of 60 Analysis of algorithms: best-case, average-case, and worst-case behaviour Easy
What does the best-case running time describe?
-
Question 8 of 60 Analysis of algorithms: best-case, average-case, and worst-case behaviour Easy
What does the worst-case running time describe?
-
Question 9 of 60 Analysis of algorithms: best-case, average-case, and worst-case behaviour Easy
What does average-case analysis estimate?
-
Question 10 of 60 Analysis of algorithms: best-case, average-case, and worst-case behaviour Easy
What is the worst-case number of element comparisons in a linear search through elements?
-
Question 11 of 60 Asymptotic notations: big O notation Easy
What does big notation commonly express?
-
Question 12 of 60 Asymptotic notations: big O notation Easy
Which complexity represents linear growth?
-
Question 13 of 60 Asymptotic notations: big O notation Easy
Which notation represents constant-time complexity?
-
Question 14 of 60 Asymptotic notations: big O notation Easy
What is the big complexity of ?
-
Question 15 of 60 Recursion Easy
What is recursion?
-
Question 16 of 60 Recursion Easy
What is the purpose of a base case in recursion?
-
Question 17 of 60 Recursion Easy
Which formula correctly defines factorial recursively for ?
-
Question 18 of 60 Recurrence relations to analyse recursive algorithms Easy
What does a recurrence relation describe in recursive algorithm analysis?
-
Question 19 of 60 Recurrence relations to analyse recursive algorithms Easy
What is the asymptotic solution of with ?
-
Question 20 of 60 Recurrence relations to analyse recursive algorithms Easy
What is the asymptotic solution of with ?
-
Question 21 of 60 Elementary data structures Medium
A queue initially contains , with at the front. After performing
dequeue,enqueue(40), andenqueue(50), what is the queue from front to rear? -
Question 22 of 60 Elementary data structures Medium
Which data structure is most appropriate for processing nested function calls in the order required for returns?
-
Question 23 of 60 Elementary data structures Medium
A graph has vertices and edges, where is much smaller than . Which representation generally uses less space?
-
Question 24 of 60 Elementary data structures Medium
A binary search tree contains the keys inserted in that order. Which key is the left child of ?
-
Question 25 of 60 Basic computational models Medium
In the unit-cost RAM model, an algorithm executes primitive operations. What running time is assigned to it asymptotically?
-
Question 26 of 60 Basic computational models Medium
In the comparison model, a comparison-based sorting algorithm is represented by a binary decision tree. What does each leaf represent?
-
Question 27 of 60 Basic computational models Medium
Why can treating arithmetic on arbitrarily large integers as a constant-time operation produce a misleading analysis?
-
Question 28 of 60 Analysis of algorithms: best-case, average-case, and worst-case behaviour Medium
For linear search on an array of distinct elements, which situation gives the best-case running time?
-
Question 29 of 60 Analysis of algorithms: best-case, average-case, and worst-case behaviour Medium
Suppose a successful linear search is equally likely to target any of the array positions. What is the expected number of comparisons?
-
Question 30 of 60 Analysis of algorithms: best-case, average-case, and worst-case behaviour Medium
Quicksort always chooses the first element as its pivot. Which input is most likely to produce its worst-case behaviour?
-
Question 31 of 60 Analysis of algorithms: best-case, average-case, and worst-case behaviour Medium
An algorithm takes operations with probability and operations with probability . What is its expected operation count?
-
Question 32 of 60 Asymptotic notations: big O notation Medium
What is the tightest big O bound among the choices for ?
-
Question 33 of 60 Asymptotic notations: big O notation Medium
Consider a loop where starts at and is doubled after each iteration until . What is the loop's running time?
-
Question 34 of 60 Asymptotic notations: big O notation Medium
An outer loop runs times, while an inner loop runs from through the current outer-loop index . What is the total running time?
-
Question 35 of 60 Recursion Medium
What value is returned by the following function when called as ? and for .
-
Question 36 of 60 Recursion Medium
A recursive function reduces its argument from to and performs constant work per call. What is its maximum call-stack depth?
-
Question 37 of 60 Recursion Medium
Which change is necessary to prevent infinite recursion in a function that repeatedly calls itself with a smaller positive integer?
-
Question 38 of 60 Recurrence relations to analyse recursive algorithms Medium
What is the asymptotic solution of with ?
-
Question 39 of 60 Recurrence relations to analyse recursive algorithms Medium
What is the asymptotic solution of with ?
-
Question 40 of 60 Recurrence relations to analyse recursive algorithms Medium
What is the asymptotic solution of with ?
-
Question 41 of 60 Elementary data structures Hard
A dynamic array starts empty with capacity . Whenever an append finds the array full, its capacity is doubled and all existing elements are copied before the new element is inserted. If , how many existing-element copies occur during the first appends?
-
Question 42 of 60 Elementary data structures Hard
A queue is implemented using input and output stacks. Enqueue pushes onto the input stack; dequeue transfers every item to the output stack only when the output stack is empty. For any sequence of operations starting from empty, which bounds are tight?
-
Question 43 of 60 Elementary data structures Hard
A disjoint-set forest uses both union by rank and path compression. For operations, including Make-Set operations, which asymptotic bound applies to the total running time?
-
Question 44 of 60 Basic computational models Hard
Which capability is available in a word-RAM with -bit words but not generally in a pure pointer-machine model?
-
Question 45 of 60 Basic computational models Hard
An algorithm computes using multiplications. Why does the claim that its running time is fail in the bit-complexity model?
-
Question 46 of 60 Basic computational models Hard
In the deterministic comparison-tree model, an algorithm sorts distinct keys. What lower bound follows directly from the number of possible input orders?
-
Question 47 of 60 Analysis of algorithms: best-case, average-case, and worst-case behaviour Hard
A binary string of length is selected uniformly from all nonzero strings. An algorithm scans left to right and stops at the first . What is the exact expected number of inspected bits?
-
Question 48 of 60 Analysis of algorithms: best-case, average-case, and worst-case behaviour Hard
Randomized Quicksort chooses its pivot uniformly from the current subarray. For any fixed input containing distinct keys, which statement correctly distinguishes expected and worst-randomness behavior?
-
Question 49 of 60 Analysis of algorithms: best-case, average-case, and worst-case behaviour Hard
An algorithm has best-case running time and worst-case running time . Without specifying an input distribution, what can be concluded about its average-case time?
-
Question 50 of 60 Asymptotic notations: big O notation Hard
For integers , let . Which statement is true?
-
Question 51 of 60 Asymptotic notations: big O notation Hard
Let . Which asymptotic classification is correct for every fixed and ?
-
Question 52 of 60 Asymptotic notations: big O notation Hard
Define when is prime and otherwise. Which relation between and is correct?
-
Question 53 of 60 Recursion Hard
Quicksort is modified to recurse only on the smaller partition and to process the larger partition by iteration. What are the tight worst-case time and auxiliary-stack bounds?
-
Question 54 of 60 Recursion Hard
A top-down recursive Fibonacci algorithm evaluates and memoizes every computed value. Including the memo table and recursion stack, what are its tight time and space bounds?
-
Question 55 of 60 Recursion Hard
Consider a recursive procedure that makes two separate calls on and performs local work, without memoization. What is its total running time?
-
Question 56 of 60 Recurrence relations to analyse recursive algorithms Hard
For powers of two, solve with .
-
Question 57 of 60 Recurrence relations to analyse recursive algorithms Hard
Assume constant base-case cost. What is the solution of ?
-
Question 58 of 60 Recurrence relations to analyse recursive algorithms Hard
For powers of two and constant base-case cost, solve for .
-
Question 59 of 60 Recurrence relations to analyse recursive algorithms Hard
Given and , which bound is tight?
-
Question 60 of 60 Recurrence relations to analyse recursive algorithms Hard
For sufficiently large , let with a constant-size base case. What is the tight solution?
That's unit 1
Answer a few questions and your score shows up here.
Nearly through. Did unit 1 of ECAP538 save you a night before the exam?
LPU Notes is free. A student pays for the servers.
Did unit 1 of ECAP538 save you a night before the exam?
Then you can help keep it free for the next batch. Ads cover part of the server bill; the rest comes out of a student's own pocket: the domain, the storage, and keeping the site up through the weeks everyone needs it at once.
The payment button didn't load. An ad blocker or a filtered network is the usual reason. to try again.
Nothing here is ever locked, and nothing unlocks.