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