ThatQuiz Test Library Take this test now
Algorithms - Quiz
Contributed by: Skelton
  • 1. Algorithms are step-by-step procedures or formulas for solving problems. They are a set of instructions that describe how to perform a task or solve a problem effectively. Algorithms are used in various fields such as computer science, mathematics, engineering, and more. They help in organizing data, making decisions, and automating processes. By designing efficient algorithms, we can optimize the use of resources, improve performance, and solve complex problems in a systematic way.

    Which sorting algorithm has a worst-case time complexity of O(n2)?
A) Merge Sort
B) Heap Sort
C) Quick Sort
D) Bubble Sort
  • 2. What data structure is typically used in a Depth-First Search (DFS) algorithm?
A) Array
B) Binary Tree
C) Queue
D) Stack
  • 3. Which algorithm is commonly used to find the shortest path in a graph with non-negative edge weights?
A) Dijkstra's algorithm
B) Prim's algorithm
C) A* search algorithm
D) Bellman-Ford algorithm
  • 4. What does the 'recursion' mean in the context of algorithms?
A) A function that calls itself in a problem-solving process.
B) A function that iterates over a collection of elements.
C) A function that has no return statement.
D) A function that generates random numbers.
  • 5. Which algorithm is used to find the transitive closure of a directed graph?
A) Warshall's algorithm
B) Kosaraju's algorithm
C) Floyd's algorithm
D) Tarjan's algorithm
  • 6. What is the term for the measure of how detailed the instructions are in an algorithm?
A) Granularity
B) Scalability
C) Efficiency
D) Complexity
  • 7. Which of the following is a divide and conquer algorithm?
A) Merge Sort
B) Bubble Sort
C) Selection Sort
D) Insertion Sort
  • 8. What is the process of making a repetitive sequence shorter by using previous occurrences called?
A) Run-Length Encoding
B) Differential Encoding
C) Huffman Coding
D) Burrows-Wheeler Transform
  • 9. What data structure is typically used in a Breadth-First Search algorithm?
A) Stack
B) Linked List
C) Queue
D) Heap
  • 10. Which algorithm can be used to find the maximum flow in a flow network?
A) Binary Search algorithm
B) Ford-Fulkerson algorithm
C) Depth-First Search
D) Bubble Sort
  • 11. What is the worst-case time complexity of the Quick Sort algorithm?
A) O(n)
B) O(n2)
C) O(log n)
D) O(n log n)
  • 12. What is the main advantage of the breadth-first search (BFS) algorithm over depth-first search (DFS)?
A) DFS uses less memory space.
B) BFS guarantees the shortest path to the goal.
C) BFS is easier to implement.
D) DFS finds the path more quickly.
  • 13. What is the primary goal of the Floyd-Warshall algorithm?
A) To find the shortest paths between all pairs of vertices in a weighted graph.
B) To calculate the maximum flow in a flow network.
C) To determine the largest connected component in an undirected graph.
D) To sort elements in ascending order.
  • 14. Which algorithm is used to find the longest common subsequence between two sequences?
A) Radix Sort
B) Heap Sort
C) Selection Sort
D) Longest Common Subsequence algorithm
  • 15. Who was the Persian scientist and polymath who wrote about algorithms in 825 AD?
A) John of Seville
B) Adelard of Bath
C) Geoffrey Chaucer
D) Muḥammad ibn Mūsā al-Khwārizmī
  • 16. What is the Latinized form of Al-Khwarizmi's name used in early translations?
A) algoritmi
B) arithmos
C) augrym
D) Algorism
  • 17. Which text by al-Khwārizmī is known as 'Book of Indian computation'?
A) The Canterbury Tales
B) Liber Algoritmi de numero Indorum
C) kitāb al-ḥisāb al-hindī
D) Liber Alghoarismi de practica arismetrice
  • 18. In what context are social media recommender systems often mistakenly called 'algorithms'?
A) They rely on heuristics, not true algorithms.
B) They provide well-defined correct results for all users.
C) They are based on finite sequences of instructions.
D) They use deterministic processes to generate recommendations.
  • 19. What is the role of conditionals in advanced algorithms?
