The Wayback Machine - https://web.archive.org/web/20241001100502/https://www.geeksforgeeks.org/how-to-start-learning-dsa/
Open In App

How to Start Learning DSA?

Last Updated : 07 Aug, 2024
Summarize
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

In the journey of programming, every programmer comes across a point where they want to solve a problem in a more efficient way. While finding a way out of this, they eventually come to know about the term DSA. Now before jumping on how to start learning DSA, let us first know what the term DSA actually means.

How-to-Learn-DSA

Table of Contents

   

DSA Full Form: The Full form of DSA is Data Structures and Algorithms. As the name itself suggests, it is a combination of two separate yet interrelated topics – Data Structure and Algorithms.

In this journey to acquire a good grasp of DSA and become efficient in it, every programmer faces a big challenge “How to start learning DSA?”. In this article, we will be focusing on everything about DSA and how to begin your journey of DSA from scratch.

What is Data Structure?

A data structure is a particular way of storing and organizing data in our devices to use the data efficiently and effectively. The main idea behind using data structures is to minimize the time and space complexities. An efficient data structure takes minimum memory space and requires minimum time to execute the data. 

What is Algorithm?

Algorithm means a process or set of well-defined instructions that are typically used to solve a particular group of problems or perform a specific type of calculation. To explain in simpler terms, it is a set of operations performed in a step-by-step manner to execute a task. 

Algorithm

To learn more about algorithms refer to our article about “Introduction to Algorithm“.

Why Should you learn Data Structure and Algorithm?

Before moving to the question of “How to start learning”, first, let us look at why should we learn data structures and algorithms.

Every basic, as well as advanced, software and internet service, even searching a topic on the internet, all use one or other data structure or algorithm to implement. So in order to understand how any automated software or service works, it is a must to learn about data structures and algorithms first. 

For example, like in our daily life, in order to pour a glass of water from a bottle, we need to implement a series of steps, such as

  1. Place the glass in a vertical position with the mouth upwards
  2. Open the bottle cap
  3. Pick the bottle up
  4. Bend the bottle such that the mouth of the bottle is aligned with the mouth of the glass
  5. The water will start pouring.
  6. Once the glass is filled with water, straight up the bottle again.
  7. Keep the bottle down
  8. Close the lid of the bottle.

Although these steps seem very basic, they need to be implemented in the same manner every time to get the desired output. As per the definition above, we already know that any set of rules to do a specific task is known as an algorithm. Hence the above-mentioned steps can be distinguished as an algorithm, and the glass can be distinguished as a data structure to store water. Therefore, data structure and algorithms can be seen everywhere in our day-to-day life, and it is very necessary to understand them to perform our daily tasks in life. 

To learn in detail about the need for DSA refer to the article on “Why data structures and algorithms are necessary“.

DSA – Self Paced Course

DSA is the heart of root programming, knowing just computer language is not enough! That is why, at GeeksforGeeks, we have designed this self-paced course from the experts having years of industry expertise, where you’ll get to learn the basics of DSA, practice coding questions & attempt the assessment tests from anywhere in the world! So, wait no more! Join the course now and get ready to ace any product-based organization of your choice.

5 Steps to start learning DSA

Let us now move to the most important question “How to start learning DSA?“

This procedure may vary from person to person. But here we are trying to provide a general solution to the problem. A beginner can follow the step-by-step process as given below to get started with DSA:

1. Getting to know the topics:

The most important step is to find out the topics and the best of the resources for those. Before starting to learn about DSA first get an idea of what are the things you need to learn and the available resources for them. 

When divided into parts, namely data structure and algorithm; one may follow the below topics in-order while starting to learn DSA:

2. Finding the best resources for learning DSA

Once you have known what you have to learn, it is now time to find out from where you have to learn. You can learn DSA from various text, video or hybrid types of resources such as:

3. Learn the Fundamentals of DSA properly:

After gathering all the topics and resources, it’s time to start learning the DSA. To learn about any algorithm and data structure, the most crucial step is to learn the fundamentals first. Without learning the basics properly we cannot implement them properly and also cannot move to advanced applications. 

