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