Many young programmers scour the web trying to find answers to this question: How to study Algorithm and Data structure? Certainly, a good place to start... But a more relevant question would be: What are algorithms and data structures, and why should I study them?
Let’s start with this motivating quote: “Every program depends on algorithms and data structures, but few programs depend on the invention of brand new ones.” -- Kernighan & Pike
What is an algorithm?
Wikipedia says “an algorithm is a self-contained step-by-step set of operations to be performed. Algorithms perform the calculation, data processing, and/or automated reasoning tasks.”
Whether you are cooking a burger or adding two numbers, there’s an algorithm at work. From monitoring stock markets to pairing soul mates, algorithms are omnipresent.
An algorithm is a detailed step-by-step instruction set or formula for solving a problem or completing a task. You need algorithms to achieve the input–output relationship. Repetition, sequencing and conditional logic are computational concepts that manifest in your everyday life. Your morning routine can be an algorithm. Can you guess how?
There’s this great TEDEd cartoon by Harvard computer scientist David J. Malan you should see.
Algorithms are much more than instructions. What matters is that they teach you to define clear steps and conceptualize solutions.
Examples, anyone?
If you're shopping for a prom dress or driving to the mall, you are using a greedy algorithm. You make the locally optimum choice at each stage hoping to find the global optimum.
If you know the famous traveling salesman problem, then you’ll know how it applies to optimizing delivery routes.
Read this article about a two-year project led by Prof. William Cook. His team calculated the shortest distance to nearly 25,000 pubs in the UK using Google Maps.
What approach would you use to find a name in a phonebook? The brute-force algorithm. Try all possibilities until you find a solution. It works, but not well for complex problems.
Remember when IBM’s Deep Blue used brute-force methods to defeat chess champion Garry Kasparov? Times have changed, and so has computational power.
Then there are data compression algorithms—like MP3, JPEG, ZIP—that reduce file size. Huffman coding is a greedy approach that works well for efficient encoding.
The PID algorithm uses feedback to control systems like robots or heating units. It's still widely used, despite newer alternatives like MPC in cutting-edge applications.
What is Data Structure and why study it?

Data structure refers to an orderly arrangement of data. Think of it like organizing documents in folders. From encyclopedias to bank statements, structure matters.
Think not binary trees or associative arrays; think a shopping list. Data structures store objects and allow their manipulation. A mathematical model of a data structure is an abstract data type (ADT). These can be linear (arrays, stacks, queues) or nonlinear (trees, graphs, sets).
Abstractions help us focus on the big picture. ADTs specify the fields and operations; data structures implement them. For instance, Java source code access is limited so programmers can’t tamper with the software core.
Now how do we connect algorithms to data structures?
You use an algorithm—like looking up synonyms in a thesaurus—using data from a structured source (the thesaurus). Algorithms use the organization provided by data structures. You can’t really split them. “Data structures organize data and algorithms use that organization.”
Understanding these high-level building blocks is essential for programming success.
"I will, in fact, claim that the difference between a bad programmer and a good one is whether he considers his code or his data structures more important. Bad programmers worry about the code. Good programmers worry about data structures and their relationships." – Linus Torvalds
Learn more about how algorithms are taking over our world and how to get started with competitive programming.
Just to reiterate, you can't make a house by just stacking bricks—you need to understand the problem, create a feasible solution, and implement it without losing sight of the big picture.