Based on the chosen resources, make sure to spend a keen amount of time learning about the fundamentals of each data structure and the basics of algorithms. Make sure to practice at every step to help solidify your learnings. You can also use our Practice portal for this purpose.

4. Master data structures and algorithms one by one:

Once you have become well versed with the fundamentals of DSA, it is now time to learn about the DSA in depth, i.e., know about the various detailed applications of Data Structures, learn about various complex algorithms, and how to implement them in problems. 

Here as well you need to keep practicing at every step, to make sure to solidify your DSA learnings. You can also try to attend various coding competitions and challenges to practice and test your learning so far. Here’s a list of Top 15 websites for coding competitions and challenges that you can try out. 

5. Consistency is the key:

Every monument is built brick by brick by working on a daily basis consistently, and so is the case for DSA. You must try to learn at least 1 new topic every day and solve at least 1 new problem related to it every day. Making this a practice for each day every day will help you master DSA in the best possible manner.

Make sure to give coding challenges at regular intervals as well. You might face challenges in solving even 1 problem in the beginning, but at the end, it will be all worth it. You can try GeeksforGeeks POTD to solve one problem based on DSA every day and here you can also use the discussion forums to help you make sure you get the logic properly. To know more about the discussion portals read the article – Stuck in Programming: Get The Solution From These 10 Best Websites.

Key Points to keep in mind to master DSA

1. Spaced Repetition:

A most common question anyone faces is: “I solved a number of questions but still cannot solve them after 7 – 10 days. How can I remember them?“. 

The first and foremost answer to this is Not to try to remember the codes. The solution lies in practice and spaced repetition.

Spaced repetition is a method to fully learn something by recalling and reviewing the concepts in particular time intervals until you learn the concepts completely.

As seen the best time intervals will be to solve the problem again in a couple of days, then in 7-10 days and then in a month. It will help you to develop the habit of revising any topic at a proper time interval.It is always noticed that if you are revising concepts on spaced repetition so that’s make your concepts more and more well built and clear.

2. Practice more and more:

By now you are equipped with basic data structures and algorithms. Now the most important thing is your speed and efficiency i.e. how quickly you can find out the optimal solution and minimize the error in your approach. 

As with any other work, the only way for this is also to “practice, practice and practice”. You can practice them in several online platforms for practicing problems. Also, you can participate in real-time challenges held time-to-time. 

Some of the coding challenges that can help you achieve this are:

3. Solve a variety of problems:

Now it is time to increase the size of your arsenal. As you have mastered a handful of data structures and algorithms, let’s venture out to solve problems of varying difficulty and topics. 

It will help you in two ways. 

  • As the problems are not bound by categories, it will increase the pool of your data structures and algorithms through exposure to unknown algorithms. This time you will not require to code all the problems as you have already solved and programmed so many other problems. 
  • This will also boost your thinking capacity and you will come to know about the applications of different algorithms.

You can also refer to below links to practice problems in its respective difficulties:

You can also try from our curated lists of problems from below articles:

4. Participate in Coding Challenges:

A good amount of time is dedicated by now and you have also learned a lot. But have you reached your goal of mastering DSA – the reason behind your learning data structures and algorithms?

The only way to get the answer is by checking yourself out against other enthusiasts and original masters of DSA. There is hardly any other solution to this that is better than participating in some competitive coding challenges to gauge your ability. It will increase your coding speed and widen your view of how a problem can have so many varieties of approaches and also it helps you to be familiar with the interview environment because in interview you have time bound so by giving contests repeatedly to your on the path of boost your problem solving skills.

Also upsolving the contest is very much essential help building your concepts more robust. So must remember  always solve the problems that you don’t able to solve in the contest.

5. Try solving Interview questions:

Though you have done almost everything, there is always room for improvement. Let us assume you are a consistent performer in real-time coding challenges and showing great results in that. Still, it is possible that you are not always finding out the most optimal solution to a problem, because competitive coding does not always require the most efficient approach.

There solving interview questions can prove handy. It is a natural practice in interviews to seek the most optimal approach. Now, by exposing yourself to interview questions you will become efficient day by day and also get prepared for interviews.

You can also try to solve the most asked interview questions based on the list curated by us at: 

How long does it take to learn Data Structure and Algorithms?