A) They eliminate randomness from the algorithm.
B) They ensure that the algorithm always terminates.
C) They divert code execution through various routes.
D) They prevent automated reasoning.
  • 20. What does 'automated reasoning' refer to in the context of algorithms?
A) Using heuristics to solve problems.
B) Following a fixed sequence of operations.
C) Deducing valid inferences through code execution.
D) Generating random outputs without input.
  • 21. What is the significance of 'augrym stones' mentioned by Geoffrey Chaucer?
A) They were early computers.
B) They represented heuristic methods.
C) They were a form of algorithmic programming.
D) They were used for place-value calculation.
  • 22. In which ancient civilization were the earliest division algorithms recorded?
A) Chinese mathematics
B) Babylonian mathematics
C) Greek mathematics
D) Egyptian mathematics
  • 23. Which dynasty is associated with Babylonian clay tablets describing algorithms for computing formulas?
A) Akkadian dynasty
B) Assyrian dynasty
C) Hammurabi dynasty
D) Neo-Babylonian dynasty
  • 24. The Rhind Mathematical Papyrus is associated with which ancient civilization?
A) Greek mathematics
B) Indian mathematics
C) Egyptian mathematics
D) Babylonian mathematics
  • 25. Who developed the first cryptographic algorithm for deciphering encrypted code?
A) Muḥammad ibn Mūsā al-Khwārizmī
B) Al-Kindi
C) Nicomachus
D) Euclid
  • 26. Which algorithm design pattern involves defining a skeleton of an algorithm in a method?
A) Template method pattern
B) Decorator pattern
C) Dynamic programming
D) Divide-and-conquer
  • 27. Which invention was used worldwide by the mid-19th century?
A) Telephone
B) Radio
C) Television
D) Telegraph
  • 28. The Euclidean algorithm was first described in which ancient text?
A) Algebra by Al-Khwarizmi
B) Sulba Sutras
C) Euclid's Elements
D) Introduction to Arithmetic by Nicomachus
  • 29. Which invention led to the development of punch cards?
A) Jacquard loom
B) Telephone-switching network
C) Telegraph
D) Analytical engine
  • 30. What mechanism was key to the invention of weight-driven clocks in the Middle Ages?
A) Balance wheel mechanism
B) Quartz oscillator
C) Verge escapement mechanism
D) Pendulum mechanism
  • 31. Which problem-solving technique involves invoking itself repeatedly?
A) Parallel processing
B) Iteration
C) Recursion
D) Serial execution
  • 32. Which type of programming involves finding optimal solutions to a linear function with constraints?
A) Linear programming
B) Heuristic method
C) Dynamic programming
D) Greedy method
  • 33. Which approach involves building multiple solutions incrementally and abandoning them if they cannot lead to a valid full solution?
A) Brute-force or exhaustive search
B) Reduction of complexity
C) Divide and conquer
D) Backtracking
  • 34. Who invented the digital adding device in 1937?
A) George Stibitz
B) Alan Turing
C) Konrad Zuse
D) John von Neumann
  • 35. What is a common application of greedy algorithms in graph theory?
A) Simulating annealing processes.
B) Finding minimal spanning trees.
C) Optimizing linear functions with constraints.
D) Solving integer programming problems.
  • 36. Who began attempts to solve David Hilbert's Entscheidungsproblem in 1928?
A) Emil Post
B) David Hilbert
C) Alonzo Church
D) Alan Turing
  • 37. Which of the following is not a structured expression of algorithms that avoids common ambiguities of natural language?
A) Drakon-charts
B) Natural languages
C) Flowcharts
D) Pseudocode
  • 38. Who is credited with designing the first algorithm intended for a computer?
A) George Stibitz
B) Ada Lovelace
C) Herman Hollerith
D) Charles Babbage
  • 39. What is the subclass of Monte Carlo algorithms that runs in polynomial time?
A) RP
B) P
C) NP
D) ZPP
  • 40. What primary symbol in a flowchart represents decisions?
