← All B CompE Bachelor of Computer Engineering Flashcard Decks

Algorithm Design and Analysis Flashcards

6 cards from real B CompE Bachelor of Computer Engineering practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.

Read the first 6 Algorithm Design and Analysis flashcards as text
  1. What does O(n log n) time complexity indicate about an algorithm?

    Answer: The algorithm's runtime grows proportionally to n multiplied by the logarithm of n

    O(n log n) means the running time scales with n × log(n), typical of efficient sorting algorithms like merge sort and heap sort.

  2. Which sorting algorithm has the best worst-case time complexity?

    Answer: Merge Sort

    Merge Sort guarantees O(n log n) in the worst case by always dividing the array in half and merging sorted halves, unlike Quick Sort which degrades to O(n²).

  3. What data structure does Depth-First Search (DFS) use internally?

    Answer: Stack

    DFS uses a stack (either explicitly or via the call stack in recursion) to explore as deep as possible before backtracking.

  4. Which algorithmic paradigm does dynamic programming primarily rely on?

    Answer: Memoization or tabulation of overlapping subproblems

    Dynamic programming solves problems by breaking them into overlapping subproblems and storing results (memoization or tabulation) to avoid redundant computation.

  5. What is the time complexity of binary search on a sorted array of n elements?

    Answer: O(log n)

    Binary search halves the search space with each comparison, giving O(log n) time complexity on a sorted array.

  6. Which graph algorithm finds the shortest path from a single source to all other vertices in a weighted graph with non-negative edges?

    Answer: Dijkstra's Algorithm

    Dijkstra's algorithm uses a priority queue to greedily select the nearest unvisited vertex and compute shortest paths from a source to all other vertices, provided edge weights are non-negative.

How this page was made: written with AI tools and published by Nathan Beja, founder of Practice Test Geeks, who is responsible for its content. We have not yet matched this exam's facts to an official source, so confirm fees, dates and rules with the exam body. Not reviewed by a subject-matter expert. Editorial policy