Let us first clarify a thing that learning is a never-ending process. You can learn new things even after programming for years. But a viable question is “How long will it take to learn the basics of DSA”. Though the answer to the question varies from person to person and their time and dedication, an average approximation can be provided for this question. It is fair to say that one can master the basics within 10-12 weeks if one dedicates 3-4 hours a day. Again this varies from person to person. One may master it in 1 month and for some, it may take 5-6 months or more than that. This approximation is based on the time offered for courses like the ones run by Swayam (a Government of India initiative), GeeksForGeeks and others.

How to be good at Data Structure and Algorithms?

Since you have learned how to start learning DSA, the next goal is obviously to be good at DSA. Let us first clarify one thing. There is no easy way to be good at programming. But there is an efficient way to do so.  That depends on factors like:

  • Prior knowledge
  • Why you want to learn
  • Available resources
  • A perfect guide.
  • Consistency

For more details, refer to the article “How can one become good at Data Structures and Algorithms“.

What are the best resources?

As mentioned earlier, now we will discuss about the best possible resources. We at GeeksForGeeks have a vast collection of tutorials and problems related to DSA covering all types of topics from basic to the most advanced ones. Anyone willing to learn about a topic can anytime find the topics in the Archive section of GeeksForGeeks. There are also several past, running and upcoming courses available in the GeeksForGeeks Courses.

What are the best platforms?

Now we have learned about resources. But there is one more crucial step – practicing the problem. We need some platform to practice and implement our knowledge. GeeksForGeeks has the perfect solution for that. We have built the GeeksForGeeks Practice Portal exclusively for that reason. There are numerous problems available in the practice section. Moreover, you have the facility to filter the problems based on the type of data structure or algorithm, or even difficulty.

Conclusion

From the above discussion, we can conclude that though the process of learning data structures and algorithms is a bit lengthy and tough,it requires consistent hard work and practice if you follow the right path, be methodical with your approach of collecting resources and revisions and practice problems you will surely be able to learn DSA if an efficient way.

You must remember one thing during your learning phase – Learning is a continuous process. So prime objective would be to remain consistent and dedicate at least a minimum amount of time of your day towards learning DSA. If you are inconsistent then it is highly likely that you will forget the previously learned topics and have to start afresh which will ruin your efforts made till now.

Also it is always seen that no one’s journey is perfect so must remember that practices makes a man perfect and there are many up’s and down’s so don’t afraid from all that keep learning and keep growing.

Related Articles: 



Similar Reads

