4) Algorithms (Sorting, Searching, Complexity)
📖 Theory – 4) Algorithms (Sorting, Searching, Complexity)
I. What is an Algorithm?
• A step‑by‑step procedure to solve a problem.
• Represented using pseudocode or flowcharts.
II. Searching Algorithms
• Linear search: O(n), simple but slow.
• Binary search: O(log n), requires sorted data.
III. Sorting Algorithms
• Bubble sort: O(n²), simple.
• Merge sort: O(n log n), efficient.
• Insertion sort: O(n²), good for small lists.
IV. Complexity Analysis
• Big‑O notation: describes time complexity.
• Constant, linear, quadratic, logarithmic.
V. Flowcharts and Pseudocode
• Symbols: start/end, process, decision, input/output.
• Writing pseudocode for algorithms.
VI. Efficiency
• Comparing algorithm efficiency.
🏆 Level 1
⭐ 0 points
📝 Practice Questions (20)
Select the correct answer, then click "Submit" to see the result. If you get it wrong, an AI hint will be generated.
Question 1: How does Insertion sort work?
Question 2: How does Search algorithm work?
Question 3: Why is O(n) important in computer science?
Question 4: How does Trace table work?
Question 5: Give an example of Insertion sort.
Question 6: Explain Algorithm.
Question 7: How does Recursion work?
Question 8: What is Time complexity?
Question 9: How does Bubble sort work?
Question 10: Define Bubble sort.
Question 11: Define O(log n).
Question 12: Define Linear search.
Question 13: Why is Algorithm important in computer science?
Question 14: Give an example of Trace table.
Question 15: Give an example of Efficiency.
Question 16: Explain Binary search.
Question 17: Explain Pseudocode.
Question 18: Give an example of Iteration.
Question 19: Give an example of Flowchart.
Question 20: Give an example of Big-O notation.
Module score: 0/0