A) Arrows
B) Rectangles
C) Dots
D) Diamonds
  • 41. Which representation gives the exact state table and list of transitions for a Turing machine?
A) Control tables
B) Formal description
C) High-level description
D) Implementation description
  • 42. What method did Al-Kindi describe for cryptanalysis?
A) Frequency analysis
B) Caesar cipher
C) Transposition cipher
D) Substitution cipher
  • 43. What did NIST update in 2024 related to quantum computing?
A) Turing machines
B) Lambda calculus
C) SAINT program
D) Post-quantum encryption standards
  • 44. Which of these is NOT a canonical structure augmented by Tausworthe?
A) WHILE-DO
B) RECURSION
C) SEQUENCE
D) IF-THEN-ELSE
  • 45. Which library integrated the small sorting algorithms discovered by AlphaDev?
A) Java Collections Framework
B) C# System.Linq
C) Python's built-in sort function
D) LLVM standard C++ sorting library
  • 46. What does AlphaEvolve use to propose code changes?
A) Automated evaluators
B) Reinforcement learning
C) Human coders
D) Language models
  • 47. In flowchart representation, what does an arrow symbolize?
A) Program flow
B) Decision point
C) Output
D) Sub-structure nesting
  • 48. In what year was AlphaDev introduced by Google DeepMind?
A) 2020
B) 2025
C) 2019
D) 2023
  • 49. What does pseudocode typically represent in algorithm analysis?
A) A graphical aid like a flowchart
B) A detailed implementation guide
C) A simple and general representation
D) An optimized code for specific hardware
  • 50. Which heuristic algorithm is non-deterministic?
A) Tabu search
B) Simulated annealing
C) Prim's algorithm
D) Floyd–Warshall algorithm
  • 51. Which type of algorithms are inherently serial and cannot be parallelized?
A) Parallelizable algorithms
B) Non-deterministic algorithms
C) Distributed algorithms
D) Inherently serial problems
  • 52. Which AI system discovered improved sorting and hashing algorithms?
A) AlphaEvolve
B) AlphaDev
C) DeepMind
D) AlphaZero
  • 53. Which device is considered the first real Turing-complete computer?
A) Babbage's analytical engine
B) Z3
C) Difference Engine
D) ENIAC
  • 54. Which search algorithm is more efficient for sorted lists in terms of time complexity?
A) Sequential search
B) Linear search
C) Bubble sort
D) Binary search
  • 55. What is the open question known as that involves whether randomized algorithms with polynomial time complexity can be the fastest for some problems?
A) Reduction of complexity problem
B) P versus NP problem
C) Monte Carlo problem
D) Las Vegas problem
  • 56. Which design approach involves breaking a problem into smaller sub-problems?
A) Dynamic programming
B) Template method pattern
C) Divide-and-conquer
D) Decorator pattern
  • 57. What was a significant development in data storage and transmission around 1890?
A) Magnetic tape
B) Punch cards
C) Hard drives
D) Floppy disks
  • 58. Which formalization is associated with Alonzo Church and was introduced in 1936?
A) Recursive functions
B) Lambda calculus
C) Turing machines
D) Formulation 1
  • 59. Which AI development has inverted the traditional sequence of algorithm evolution from heuristics to formal algorithms?
A) SAINT program
B) NIST encryption standards
C) Transformer-based AI
D) Quantum computing
  • 60. Which invention in 1835 led to the development of telephone-switching networks?
A) Telegraph
B) Electromechanical relays
C) Punch cards
D) Difference engine
  • 61. What type of problems can be solved using the greedy method for minimal spanning trees?
A) Dynamic programming problems.
B) Problems with integer constraints.
C) Linear programming problems.
D) Graphs without negative cycles.
  • 62. What was the primary use of ticker tape developed in the 1870s?
A) Data transmission
B) Image printing
C) Audio recording
D) Text messaging
  • 63. Which century saw the use of accurate automatic machines leading to mechanical automata?
A) 13th century
B) 15th century
C) 17th century
D) 19th century
Created with That Quiz — the site for test creation and grading in math and other subjects.