Criteria Used to Judge/Design a Good Algorithm
- Correctness — produces the correct output for all valid inputs, including edge cases
- Efficiency — time complexity (speed) and space complexity (memory usage) — usually the primary comparison metric between competing algorithms
- Simplicity/Clarity — easy to understand, implement, debug, and maintain
- Generality — solves a class of problems, not just one specific instance
- Optimality — achieves the best possible complexity for the problem (e.g., comparison-based sorting cannot beat O(n log n) — a proven lower bound)
Design Paradigms (commonly tested alongside criteria)
- Divide and Conquer (Merge Sort, Quick Sort, Binary Search)
- Greedy (locally optimal choice at each step — Dijkstra's, Kruskal's)
- Dynamic Programming (overlapping subproblems + optimal substructure — Fibonacci, Knapsack)
- Backtracking (explore, and undo if a choice fails — N-Queens, Sudoku)
Exam Angle
A question like "What criteria would you use to select an algorithm for a given problem?" expects Correctness + Time/Space Efficiency + Simplicity as the core three, with a worked example.
📌 Sample & Repeated FPSC Questions (2016–2026)
FPSC has not directly isolated this exact definitional sub-topic (criteria for judging/selecting a good algorithm) as a standalone question in the 2016–2026 CS-optional papers — it typically appears folded into broader design-paradigm or complexity-comparison questions rather than being asked in this exact form.