Why start + (end - start)/2 is preferable method for calculating middle of an array over (start + end)/2 ?
I am very sure that everyone is able to find middle index of array once you know start index and end index of array, but there are certain benefits of using start + (end - start)/2 over (start + end)/2, which are described below : The very first way of finding middle index is mid = (start + end)/2But there is a problem with this approach, what if t
8 min read
What is DSA | DSA Full Form
What is DSA?DSA(Data Structures and Algorithms) is defined as a combination of two separate yet interrelated topics – Data Structure and Algorithms. DSA is one of the most important skills that every computer science student must have. It is often seen that people with good knowledge of these technologies are better programmers than others and thus
2 min read
How Should I Start Learning Ethical Hacking on My Own?
Ethical hacking refers to offensive testing of computer systems in order to find out security-related loopholes. These loopholes are called security vulnerabilities. It has been a very popular career choice for students of all backgrounds(non-CS students can also learn it easily and be equally good as CS students, or even better than them). Since e
5 min read
How to Start Coding: A Beginner's Guide to Learning Programming
In today's digital age, learning programming has become increasingly important. As technology continues to advance, the demand for skilled programmers across various industries is on the rise. Whether you want to pursue a career in tech, develop problem-solving skills, or simply unleash your creativity, learning how to code is a valuable and reward
15+ min read
Best Way To Start Learning Core Java – A Complete Roadmap
In the corporate world, they say "Java is immortal!". It is one of the most robust programming languages that is currently used in more than 3 billion devices. It is a general-purpose, object-oriented programming language designed at Sun Microsystems in 1991. In the current era, Java is one of the most famous programming languages as it can be util
9 min read
Best Way To Start Learning Python - A Complete Roadmap
Python...The world's fastest-growing and most popular programming language not just amongst software engineers but also among mathematicians, data analysts, scientists, accountants, network engineers, and even kids! because it's a very beginner-friendly programming language. People from different disciplines use Python for a variety of different ta
10 min read
Need of Data Structures and Algorithms for Deep Learning and Machine Learning
Deep Learning is a field that is heavily based on Mathematics and you need to have a good understanding of Data Structures and Algorithms to solve the mathematical problems optimally. Data Structures and Algorithms can be used to determine how a problem is represented internally or how the actual storage pattern works & what is happening under
6 min read
Getting started with Machine Learning || Machine Learning Roadmap
Machine Learning (ML) represents a branch of artificial intelligence (AI) focused on enabling systems to learn from data, uncover patterns, and autonomously make decisions. In today's era dominated by data, ML is transforming industries ranging from healthcare to finance, offering robust tools for predictive analytics, automation, and informed deci
11 min read
Online Learning vs Classroom Learning - What is Better for You?
Online Learning vs Classroom Learning - One of the most trending and debatable topics in the present-day world. And why not, as the global education industry has seen an exponential surge towards online education after the unprecedented pandemic. Learning and upgrading yourself by staying at home i.e. via online mode has certainly become the new no
7 min read
Circular Linked List meaning in DSA
A circular linked list is a special type of linked list in which the last node is connected to the first node, creating a continuous loop. In a circular linked list, each node has a reference to the next node in the sequence, just like in a regular linked list, but the last node's reference points back to the first node. Characteristics of Circular
3 min read
Queue meaning in DSA
A Queue is defined as a linear data structure that is open at both ends and the operations are performed in the First In First Out (FIFO) order. Characteristics of Queue:The first item added to the queue is the first one to be processed (or can be firstly deleted/removed), and subsequent items are processed in the order they were added.Enqueue and
3 min read
Subarray meaning in DSA
A subarray is a portion of an array that consists of consecutive elements from the original array. Characteristics of a Subarray:Contiguity: The elements in a subarray are contiguous, meaning they are consecutive and in order in the original array.Length: The length of a subarray can be any positive integer, from 1 to the length of the original arr
2 min read
DSA Internship Hiring Challenge For Freshers By GeeksforGeeks
Are you someone who's passionate enough to grow a career in DSA? But couldn't find a platform to proceed. No worries!!! GeeksforGeeks, have come up with a hiring challenge for all those who are good in DSA and can bring changes to solutions. DSA Summer Internship Hiring Contest - A hiring contest for DSA experts who is comfortable working with our
3 min read
Disjoint Set meaning and definition in DSA
Disjoint Set is a data structure that keeps track of a set of elements partitioned into a number of disjoint subsets and it is used to efficiently solve problems that involve grouping elements into sets and performing operations on them. Characteristics of the Disjoint Set:It keeps a set partitioned into disjoint subsets.It allows the efficient uni
2 min read
What is Greedy Algorithm in DSA?
A Greedy Algorithm is defined as a problem-solving strategy that makes the locally optimal choice at each step of the algorithm, with the hope that this will lead to a globally optimal solution. In other words, a greedy algorithm always chooses the option that seems the best at the moment, without considering the future consequences or possibilitie
4 min read
Deque meaning in DSA
Deque, which stands for Double Ended Queue, is a special type of queue that allows adding and removing elements from both front and rear ends. Characteristics: of Deque:Dynamic size: The size of a deque can change dynamically during the execution of a program.Linear: Elements in a deque are stored linearly and can be accessed in a sequential manner
2 min read
Balanced Binary Tree definition & meaning in DSA
Balanced binary tree is defined as a binary tree data structure where there is no more than one height difference between the left and right subtrees of any given node. Mathematically Height of left subtree - Height of right subtree ≤1 Properties of Balanced Binary Tree: A balanced binary tree has a height that is logarithmic in the number of nodes
2 min read
Min Heap meaning in DSA
A min heap is a binary tree-based data structure where the value of each node is less than or equal to its child nodes. In other words, the root node is always the minimum element in the heap. Here is an example of the min heap tree: Characteristics of Min Heap :A min heap is a complete binary tree. This property ensures that the tree is balanced a
3 min read
How to Write DSA Articles on GeeksforGeeks?
GeeksforGeeks provides all the coding enthusiasts an opportunity to showcase their programming and Data Structures & Algorithms skills by writing coding or DSA-based articles. However, a lot of individuals (especially college students or beginners) find it difficult to articulate their learnings & skills and contribute at GeeksforGeeks. But
9 min read
Algo Geek - DSA Article Writing Contest By GeeksforGeeks
The long-awaited results of the Algo Geek - DSA Article Writing Contest have finally been announced!!!!Check out the complete list of Top 10 Winners from below. PositionArticle's Link 1st Number of K-length paths in a Tree2nd Find a permutation of 1 to N, such that A is minimum in left half and B is maximum in right half 3rd Longest subsegment of '
7 min read
Dynamic Programming meaning in DSA
Dynamic Programming is defined as an algorithmic technique that is used to solve problems by breaking them into smaller subproblems and avoiding repeated calculation of overlapping subproblems and using the property that the solution of the problem depends on the optimal solution of the subproblems Properties of Dynamic Programming:Optimal Substruc
2 min read
GFG Summer Break Challenge 2022 - FREE Weekly DSA Coding Contest Series
Summer Vacations are here! Are you a DSA Philomath? If yes, Do you want to spend your weekend productively this summer vacation? So, GeeksforGeeks has come up with a solution DSA Weekly Contest - GFG Summer Break Challenge. Solve questions and bag prizes. Feels Great, Right? The perks of participating in this challenge are you become placement-read
2 min read
Doubly Linked List meaning in DSA
A doubly linked list is a special type of linked list in which each node contains a pointer to the previous node as well as the next node in the structure. Characteristics of the Doubly Linked List: The characteristics of a doubly linked list are as follows: Dynamic size: The size of a doubly linked list can change dynamically, meaning that nodes c
3 min read
Backtracking meaning in DSA
Backtracking can be defined as a general algorithmic technique that considers searching every possible combination in order to solve a computational problem. Backtracking simple structure is shown like the following: Properties of Backtracking:Incremental construction: Backtracking builds a solution incrementally by constructing a partial solution
3 min read
Binary Indexed Tree/Fenwick Tree meaning in DSA
Binary Indexed Tree (BIT), also known as Fenwick Tree, is a data structure used for efficiently querying and updating cumulative frequency tables, or prefix sums. A Fenwick Tree is a complete binary tree, where each node represents a range of elements in an array and stores the sum of the elements in that range. Below is a simple structure of a Bin
3 min read
Branch and Bound meaning in DSA
Branch and bound is an algorithmic technique used in computer science to solve optimization problems. Branch and bound is a systematic way of exploring all possible solutions to a problem by dividing the problem space into smaller sub-problems and then applying bounds or constraints to eliminate certain subproblems from consideration. Characteristi
3 min read
Array Definition & Meaning in DSA
An array is a collection of items of same data type stored at contiguous memory locations Types of Arrays:One-dimensional Array: It is the simplest kind of array where all the elements are stored linearly in a single row. Two-dimensional Array: A two-dimensional array is an array with 2 dimensions, i.e., each unique element is accessed using two it
4 min read
Hashing meaning in DSA
Hashing is defined as a data distribution technique that transforms given key into a different value using hash function for faster access to data. Characteristics of Hashing:Hashing maps the data object to exactly one memory bucket.It allows uniform distribution of keys across the memory.Uses different functions to perform hashing such as mid squa
2 min read
Max Heap meaning in DSA
A max heap is a complete binary tree in which every parent node has a value greater than or equal to its children nodes. Properties of a Max Heap :A max heap is a complete binary tree, meaning that all levels of the tree are completely filled, except possibly the last level which is filled from left to right.In a max heap, every parent node has a v
3 min read
What is Sorting in DSA | Sorting meaning
Sorting is defined as the process of arranging a collection of data elements in a specific order, usually in ascending or descending order based on a specific attribute of the data elements. Characteristics of Sorting:Time Complexity: Time complexity, a measure of how long it takes to run an algorithm, is used to categorize sorting algorithms. The
3 min read