An algorithm is a step-by-step method to solve a problem in a finite number of steps. In DSA, algorithms help in efficiently processing and manipulating data.
Imagine you want to make tea. Your algorithm would be:
Solves problems by calling itself.
Chooses the best option at each step.
Stores results of subproblems to avoid repetition.
Divides the problem into smaller parts and solves each.
1. Start 2. Take input array of n numbers 3. Set max = first element 4. Loop i from 1 to n-1 → If arr[i] > max → max = arr[i] 5. Print max 6. Stop
Help others discover Technorank Learning by sharing your honest experience.
Your support inspires us to keep building!