Notice: Due to an ongoing migration of our storage and publishing system, material requested since last month will not be uploaded for the time being, and new requests are paused. All existing notes remain available.

Unit 1 MCQs Introduction

ECAP538 60 questions. Pick an option to check it.

Read the notes Subjective questions

0 of 60 answered 0 right 0 wrong , 60 left

  1. Question 1 of 60 Elementary data structures Easy

    Which principle describes how elements are removed from a stack?

  2. Question 2 of 60 Elementary data structures Easy

    Which principle is normally followed by a queue?

  3. Question 3 of 60 Elementary data structures Easy

    Which data structure stores elements that are commonly accessed using an index?

  4. Question 4 of 60 Basic computational models Easy

    In the basic Random Access Machine model, how are simple operations usually treated?

  5. Question 5 of 60 Basic computational models Easy

    What is the main purpose of a computational model in algorithm analysis?

  6. Question 6 of 60 Basic computational models Easy

    What does commonly represent when analysing an algorithm?

  7. Question 7 of 60 Analysis of algorithms: best-case, average-case, and worst-case behaviour Easy

    What does the best-case running time describe?

  8. Question 8 of 60 Analysis of algorithms: best-case, average-case, and worst-case behaviour Easy

    What does the worst-case running time describe?

  9. Question 9 of 60 Analysis of algorithms: best-case, average-case, and worst-case behaviour Easy

    What does average-case analysis estimate?

  10. 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?

  11. Question 11 of 60 Asymptotic notations: big O notation Easy

    What does big notation commonly express?

  12. Question 12 of 60 Asymptotic notations: big O notation Easy

    Which complexity represents linear growth?

  13. Question 13 of 60 Asymptotic notations: big O notation Easy

    Which notation represents constant-time complexity?

  14. Question 14 of 60 Asymptotic notations: big O notation Easy

    What is the big complexity of ?

  15. Question 15 of 60 Recursion Easy

    What is recursion?

  16. Question 16 of 60 Recursion Easy

    What is the purpose of a base case in recursion?

  17. Question 17 of 60 Recursion Easy

    Which formula correctly defines factorial recursively for ?

  18. Question 18 of 60 Recurrence relations to analyse recursive algorithms Easy

    What does a recurrence relation describe in recursive algorithm analysis?

  19. Question 19 of 60 Recurrence relations to analyse recursive algorithms Easy

    What is the asymptotic solution of with ?

  20. Question 20 of 60 Recurrence relations to analyse recursive algorithms Easy

    What is the asymptotic solution of with ?

  21. Question 21 of 60 Elementary data structures Medium

    A queue initially contains , with at the front. After performing dequeue, enqueue(40), and enqueue(50), what is the queue from front to rear?

  22. 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?

  23. 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?

  24. 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 ?

  25. 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?

  26. 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?

  27. 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?

  28. 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?

  29. 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?

  30. 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?

  31. 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?

  32. Question 32 of 60 Asymptotic notations: big O notation Medium

    What is the tightest big O bound among the choices for ?

  33. 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?

  34. 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?

  35. Question 35 of 60 Recursion Medium

    What value is returned by the following function when called as ? and for .

  36. 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?

  37. 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?

  38. Question 38 of 60 Recurrence relations to analyse recursive algorithms Medium

    What is the asymptotic solution of with ?

  39. Question 39 of 60 Recurrence relations to analyse recursive algorithms Medium

    What is the asymptotic solution of with ?

  40. Question 40 of 60 Recurrence relations to analyse recursive algorithms Medium

    What is the asymptotic solution of with ?

  41. 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?

  42. 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?

  43. 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?

  44. 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?

  45. 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?

  46. 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?

  47. 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?

  48. 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?

  49. 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?

  50. Question 50 of 60 Asymptotic notations: big O notation Hard

    For integers , let . Which statement is true?

  51. Question 51 of 60 Asymptotic notations: big O notation Hard

    Let . Which asymptotic classification is correct for every fixed and ?

  52. Question 52 of 60 Asymptotic notations: big O notation Hard

    Define when is prime and otherwise. Which relation between and is correct?

  53. 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?

  54. 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?

  55. 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?

  56. Question 56 of 60 Recurrence relations to analyse recursive algorithms Hard

    For powers of two, solve with .

  57. Question 57 of 60 Recurrence relations to analyse recursive algorithms Hard

    Assume constant base-case cost. What is the solution of ?

  58. Question 58 of 60 Recurrence relations to analyse recursive algorithms Hard

    For powers of two and constant base-case cost, solve for .

  59. Question 59 of 60 Recurrence relations to analyse recursive algorithms Hard

    Given and , which bound is tight?

  60. 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.