Data Structures

Arrays - ds easy problem solving (basic) max score: 10 success rate: 93.03%, 2d array - ds easy problem solving (basic) max score: 15 success rate: 93.17%, dynamic array easy problem solving (basic) max score: 15 success rate: 87.03%, left rotation easy problem solving (basic) max score: 20 success rate: 91.48%, sparse arrays medium problem solving (basic) max score: 25 success rate: 97.29%, array manipulation hard problem solving (intermediate) max score: 60 success rate: 61.75%, print the elements of a linked list easy problem solving (basic) max score: 5 success rate: 97.15%, insert a node at the tail of a linked list easy problem solving (intermediate) max score: 5 success rate: 95.31%, insert a node at the head of a linked list easy problem solving (basic) max score: 5 success rate: 98.31%, insert a node at a specific position in a linked list easy problem solving (intermediate) max score: 5 success rate: 96.95%, cookie support is required to access hackerrank.

Seems like cookies are disabled on this browser, please enable them to open this website

InterviewBit

15 Best Data Structures and Algorithms Courses [2024]

Introduction, best data structures and algorithms courses (2024), frequently asked questions, useful resources, other courses.

The world of computer science revolves around data structures and algorithms. They serve as the bedrock for all other parts of computer science and development. This is why firms like Google, Microsoft, and Facebook are on the lookout for programmers who are knowledgeable about data structures and algorithms. Learning DSA could be beneficial whether you are seeking a new job or attempting to improve your skills. To learn how to code, you don’t need to spend loads of money on a college education. This is when online courses come in handy. They are a great source of learning and act as proof of skill during interviews.

You’ve come to the right place if you want to learn about data structures and algorithms. We made an effort for you. We searched through the highest-rated courses on the web and hand-picked 15 of the best to help you become an expert on the most-wanted skill right now.

1. Scaler Academy’s Data Structure and Algorithm Course

Scaler Academy by InterviewBit offers a thoughtfully designed curriculum to make you understand the toughest of DSA concepts easily. Courses are available for all levels-beginners, intermediate, and expert. The curriculum can be optimized to your pace of learning. Projects and assignments at the end of topics help you cement the concepts you have learned. This course will teach you how to become an expert in data structures and algorithms, as well as how to ace product interviews so you can advance in your computer career.

Confused about your next job?

The course covers

  • The basics of programming
  • Time Complexity
  • Binary Search
  • 2 Pointers, Recursion
  • Bit manipulation
  • Linked Lists
  • Greedy Algorithms
  • DP (Dynamic Programming)
  • Database concepts
  • OS, and 
  • Computer Networks

Duration: 44 weeks Eligibility: Anyone who graduated in 2022 can apply Price: 3.59 lakhs, but your monthly payment might be as low as Rs 8,370 per month with scholarship and EMI choices

Check Out: Scaler Academy’s Data Structure and Algorithm Course

2. Algorithms & Data structures-Part 1 and 2 (Coursera)

This course covers the principles of algorithms and data structures that every serious programmer should know, with a focus on Java implementations and scientific performance analysis. Basic data structures, sorting, and searching strategies are covered in the first section of the course. The second section of the course is dedicated to graph and string processing techniques. This course includes all the features for free. It comes with a certificate when you finish it, but you have to pay for the certificate. 

Topics covered in part 1:  

  • Analysis of algorithms
  • Stacks and queues
  • Elementary sorts
  • Priority queues
  • Elementary symbol tables
  • Balanced search trees
  • Geometric applications of BSTs
  • Hash Tables
  • Symbol table application

Duration: 53 hours approx. You can set deadlines according to your schedule. Level: Intermediate level Price: Free to enroll

3. Data Structures-University of California San Diego

The common data structures that are utilized in many computational problems are discussed in this online course. You will learn how to implement these data structures in various programming languages and will experience doing so in our programming assignments. This will assist you in understanding what is happening inside a specific built-in implementation of a data structure and what to expect from it. The prerequisite of the course is any object-oriented programming language. You’ll also learn about common applications for these data structures.

Topic covered:

  • Basic Data structures (arrays, linked list, stacks, queues)
  • Dynamic arrays and amortized analysis
  • Priority queues and disjoint sets
  • Hash tables
  • Binary search trees 

Duration: 25 hours approx. You can set deadlines according to your schedule. Level: Intermediate level Price: Free to enroll

4. Data Structures-by NPTEL

This data structure course by NPTEL will teach you-efficient storage mechanisms of data for easy access, to design and implementation of various basic and advanced data structures to introduce various techniques for the representation of the data in the real world, to develop applications using data structures, to teach the concept of protection and management of data, to improve the efficiency of any algorithm by using the suitable data structure.

Topics covered:

  • Introduction to List 
  • Array and Linked List  
  • Stack Implementation using array and linked list – Applications of Stack
  • Queue Implementation – Application of Queues
  • Trees and Terminologies – Tree Traversals
  • In order Traversal-Binary Search Tree – Implementation of Search Algorithm
  • AVL Tree Insertion, Deletion
  • Graph representation, Shortest Path Algorithm
  • Sorting, Heap Techniques, Hashing
  • Sorting Algorithms, Divide and Conquer algorithms
  • Selection Sort, Brute force sort, Bubble Sort
  • Insertion Sort, Quicksort applications
  • Prim’s Algorithm, Kruskal’s Algorithm
  • Bucket Sorting, Radix Sort, Merge Sort
  • Directories and Contiguous allocation, File maintenance
  • External Sorting, Cascade Merge Sort
  • B + Tree maintenance and efficiency, Construction of B-tree, B+tree insertion and deletion

Duration: 12 weeks Level: Undergraduate/Postgraduate

5. CS50’s Introduction to Computer Science

CS50x is a Harvard University course that introduces majors and non-majors alike, with or without prior programming experience, to the academic pursuits of computer science and the art of programming. CS50x is an introductory computer science course given by David J. Malan that teaches students:

  • How to think algorithmically and solve problems quickly
  • Abstraction
  • Data structures
  • Encapsulation
  • Resource management
  • Software engineering, and
  • Web development 

C, Python, SQL, and JavaScript, as well as CSS and HTML, are among the languages available. Real-world domains such as biology, encryption, economics, forensics, and gaming-inspired problem sets are present in this course. CS50, Harvard’s largest course, is the on-campus version of CS50x. A certificate is awarded to students who get an acceptable grade on nine problem sets (programming assignments) and a final project. CS50x is a self-paced course that you can do at your own speed.

Duration: 12 weeks Level: Introductory Prerequisites: None

6. Introduction to Algorithms

This open course from MIT provides an introduction to computational problems and mathematical modeling. It goes over the most prevalent algorithms, algorithmic paradigms, and data structures for solving these issues. The focus of the course is on the interaction between algorithms and programming, as well as basic performance measures and analysis approaches for these issues.

What you will learn:

  • Introduction to mathematical modeling of computational problems
  • Common algorithm
  • Algorithm paradigms
  • Relationship between algorithms and programming
  • Basic performance measures and analysis techniques for these problems.

Duration: Not available Level: Undergraduate Prerequisites:  Basic understanding of Python as well as a solid background in discrete mathematics.

7. Data Structures and Algorithms Specialization Program (Coursera)

The University of California, San Diego, and the National Research Institute Higher School of Economics both offer this specialization in algorithms and data structures. Students learn the theory underlying algorithms, implement them in a programming language of their choice, and use them to solve actual problems in this curriculum, which offers a solid blend of theory and practice.

The program is divided into six courses, with the first two covering theory and basic algorithmic techniques before moving on to advanced algorithms and complexity. It includes the following topics:

  • Using data structures to solve a variety of problems
  • Graph data structure
  • Graph-based algorithms
  • Algorithms on strings
  • Advanced algorithmic concepts like Network flows, linear programming, and NP-complete problems

Duration: 8 months Level: Intermediate-level course Prerequisites:  Basic knowledge of any one programming language like C, C++, Java, Python, JavaScript, or Kotlin Is required.

8. Algorithms Specialization by Stanford University

Stanford University offers this Coursera Algorithms speciality. Understanding the fundamentals of algorithms and related data structures is required for serious work in nearly every discipline of computer science. This course introduces learners to algorithms and emphasizes conceptual knowledge rather than diving right into mathematical specifics and low-level implementation. It aids in the development of the participants’ programming and thinking skills, preparing them to pursue serious software engineering, ace technical interviews, and study more sophisticated algorithms topics. 

  • Asymptotic (“Big-oh”) notation
  • Sorting and searching algorithms
  • Master method for analyzing algorithms
  • Quicksort algorithm and its analysis
  • Data structures-heaps, balanced search trees, hash tables, bloom filters
  • Dijkstra’s shortest-path algorithm
  • Breadth-first and depth-first search and its applications
  • Greedy algorithms (scheduling, minimum spanning trees, clustering, Huffman codes)
  • Dynamic programming (knapsack, sequence alignment, optimal search trees)
  • Shortest paths algorithms (Bellman-Ford, Floyd-Warshall, Johnson)
  • NP-complete problems and exact and approximation algorithms for them
  • Local search algorithms for NP-complete problems

Duration: 4 months Level: For intermediate-level learners Prerequisites: Not available

9. Free Algorithms Course by IIT Bombay (edX)

Expert academic members from the reputed IIT Bombay’s Department of Computer Science and Engineering designed this edX Algorithms course. It’s part of the Fundamentals of Computer Science XSeries Program at IIT Bombay, and it teaches students how to structure and use algorithms to solve real-world problems. Students learn how to think about algorithms and how to implement them using the best techniques in this computer science course. The course covers the following topics:

  • Sorting algorithms such as quick sort and merge sort
  • Searching algorithms
  • Median finding
  • Order statistics
  • Geometric algorithms like Polynomial Multiplication
  • String algorithms
  • Numerical algorithms
  • Matrix Operations, GCD, Pattern Matching, Subsequences, Sweep, and Convex Hull
  • Graph algorithms like shortest path and spanning tree

Duration: 6 weeks Level: Intermediate-level course Prerequisites: Requires basic knowledge of data structures and their implementation.

10. Data Science Foundations: Data Structures and Algorithms Specialization

Sriram Sankaranarayanan, the top instructor of Coursera, guides you through this advanced specialization. In this course, you will learn to organize, store, and process data efficiently using advanced data structures, design algorithms and analyze their complexities in terms of running time and space usage, searching and sorting algorithms, and build applications that support highly efficient algorithms and data structures. This specialization is part of a Master of Science in data science degree from the University of Colorado Boulder. Learners are expected to have knowledge of calculus, Probability theory, and some programming experience in python. The duration of this course is approximately three months.

Skills that you’ll gain:

  • Dynamic Programming
  • Greedy algorithms
  • Divide and Conquer algorithm
  • Randomized algorithms
  • Sorting algorithms
  • Spanning tree
  • NP-completeness

Duration: Approximately three months. Level: Intermediate Prerequisites:  Learners are expected to have knowledge of calculus, Probability theory, and some programming experience in python. Price: Free to enroll

11. Advanced-Data Structures-MIT Open courseware

This is a graduate-level course from MIT open courseware. Topics covered include

  • Time travel
  • Dynamic optimality
  • Memory hierarchy
  • Hashing 
  • Dynamic graphs

Duration: Not available Level: Graduate level Prerequisites: The prerequisite to this course is an undergraduate-level understanding of the design and analysis of algorithms and basic knowledge of data structures.

12. Programming Foundations: Algorithms

Joe Marini, author, and developer, walks you through some of the most popular and effective algorithms for finding and sorting data, working with recursion, and understanding common data structures in this course. He also goes through the performance implications of various algorithms and how to evaluate an algorithm’s performance. The teachings are demonstrated in Python, but they can be applied to any programming language. Topics covered:

  • Common data structures (Arrays, Linked List, Stacks, Queues, Hash Tables)
  • Other Algorithms (Unique filtering with hash tables, Finding max value recursively)

The course costs 1150 rupees and LinkedIn also provides a certificate of completion. The course is self-paced, and any beginner can apply for this course.

13. Python Data Structures

This Python data structures course is part of the University of Michigan’s Python for Everyone Specialization on Coursera. It gives an overview of the Python programming language’s basic data structures. This is one of the most popular courses, with a 4.9 rating and almost half a million students who have already completed it. 12% of the learners who have completed the course got a tangible career. Topics covered:

  • Installing Python
  • Dictionaries

Financial aid is available for this course which takes 19 hours to complete. The good thing about the course is that it is beginner-friendly.

14. Master the Coding Interview: Data Structures + Algorithms

This course is designed for you if you want to work for a great tech business like Google, Microsoft, Facebook, Netflix, Amazon, or another company but are terrified by the interview process and code questions. This course covers subjects like non-technical interviews and compensation negotiations, in addition to algorithms. Topics covered are: 

  • Big O notation
  • Arrays Hash Tables Singly Linked Lists Doubly Linked Lists Queues Stacks Trees (BST, AVL Trees, Red-Black Trees, Binary Heaps) Tries Graphs
  • Tree Traversal
  • Breadth-First Search
  • Depth First Search

Non-Technical

  • How to get more interviews
  • What to do during interviews
  • What to do after the interview
  • How to answer interview questions
  • How to handle offers
  • How to negotiate your salary
  • How to get a raise

The price of the course is 3499 rupees. You need to have a basic understanding of any programming language for this course. The course consists of 261 20-hour lectures. 

15. Accelerated Computer Science Fundamentals Specialization by the University of Illinois

The University of Illinois offers a Coursera Specialization in fundamental computer science algorithms and data structures. It’s a three-course curriculum created by computer science professor Wade Fagen-Ulmschneider to provide students with a route into computers and data science. Students must write C++ code snippets on a web-based interface in order to complete the program’s coding tasks. Each course also contains two projects in which students write C++ programs to do things like edit photographs, manipulate data structures efficiently, or solve a graph search problem. You will learn:

  • Designing and implementing an object-oriented program in C++
  • How to analyze time complexity and space required for an algorithm
  • Selecting and implementing the best data structures that best use the resources to solve a computational problem.
  • To implement and call sophisticated library functions after gaining a solid understanding of object data structures.

The course is flexible, and the learner should be able to write basic programs in any programming language. The duration of the course is 3 months.

Duration: 3 months with a flexible schedule Level: Intermediate level Prerequisites: None

There are so many courses available to learn data structures and algorithms, but few of them have the right balance between theory and practice. The courses that we covered in this article give a good mix of these two aspects of computing. They also contain every concept that you would need if someone asked you to code something real-world, out there. Anyway, I think this is enough information for you to make up your mind on which course you should take up next. Choose one of them and get started on your path to working for your dream company!

Q.1: Why are Data structures and algorithms important?

Ans: Data structure and algorithms are essential for developers since they show the problem-solving ability of the developer, the skill that recruiters value the most. Programmers with a strong understanding of data structures and algorithms can effortlessly handle data processing, reasoning, and calculations.

Q.2: Can I learn Data Structures and Algorithms in Python?

Ans: Yes, you can learn Data structures and algorithms in Python. 

Q.3: Where Data structures and algorithms are used?

Ans: DSA (Data Structure and Algorithm) is used in every aspect of computer science. Data structures are used to store information, while algorithms are used to solve problems with that data.

  • Array Interview Questions
  • Data Structure Interview Questions
  • Algorithm Interview Questions
  • Best System Design Courses
  • Best Machine Learning Courses
  • Best Data Science Courses
  • Data Structures and Algorithms
  • Data Structures and Algorithms Courses

Previous Post

Top 9 best data science courses online (2024 update), top 9 best machine learning courses in 2024.

Learn Python practically and Get Certified .

Popular Tutorials

Popular examples, reference materials, learn python interactively, learn data structures and algorithms.

Data Structures and Algorithms (DSA) is an essential skill for any programmer looking to solve problems efficiently.

Understanding and utilizing DSA is especially important when optimization is crucial, like in game development, live video apps, and other areas where even a one-second delay can impact performance.

Big companies tend to focus on DSA in coding interviews, so if you're good at it, you're more likely to land those higher-paying jobs.

In this guide, we will cover:

  • Beginner's Guide to DSA
  • Is DSA for You? (Hint: If you like breaking down problems and finding smart solutions, definitely yes!)
  • Best Way to Learn DSA (Your way!)

How to Practice DSA?

If you are simply looking to learn DSA step-by-step, you can follow our free tutorials in the next section.

Beginner's Guide to Data Structures and Algorithms

These tutorials will provide you with a solid foundation in Data Structures and Algorithms and prepare you for your career goals.

What is an algorithm?

Data Structure and Types

Why learn DSA?

Asymptotic Notations

Master Theorem

Divide and Conquer Algorithm

Types of Queue

Circular Queue

Priority Queue

Linked List

Linked List Operations

Types of Linked List

Heap Data Structure

Fibonacci Heap

Decrease Key and Delete Node Operations on a Fibonacci Heap

Tree Data Structure

Tree Traversal

Binary Tree

Full Binary Tree

Perfect Binary Tree

Complete Binary Tree

Balanced Binary Tree

Binary Search Tree

Insertion in a B-tree

Deletion from a B-tree

Insertion on a B+ Tree

Deletion from a B+ Tree

Red-Black Tree

Red-Black Tree Insertion

Deletion From a Red-Black Tree

Graph Data Structure

Spanning Tree

Strongly Connected Components

Adjacency Matrix

Adjacency List

DFS Algorithm

Breadth-first Search

Bellman Ford's Algorithm

Bubble Sort

Selection Sort

Insertion Sort

Counting Sort

Bucket Sort

Linear Search

Binary Search

Greedy Algorithm

Ford-Fulkerson Algorithm

Dijkstra's Algorithm

Kruskal's Algorithm

Prim's Algorithm

Huffman Coding

Dynamic Programming

Floyd-Warshall Algorithm

Longest Common Sequence

Backtracking Algorithm

Rabin-Karp Algorithm

Is DSA for you?

Whether DSA is the right choice depends on what you want to achieve in programming and your career goals.

DSA from Learning Perspective

If you're preparing for coding interviews, mastering Data Structures and Algorithms (DSA) is crucial. Most companies use DSA to test your problem-solving skills.

So learning DSA will boost your chances of landing a job.

Furthermore, if you're interested in performance-sensitive areas like game development, real-time data processing, or navigation apps (like Google Maps), learning DSA is crucial.

For example, the efficiency of a map application relies on the proper use of data structures and algorithms to quickly find the best routes.

Even if you're not focused on performance-sensitive fields, a basic knowledge of DSA is still important. It helps you write cleaner, more efficient code and lays the foundation for building scalable applications.

DSA is essential for anyone who wants to excel in programming.

DSA as a Career Choice

Data Structures and Algorithms (DSA) are fundamental for creating efficient and optimized software solutions. It's used in:

  • Software Development
  • System Design
  • Data Engineering
  • Algorithmic Trading
  • Competitive Programming and more

However, there are certain fields where focusing heavily on DSA might not be as essential. For example, if you are primarily interested in frontend design, UX/UI development, or simple scripting tasks, then deep DSA knowledge might not be your top priority.

In these cases, skills such as design principles, creativity, or proficiency in specific tools like HTML/CSS for frontend design or Python for scripting might be more relevant.

Ultimately, your career goals will help determine how important DSA is for you.

Best Way to Learn DSA

There is no right or wrong way to learn DSA. It all depends on your learning style and pace.

In this section, we have included the best DSA learning resources tailored to your learning preferences, be it text-based, video-based, or interactive courses.

Text-based Tutorial

Best: if you are committed to learning DSA but do not want to spend on it.

If you want to learn DSA for free with a well-organized, step-by-step tutorial, you can use our free DSA tutorials .

Our tutorials will guide you through DSA one step at a time, using practical examples to strengthen your foundation.

Interactive Course

Best: if you want hands-on learning, get your progress tracked, and maintain a learning streak.

Learning to code is tough. It requires dedication and consistency, and you need to write tons of code yourself.

While videos and tutorials provide you with a step-by-step guide, they lack hands-on experience and structure.

Recognizing all these challenges, Programiz offers a premium DSA Interactive Course that allows you to gain hands-on learning experience by solving problems, building real-world projects, and tracking your progress.

Best: if you want to have in-depth understanding at your own pace.

Books are a great way to learn. They give you a comprehensive view of programming concepts that you might not get elsewhere.

Here are some books we personally recommend:

  • Introduction to Algorithms, Thomas H. Cormen
  • Algorithms, Robert Sedgewick
  • The Art of Computer Programming, Donald E. Knuth

Visualization

Best: if you're a visual learner who grasps concepts better by seeing them in action.

Once you have some idea about data structure and algorithms, there is a great resource at Data Structure Visualizations that lets you learn through animation. There are many visualizer tools, however you can use Data Structure Visualization (usfca.edu) .

Important: You cannot learn DSA without developing the habit of practicing it yourself. Therefore, whatever method you choose, always work on DSA problems.

While solving problems, you will encounter challenges. Don't worry about them; try to understand them and find solutions. Remember, mastering DSA is all about solving problems, and difficulties are part of the process.

1. Use an IDE or Code Editor

The best way to practice DSA is to learn a concept and implement it from scratch. You can write and run your DSA code directly in online compilers or IDE like VS Code or any text editor.

2. Try Online Platforms:

Practice on sites like LeetCode or HackerRank for instant feedback and a variety of problems.

100 Most Popular Courses For September

dsa problem solving course

Harvard and MIT’s $800 Million Mistake: The Triple Failure of 2U, edX, and Axim Collaborative

The future of Coursera’s only credible alternative for universities rests in the hands of 2U’s creditors.

  • 1000s of Free Digital Marketing Courses
  • 10 Best Data Analysis Courses for 2024: From Data to Insights
  • Replacing Bad Study Habits with Effective Learning Techniques
  • [2024] 1800+ Coursera Courses Still Completely Free
  • 7 Best Autodesk Maya Courses for 2024: Exploring 3D Animation

600 Free Google Certifications

Most common

  • project management
  • graphic design

Popular subjects

Communication Skills

Project Management

Popular courses

Educación de calidad para todos: equidad, inclusión y atención a la diversidad

Early Childhood Care and Education

Introduction to Financial Accounting

Organize and share your learning with Class Central Lists.

View our Lists Showcase

Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

Data Structures & Algorithms Using C++

IBM via edX Help

Understanding various data structures and algorithms is the foundation of modern programming.

In this self-paced course you will learn about the characteristics of commonly used data structures and algorithms and how to implement them to be able to conduct efficiency analyses in C++ from scratch.

To solve real-world problems efficiently, advanced C++ programs are developed using pointers, dynamic storage, and linear and non-linear data structures. You will gain experience with a variety of algorithm types like recursion, searching, sorting, dynamic programming, greedy, and divide and conquer, which are required to build efficient programs. You will also learn how to measure the efficiency of the program you have written. After completing the course, you will be able to systematically approach coding problems in a step-by-step manner.

There are several implementations that are presented in the development of each data structure. As you solve problems ranging from easy to difficult that address different data structures, you will learn how to select and program various data structures and apply the most suitable algorithms to solve a particular problem.

Solving problems that require different data structures will help you understand the strengths and weaknesses of common data structures and teach you how to choose the right combinations of data structures and algorithms for efficiently solving problems.

  • Introduction to data structures & algorithm involving problem solving, algorithm concept, abstract data types, arrays and linked list.
  • Introduction to stack and queue data structure, its operations and implementation using arrays and linked lists.
  • Analysis of various algorithms, learn how to measure algorithm efficiency, time and space complexity, best, average and worst case analysis.
  • Understand various searching techniques, linear and binary search algorithms, their efficiency analysis and implementation.
  • Introduction to various sorting algorithms – Bubble sort, insertion sort, merge sort, quick sort and heap sort, its implementation and efficiency analysis.
  • Understand various non-linear data structures - Tree. Its real-time applications, implementation, tree traversals and its functionalities. Implementation of Binary Search Tree
  • Understand and learn graph data structure. Different types of graph , their implementation and other operations.
  • Understand various Algorithm Design Strategies.
  • Recursive, Greedy, Dive and Conquer and Dynamic Programming

Josephine Simi N.A., Sripriya S, Abin K Abraham and Senthil Kumar P

  • united states

Related Courses

Data structure and algorithms using java, data structures and algorithms, data structures and algorithms in python, data structures and algorithms in javascript, introduction to java programming: fundamental data structures and algorithms, related articles, 10 best c++ courses for 2024: a lang for the modern age, 100 top free edx courses of all time, massive list of mooc-based microcredentials.

4.5 rating at edX based on 8 ratings

Select rating

Start your review of Data Structures & Algorithms Using C++

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

DSA Tutorial

Linked lists, stacks & queues, hash tables, shortest path, minimum spanning tree, maximum flow, time complexity, dsa reference, dsa examples, learn data structures and algorithms.

Data Structures and Algorithms (DSA) is a fundamental part of Computer Science that teaches you how to think and solve complex problems systematically.

Using the right data structure and algorithm makes your program run faster, especially when working with lots of data.

Knowing DSA can help you perform better in job interviews and land great jobs in tech companies.

This Tutorial

This tutorial is made to help you learn Data Structures and Algorithms (DSA) fast and easy.

Animations, like the one below, are used to explain ideas along the way.

Delay: {{ delay }}

{{ resultText }}: {{ currVal }}

First, you will learn the fundamentals of DSA: understanding different data structures, basic algorithm concepts, and how they are used in programming.

Then, you will learn more about complex data structures like trees and graphs, study advanced sorting and searching algorithms, explore concepts like time complexity, and more.

This tutorial will give you a solid foundation in Data Structures and Algorithms, an essential skill for any software developer.

Try it Yourself Examples in Every Chapter

In every chapter, you can edit the examples online, and click on a button to view the result.

The code examples in this tutorial are written in Python, C, and Java. You can see this by clicking the "Run Example" button.

Advertisement

What You Should Already Know

Although Data Structures and Algorithms is actually not specific to any programming language, you should have a basic understanding of programming in one of these common programming languages:

DSA History

The word 'algorithm' comes from 'al-Khwarizmi', named after a Persian scholar who lived around year 800.

The concept of algorithmic problem-solving can be traced back to ancient times, long before the invention of computers.

The study of Data Structures and Algorithms really took off with the invention of computers in the 1940s, to efficiently manage and process data.

Today, DSA is a key part of Computer Science education and professional programming, helping us to create faster and more powerful software.

DSA Exercises

Test yourself with exercises.

What does DSA stand for?

Start the Exercise

Learn by taking a quiz! The quiz will give you a signal of how much you know about Data Structures and Algorithms.

Start DSA Quiz

My Learning

Track your progress with the free "My Learning" program here at W3Schools.

Log in to your account, and start earning points!

This is an optional feature. You can study at W3Schools without using My Learning.

Track your progress with at W3Schools.com

Learn by Examples

Learn by examples! This tutorial supplements all explanations with clarifying examples.

See All DSA Examples

Get Certified

COLOR PICKER

colorpicker

Contact Sales

If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail: [email protected]

Report Error

If you want to report an error, or if you want to make a suggestion, send us an e-mail: [email protected]

Top Tutorials

Top references, top examples, get certified.

facebook-oauth

Manage Cookies

Home / 

Academy / 

Data Structures And Algorithms

Master Data Structures and Algorithms With the Scaler Academy Program

  • Secure product interviews with understanding of crucial data structures and algorithms, and their implementation
  • Build intuition on the inner workings of various DSA, a foundational skill for any top software engineer
  • Clear your concepts and know which data structure to use for the most optimum build

Why Data Structures and Algorithms?

What are data structures, what are the types of data structures.

  • Linear Data structure: If the elements of a data structure result in a sequence or a linear list then it is called a Linear data structure. Every data element is connected to its next and sometimes previous element in a sequential manner. Example - Arrays, Linked Lists, Stacks, Queues, etc.
  • Non-linear Data structure: If the elements of a Data structure result in a way that the traversal of nodes is not done in a sequential manner, then it is a Non-linear data structure. Its elements are not sequentially connected, and every element can attach to another element in multiple ways. Example - Hierarchical data structure like trees.

Why are Data Structures important?

  • A strong grasp of this is of paramount significance if you want to learn how to organize and assemble data and solve real-life problems
  • Almost all product-based companies look at how strong you are at data structures, so it will also help you in your day-to-day work
  • Knowing when to apply the proper data structures is an important step to write efficient code by managing data properly

Key highlights of the Scaler Academy's program

Curriculum is designed to make you a solid engineer.

  • Programming Language Fundamentals
  • Data Structures and Algorithms

LLD and Project Specialisations

System design essentials.

  • Introduction to Java
  • Input Output and Data Types
  • Pattern Problems
  • 1D and 2D Arrays
  • Memory Management
  • Basic OOP for Problem Solving
  • Time and Space Complexity
  • Array Problem Solving Techniques
  • Bit Manipulation
  • Maths for Problem Solving
  • Backtracking
  • Searching(Binary Search)
  • Two Pointers
  • Strings and Pattern Matching
  • Data Structures
  • Linked Lists
  • Queues and Deques
  • Trees and BST
  • Advanced Problem Solving Techniques
  • Dynamic Programming
  • Relational Model
  • Aggregation
  • Transactions
  • HTML, CSS, Javascript
  • Advanced HTML, CSS Case Studies
  • Advanced JS Concepts (OOP and Concurrency) and Popular Interview Questions
  • JS for Web Dev (DOM Manipulation, Event Handling)
  • Design Patterns
  • How Internet Works (TCP, UDP, HTTP, Layering Architecture)
  • Frontend LLD and Machine Coding Case Studies
  • Backend Architecture
  • Capstone Projects
  • Multithreading
  • Adv Lang Concepts and Popular Interview Questions
  • UML Diagrams
  • Schema Design
  • Backend LLD and Machine Coding Case Studies
  • Unit Testing
  • Spring Boot
  • Project Interview Questions (Spring/Hibernate)
  • Capstone Projects (include advance things like implementing Payment API)
  • Introduction to Scale and Scaling Techniques
  • Introduction to Caching Techniques
  • Introduction to SQL and NoSQL Databases
  • Introduction to Event Driven Architecture
  • Introduction to Microservice Architecture
  • Consistent Hashing
  • CAP Theorem
  • Distributed Systems & Databases
  • SQL and NoSQL
  • Scalability
  • Zookeeper + Kafka
  • Location Based Services (S3, Quad Trees)
  • Microservices
  • Case Studies
  • Building efficient Data Processing Systems
  • Advanced SQL
  • Cloud Services - AWS, or GCP
  • Developing ETL pipelines
  • Map-Reduce Framework
  • Data Warehousing & Modelling
  • OLAP, Dashboarding
  • Workflow Orchestration
  • Logging, and Monitoring
  • MapReduce, HiveQL, Presto
  • Combinatorics and Probability
  • Matrix exponentiation
  • Advanced Trees: Segment Tree, k-D Tree
  • Disjoint Set Union
  • Advanced Dynamic Programming
  • Advanced Graphs: Bridges, Articulation point, Network Flow
  • Introduction to Product Management
  • Product Thinking & Product Discovery
  • Product Roadmap & Prioritization
  • Mental Models for Product Managers
  • Product Analytics
  • Hands-on case study & Mixpanel session
  • Delivery & Project Management
  • Practical ways to apply PM lessons as an Engineer

DSA: Introduction to Problem Solving

Dsa: data structures and algorithms, capstone project.

  • Introduction to Problem Solving
  • Introduction to Time Complexity Analysis
  • Introduction to Basic Data Structures (1D and 2D Arrays, Strings, Hashmaps, Linked Lists, Trees)
  • Introduction to Maths Problem Solving Patterns (Modular Arithmetic, Powers)
  • Introduction to Bit Manipulation
  • Introduction to Problem Solving Techniques (Prefix, Sliding Windows, Subarrays, Subsets, Subsequences, Sorting, Hashing, Recursion)
  • Basic OOP For Problem Solving
  • Frontend Design Patterns
  • Backend Design
  • System Design (HLD)

Career Services

Gain confidence in data structure concepts , taught by experienced instructors.

dsa problem solving course

  • Co-founder of Scaler Academy and two-time ACM ICPC world finalist.
  • Was one of the founding team members of Facebook Messenger and worked directly with Mark Zuckerberg on product development.
  • Responsible for setting up Facebook's London office, the first Facebook Engineering office outside of the USA

dsa problem solving course

  • Built the infra to ingest data at 1 Tb/s at Nutanix
  • Built the backend system for Hotstar that now handles 28M concurrent visitors and streams the IPL

dsa problem solving course

  • Ex-Snapdeal
  • As part of a 2 member SDE team at Snapdeal, managed the entire codebase of Snapdeal Seller Search services, helped Snapdeal move from highest available AWS model to the lowest within 4 months

dsa problem solving course

  • Ex-Media.net
  • As Team Lead at Media.net, built the contextual ad-serving systems to handle 7M+ URLs/day, process 12M+ ad keywords
  • Built ML systems that facilitated INR 10+ Cr. of annual revenue

dsa problem solving course

  • As employee #4 at Fab.com (NYC based ecommerce startup), scaled the company to unicorn status and architected the entire front-end, building a 300+ engineering team

dsa problem solving course

  • Ex-Facebook
  • As a Software engineer at Facebook US, co-created & scaled the 'Nearby Friends' features to 10M DAU
  • Co-founded TownRush and successfully exited to Grofers in 2015 via acquisition

dsa problem solving course

  • As a Platform Engineer at Media.net, scaled low latency systems with millions of queries per second
  • 16+ years of coding experience across a variety of programming languages & paradigms. Has a keen eye for - good coding practices.

dsa problem solving course

  • Ex-Sapient, Directi
  • Now front-end lead at IB & Scaler, he understands both service and product-based company environments
  • Has developed the entire full-stack curriculum at Scaler and leads all full-stack engineering classes
  • 2000+ students have rated him on average 4.5 out of 5

dsa problem solving course

  • Ex-Google, Germany
  • One of the highest rated coders from India - 2300 rating (6 stars) on Codechef and 2140 rating ('Master') on Codeforces
  • Ranked #1 in India in Google HashCode 2019
  • Only 1 of 9 programmers globally to have cleared the Expert Level of Codechef's 'Certified Data Structures and Algorithms Programme' (CCDSAP)
  • Worked in the 'Privacy and Data Protection Office' as a Software Engineer in Google Munich, Germany

dsa problem solving course

  • Ex-Urban Piper
  • Intial member of Urban Piper who built a scalable product to support multiple number of clients.
  • Now tech lead of multiple products at Scaler Academy
  • Active contributor in open source projects

dsa problem solving course

  • Qualified for ACM ICPC Amritapuri onsite-regionals 3 times in a row
  • Started the coding culture at IIT Jammu, conducted workshops, mentored junior students and assisted as a TA in programming courses
  • As an open source contributor, contributed to Github repositories with more than 300 stars

Take the informed leap in your career with guidance and interview prep from our mentors

dsa problem solving course

  • Currently a Senior Software Engineer at Microsoft IDC
  • Total work experience of 7+ years across Xerox and GlobalLogic
  • His expertise ranges from data structures to system design, JAVA, AWS, Kafka and Android to name a few
  • His mentees admire his timely feedback and the fact that he frequently checks up on them

dsa problem solving course

  • Currently an SDE at Amazon, London and previously at Microsoft IDC and Media.net
  • Skilled in languages like Java, Python, AngularJS, React.js
  • Some of her mentees have been placed in Amazon, Walmart and PlayGames.

dsa problem solving course

  • Currently with the Expedia Group and was earlier at Snapdeal and Wydr
  • Skilled in various technical concepts like DSA, artificial intelligence & neural networks, DBMS, core java and is also a data processing specialist
  • Some of his mentees have cracked jobs at OLX, ROIIM, and Lido Learning.
  • He has a unique superpower of being able to empathise with mentees and give constructive feedback

dsa problem solving course

  • Senior Software Engineer at Intuit, with 7+ years of work experience
  • Well versed with data Structures and algorithms, design algorithms, core java and mobile engineering as well
  • Awarded the Bravo Award for outstanding performance in her career

dsa problem solving course

  • Career spans from Cisco and Wipro to Inmobi, Apple and now Adobe and hence can related with software engineers of varied backgrounds
  • Currently a Tech Lead at Adobe, he is proficient with both development technologies like Java and Linux to distributed and cloud technologies.
  • His mentees have done well. One has joined Microsoft, and two others are due to join Dehlivery and Salesken soon. His mentees have praised him as an Excellent interviewer who nudges them to give their best

dsa problem solving course

  • Currently an Engineering Manager at ClearTax, he has also worked at Amazon and PayTM
  • Well versed in advanced DBMS, computer networks and network security
  • Some of his mentees are placed at startups like Playgames and LendingKart

dsa problem solving course

  • Currently a Senior Data Engineer with Myntra, with past experience with AIG and MiQ Digital.
  • As a part of the data engineering team, he has worked on some remarkable python-based web services.
  • His proficiency in technical concepts includes Pyspark, AWS, Python, Kafka, Android, and more.
  • Some of his mentees have joined Nova (part of Flock) and Microsoft.

Our success lies in our learners success stories Read the reviews by Scaler Alumni on how Scaler Academy Program has helped them become solid Data structures and Algorithms Experts

Tuition fee.

  • Get up to INR 25,000 as scholarship basis your performance in the 30 minutes entrance test! If you secure the scholarship and also opt for EMI payment, then you can pay as little as ₹9,811 per month to sign up for Scaler Academy!

Frequently Asked Questions

Why are data structures important for coding interviews, what are the applications of data structure and algorithms, what is the best coding language to learn data structures, how to master data structures and algorithms, what does scaler's data structures and algorithms course cover, why should you take scaler's data structures and algorithms course, is data structures and algorithms course difficult to learn, who should take this data structures and algorithms course, is a certificate provided at the end of the course, what if i miss a lecture during the course, change country/region.

  • Scaler Academy
  • Scaler DevOps
  • Scaler Data Science & ML
  • Scaler School of Technology
  • Scaler School of Business
  • Scaler Neovarsity
  • Become a Mentor
  • Become a TA
  • Become a Career Coach
  • Join Our Discord
  • Terms of Use
  • Privacy Policy
  • Reviews on Quora

Navigation Menu

Search code, repositories, users, issues, pull requests..., provide feedback.

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly.

To see all available qualifiers, see our documentation .

  • Notifications You must be signed in to change notification settings

100 DSA Problems and solutions from leetcode

SohanR/100-DSA-Interview-Problems

Folders and files.

NameName
2 Commits

Repository files navigation

Dsa 100 challenge.

100 DSA interview problems with solutions

dsa problem solving course

Introduction

This repository is your go-to resource for mastering Data Structures and Algorithms. I have curated a list of the top 100 DSA problems from LeetCode, covering a wide array of topics such as Array, String, Linked List, Graph, Dynamic Programming, Tree, Stack and Queue, and Miscellaneous. These problems are carefully selected to provide a comprehensive understanding of essential DSA concepts.

Problem Categories

  • Linked List
  • Dynamic Programming
  • Stack and Queue
Array Problem LeetCode Link Difficulty Level Solution
1 Check if pair with the given Sum exists in Array Easy
2 Best Time to Buy and Sell Stock Easy
3 Find duplicates Medium
4 Product of Array Except Self Medium
5 Maximum Subarray Easy
6 Maximum Product Subarray Medium
7 Find Minimum in Rotated Sorted Array Medium
8 Search in Rotated Sorted Array Medium
9 3 Sum Medium
10 Container With Most Water Medium
11 Find the Factorial of a large number Medium
12 Trapping Rain Water Hard
13 Chocolate Distribution Problem Medium
14 Insert Interval Hard
15 Merge Intervals Medium
16 Non-overlapping Intervals Medium
17 Set Matrix Zeroes Medium
18 Spiral Matrix Medium
String Problem LeetCode Link Difficulty Level Solution
1 Longest Substring Without Repeating Characters Medium
2 Longest Repeating Character Replacement Medium
3 Smallest window in a String containing all characters of other String Hard
4 Check whether two Strings are anagram of each other Easy
5 Print all anagrams together Medium
Linked List Problem LeetCode Link Difficulty Level Solution
1 Reverse a Linked List Easy
2 Detect Cycle in a Linked List Medium
3 Merge Two Sorted Lists Easy
4 Merge K Sorted Lists Hard
5 Remove Nth Node From End Of List Medium
6 Reorder List Medium
7 Add 1 to a number represented as linked list Medium
8 Find the middle of a given linked list Easy
9 Delete last occurrence of an item from linked list Easy
Stack and Queue Problem LeetCode Link Difficulty Level Solution
1 Check if given Parentheses expression is balanced or not Easy
2 Delete middle element of a stack Medium
Tree and Graph Problem LeetCode Link Difficulty Level Solution
1 Invert/Flip Binary Tree Easy
2 Binary Tree Maximum Path Sum Hard
3 Binary Tree Level Order Traversal Medium
4 Serialize and Deserialize Binary Tree Hard
5 Subtree of Another Tree Easy
6 Construct Binary Tree from Preorder and Inorder Traversal Medium
7 Validate Binary Search Tree Medium
8 Kth Smallest Element in a BST Medium
9 Lowest Common Ancestor of BST Easy
10 Implement Trie (Prefix Tree) Medium
11 Add and Search Word Medium
Dynamic Programming Problem LeetCode Link Difficulty Level Solution
1 Coin Change Medium
2 0/1 Knapsack Problem Medium
3 Longest Increasing Subsequence Medium
4 Longest Common Subsequence Medium
5 Word Break Problem Medium
6 Dice Throw Medium
7 Egg Dropping Puzzle Hard
8 Matrix Chain Multiplication Medium
9 Combination Sum Medium
10 Subset Sum Problem Medium
11 Find maximum possible stolen value from houses Medium
12 Count Possible Decodings of a given Digit Sequence Medium
13 Unique paths in a Grid with Obstacles Medium
14 Jump Game Medium
15 Cutting a Rod Medium
16 Maximum Product Cutting Medium
17 Count number of ways to cover a distance Easy
18 Number of 1 Bits Easy
19 Counting Bits Medium
20 Missing Number Easy
21 Reverse Bits Easy
22 Find XOR of all subsets of a set Medium
Graph Problem LeetCode Link Difficulty Level Solution
1 Detect Cycle in a Directed Graph Medium
2 Bridges in a graph Hard
3 Check whether a given graph is Bipartite or not Medium
4 Strongly Connected Components Hard
5 Topological Sorting Medium
Miscellaneous Problem LeetCode Link Difficulty Level Solution
1 Sentence Palindrome Easy
2 Palindromic Substrings Medium
3 Longest Common Prefix Easy
4 Print Right View of a Binary Tree Medium
5 Find the first circular tour that visits all petrol pumps Medium
6 Length of the longest valid substring Hard
7 Find the XOR of all subsets of a set Medium
8 Detect Cycle in a Directed Graph Medium
9 Bridges in a graph Medium
10 Check whether a given graph is Bipartite or not Medium
12 Find size of the largest region in Boolean Matrix Medium
13 Flood fill Algorithm Medium
14 Strongly Connected Components Medium
15 Topological Sorting Medium
16 Count ways to reach the n’th stair Easy
17 Coin Change Medium
18 0/1 Knapsack Problem Medium
19 Longest Increasing Subsequence Medium

enjoyalgorithms

EnjoyMathematics

Problem-Solving Approaches in Data Structures and Algorithms

This blog highlights some popular problem-solving strategies for solving problems in DSA. Learning to apply these strategies could be one of the best milestones for the learners in mastering data structure and algorithms.

Top 10 problem solving techniques in data structures and algorithms

An Incremental approach using Single and Nested loops

One of the simple ideas of our daily problem-solving activities is that we build the partial solution step by step using a loop. There is a different variation to it:

  • Input-centric strategy: At each iteration step, we process one input and build the partial solution.
  • Output-centric strategy: At each iteration step, we add one output to the solution and build the partial solution.
  • Iterative improvement strategy: Here, we start with some easily available approximations of a solution and continuously improve upon it to reach the final solution.

Here are some approaches based on loop: Using a single loop and variables, Using nested loops and variables, Incrementing the loop by a constant (more than 1), Using the loop twice (Double traversal), Using a single loop and prefix array (or extra memory), etc.

Example problems:   Insertion Sort ,  Finding max and min in an array ,  Valid mountain array ,  Find equilibrium index of an array ,  Dutch national flag problem ,  Sort an array in a waveform .

Decrease and Conquer Approach

This strategy is based on finding the solution to a given problem via its one sub-problem solution. Such an approach leads naturally to a recursive algorithm, which reduces the problem to a sequence of smaller input sizes. Until it becomes small enough to be solved, i.e., it reaches the recursion’s base case.

Example problems:   Euclid algorithm of finding GCD ,  Binary Search ,  Josephus problem

Problem-solving using Binary Search

When an array has some order property similar to the sorted array, we can use the binary search idea to solve several searching problems efficiently in O(logn) time complexity. For doing this, we need to modify the standard binary search algorithm based on the conditions given in the problem. The core idea is simple: calculate the mid-index and iterate over the left or right half of the array.

Problem-solving using binary search visualization

Example problems: Find Peak Element , Search a sorted 2D matrix , Find the square root of an integer , Search in Rotated Sorted Array

Divide and Conquer Approach

This strategy is about dividing a problem into  more than one subproblems,  solving each of them, and then, if necessary, combining their solutions to get a solution to the original problem. We solve many fundamental problems efficiently in computer science by using this strategy.

Divide and conquer approach visualization

Example problems:   Merge Sort ,  Quick Sort ,  Median of two sorted arrays

Two Pointers Approach

The two-pointer approach helps us optimize time and space complexity in the case of many searching problems on arrays and linked lists. Here pointers can be pairs of array indices or pointer references to an object. This approach aims to simultaneously iterate over two different input parts to perform fewer operations. There are three variations of this approach:

Pointers are moving in the same direction with the same pace:   Merging two sorted arrays or linked lists, Finding the intersection of two arrays or linked lists , Checking an array is a subset of another array , etc.

Pointers are moving in the same direction at a different pace (Fast and slow pointers):   Partition process in the quick sort , Remove duplicates from the sorted array , Find the middle node in a linked list , Detect loop in a linked list , Move all zeroes to the end , Remove nth node from list end , etc.

Pointers are moving in the opposite direction:  Reversing an array, Check pair sum in an array , Finding triplet with zero-sum , Rainwater trapping problem , Container with most water , etc.

Two pointers approach visualization

Sliding Window Approach

A sliding window concept is commonly used in solving array/string problems. Here, the window is a contiguous sequence of elements defined by the start and ends indices. We perform some operations on elements within the window and “slide” it in a forward direction by incrementing the left or right end.

This approach can be effective whenever the problem consists of tasks that must be performed on a contiguous block of a fixed or variable size. This could help us improve time complexity in so many problems by converting the nested loop solution into a single loop solution.

Example problems: Longest substring without repeating characters , Count distinct elements in every window , Max continuous series of 1s , Find max consecutive 1's in an array , etc.

Transform and Conquer Approach

This approach is based on transforming a coding problem into another coding problem with some particular property that makes the problem easier to solve. In other words, here we solve the problem is solved in two stages:

  • Transformation stage: We transform the original problem into another easier problem to solve.
  • Conquering stage: Now, we solve the transformed problem.

Example problems: Pre-sorting based algorithms (Finding the closest pair of points, checking whether all the elements in a given array are distinct, etc.)

Problem-solving using BFS and DFS Traversal

Most tree and graph problems can be solved using DFS and BFS traversal. If the problem is to search for something closer to the root (or source node), we can prefer BFS, and if we need to search for something in-depth, we can choose DFS.

Sometimes, we can use both BFS and DFS traversals when node order is not required. But in some cases, such things are not possible. We need to identify the use case of both traversals to solve the problems efficiently. For example, in binary tree problems:

  • We use preorder traversal in a situation when we need to explore all the tree nodes before inspecting any leaves.
  • Inorder traversal of BST generates the node's data in increasing order. So we can use inorder to solve several BST problems.
  • We can use postorder traversal when we need to explore all the leaf nodes before inspecting any internal nodes.
  • Sometimes, we need some specific information about some level. In this situation, BFS traversal helps us to find the output easily.

BFS and DFS traversal visualization

To solve tree and graph problems, sometimes we pass extra variables or pointers to the function parameters, use helper functions, use parent pointers, store some additional data inside the node, and use data structures like the stack, queue, and priority queue, etc.

Example problems: Find min depth of a binary tree , Merge two binary trees , Find the height of a binary tree , Find the absolute minimum difference in a BST , The kth largest element in a BST , Course scheduling problem , bipartite graph , Find the left view of a binary tree , etc.

Problem-solving using the Data Structures

The data structure is one of the powerful tools of problem-solving in algorithms. It helps us perform some of the critical operations efficiently and improves the time complexity of the solution. Here are some of the key insights:

  • Many coding problems require an effcient way to perform the search, insert and delete operations. We can perform all these operations using the hash table in O(1) time average. It's a kind of time-memory tradeoff, where we use extra space to store elements in the hash table to improve performance.
  • Sometimes we need to store data in the stack (LIFO order) or queue (FIFO order) to solve several coding problems. 
  • Suppose there is a requirement to continuously insert or remove maximum or minimum element (Or element with min or max priority). In that case, we can use a heap (or priority queue) to solve the problem efficiently.
  • Sometimes, we store data in Trie, AVL Tree, Segment Tree, etc., to perform some critical operations efficiently. 

Various types of data structures in programming

Example problems: Next greater element , Valid Parentheses , Largest rectangle in a histogram , Sliding window maximum , kth smallest element in an array , Top k frequent elements , Longest common prefix , Range sum query , Longest consecutive sequence , Check equal array , LFU cache , LRU cache , Counting sort

Dynamic Programming

Dynamic programming is one of the most popular techniques for solving problems with overlapping or repeated subproblems. Here rather than solving overlapping subproblems repeatedly, we solve each smaller subproblems only once and store the results in memory. We can solve a lot of optimization and counting problems using the idea of dynamic programming.

Dynamic programming idea

Example problems: Finding nth Fibonacci,  Longest Common Subsequence ,  Climbing Stairs Problem ,  Maximum Subarray Sum ,  Minimum number of Jumps to reach End ,  Minimum Coin Change

Greedy Approach

This solves an optimization problem by expanding a partially constructed solution until a complete solution is reached. We take a greedy choice at each step and add it to the partially constructed solution. This idea produces the optimal global solution without violating the problem’s constraints.

  • The greedy choice is the best alternative available at each step is made in the hope that a sequence of locally optimal choices will yield a (globally) optimal solution to the entire problem.
  • This approach works in some cases but fails in others. Usually, it is not difficult to design a greedy algorithm itself, but a more difficult task is to prove that it produces an optimal solution.

Example problems: Fractional Knapsack, Dijkstra algorithm, The activity selection problem

Exhaustive Search

This strategy explores all possibilities of solutions until a solution to the problem is found. Therefore, problems are rarely offered to a person to solve the problem using this strategy.

The most important limitation of exhaustive search is its inefficiency. As a rule, the number of solution candidates that need to be processed grows at least exponentially with the problem size, making the approach inappropriate not only for a human but often for a computer as well.

But in some situations, there is a need to explore all possible solution spaces in a coding problem. For example: Find all permutations of a string , Print all subsets , etc.

Backtracking

Backtracking is an improvement over the approach of exhaustive search. It is a method for generating a solution by avoiding unnecessary possibilities of the solutions! The main idea is to build a solution one piece at a time and evaluate each partial solution as follows:

  • If a partial solution can be developed further without violating the problem’s constraints, it is done by taking the first remaining valid option at the next stage. ( Think! )
  • Suppose there is no valid option at the next stage, i.e., If there is a violation of the problem constraint, the algorithm backtracks to replace the partial solution’s previous stage with the following option for that stage. ( Think! )

Backtracking solution of 4-queen problem

In simple words, backtracking involves undoing several wrong choices — the smaller this number, the faster the algorithm finds a solution. In the worst-case scenario, a backtracking algorithm may end up generating all the solutions as an exhaustive search, but this rarely happens!

Example problems: N-queen problem , Find all k combinations , Combination sum , Sudoku solver , etc.

Problem-solving using Bit manipulation and Numbers theory

Some of the coding problems are, by default, mathematical, but sometimes we need to identify the hidden mathematical properties inside the problem. So the idea of number theory and bit manipulation is helpful in so many cases.

Sometimes understanding the bit pattern of the input and processing data at the bit level help us design an efficient solution. The best part is that the computer performs each bit-wise operation in constant time. Even sometimes, bit manipulation can reduce the requirement of extra loops and improve the performance by a considerable margin.

Example problems: Reverse bits , Add binary string , Check the power of two , Find the missing number , etc.

Hope you enjoyed the blog. Later we will write a separate blog on each problem-solving approach. Enjoy learning, Enjoy algorithms!

More from EnjoyAlgorithms

Self-paced courses and blogs.

  • DSA Tutorial
  • Data Structures
  • Linked List
  • Dynamic Programming
  • Binary Tree
  • Binary Search Tree
  • Divide & Conquer
  • Mathematical
  • Backtracking
  • Branch and Bound
  • Pattern Searching

Basic Coding Problems in DSA for Beginners

For any beginner looking to strengthen their skills in Data structures and algorithms (DSA) , we have brought to you a collection of basic coding problems . These carefully selected problems will provide a solid foundation in fundamental concepts, helping beginners enhance their logical thinking and problem-solving abilities.

BAsic-Coding-Problem-DSA--2

  • Basic Coding Problems

Below is the list of Basic Coding Problems designed for Beginners:

Basic Coding Problems

Please Login to comment...

Similar reads.

  • OpenAI o1 AI Model Launched: Explore o1-Preview, o1-Mini, Pricing & Comparison
  • How to Merge Cells in Google Sheets: Step by Step Guide
  • How to Lock Cells in Google Sheets : Step by Step Guide
  • PS5 Pro Launched: Controller, Price, Specs & Features, How to Pre-Order, and More
  • #geekstreak2024 – 21 Days POTD Challenge Powered By Deutsche Bank

Improve your Coding Skills with Practice

 alt=

What kind of Experience do you want to share?

IMAGES

  1. GradsKey Course: DSA Problem solving with C/C++

    dsa problem solving course

  2. dsa problem solving course

    dsa problem solving course

  3. Lecture

    dsa problem solving course

  4. Coding Interview Course

    dsa problem solving course

  5. Problem Solving on Sorting Algorithms-1

    dsa problem solving course

  6. Enhance your problem solving ability using DSA

    dsa problem solving course

VIDEO

  1. DSA Live Course

  2. C++ & Problem Solving Course

  3. ## ADVANCED LEVEL QUESTIONS PROBLEMS SOLVING CONTINUED PART 5

  4. ## ADVANCED LEVEL QUESTIONS PROBLEMS SOLVING

  5. DSA Problem Solving LeetCode DAY-02

  6. DSA Problem Solving LeetCode DAY-01

COMMENTS

  1. Data Structures and Algorithms

    The online DSA course will cover key algorithms, teaching you how to sort data efficiently, search for elements quickly, and use hashing for faster data retrieval. By the end of the course, youll have a solid understanding of data structures and algorithms, which are crucial for solving complex coding problems and clearing technical interviews ...

  2. 10 Best Data Structures and Algorithms Courses [2024]

    The next course to learn and master DSA is Data Structures and Algorithms in Java by the University of California San Diego. This course helps you in solving computational problems. Using the programming assignments offered in this course, you'll learn to implement those in various programming languages.

  3. Complete DSA Course

    Master the foundations of DSA, developing problem-solving techniques to excel in coding interviews and real-world applications. Delve into key concepts such ...

  4. Solve Data Structures

    Easy Problem Solving (Basic) Max Score: 20 Success Rate: 91.47%. Solve Challenge. Sparse Arrays. Medium Problem Solving (Basic) Max Score: 25 Success Rate: 97.28%. Solve Challenge. Array Manipulation. Hard Problem Solving (Intermediate) Max Score: 60 Success Rate: 61.73%. Solve Challenge. Print the Elements of a Linked List.

  5. 15 Best Data Structures and Algorithms Courses [2024]

    Best Data Structures and Algorithms Courses (2024) 1. Scaler Academy's Data Structure and Algorithm Course. Scaler's DSA Course. Scaler Academy by InterviewBit offers a thoughtfully designed curriculum to make you understand the toughest of DSA concepts easily. Courses are available for all levels-beginners, intermediate, and expert.

  6. Learn Data Structures and Algorithms

    Learn Data Structures and Algorithms. Data Structures and Algorithms (DSA) is an essential skill for any programmer looking to solve problems efficiently. Understanding and utilizing DSA is especially important when optimization is crucial, like in game development, live video apps, and other areas where even a one-second delay can impact ...

  7. C++ with Beginner DSA

    Learn core C++ programming concepts with a focus on problem-solving and data structures. Practice your C++ programming by applying it to 500+ handpicked data structures and algorithms-based coding problems. ... Learn Problem solving 7 courses Reach 1* on CodeChef 16 weeks to complete ... Applying time complexity to DSA problems. Log and Square ...

  8. Learn Data Structures and Algorithms

    Applying time complexity to DSA problems. Log and Square root time complexity. Practice problems. ... used for solving hard problems. You can learn these as well. Disjoint Set Union. ... Yes, each course in the roadmap includes practice problems to reinforce your learning. There are over 470 problems in total across all courses.

  9. Data Structures & Algorithms Using C++

    Understanding various data structures and algorithms is the foundation of modern programming. In this self-paced course you will learn about the characteristics of commonly used data structures and algorithms and how to implement them to be able to conduct efficiency analyses in C++ from scratch. To solve real-world problems efficiently ...

  10. Data Structures

    Renaissance course is a complete interview preparation course, which includes DSA, CS Fundamentals and System Design, with over 350+ hours of lectures and 600+ handpicked problems. DSA Essentials is a more concise course with 100+ handpicked and curated lectures and problems for someone who has less time to prepare for interviews.

  11. DSA Tutorial

    Data Structures and Algorithms (DSA) is a fundamental part of Computer Science that teaches you how to think and solve complex problems systematically. Using the right data structure and algorithm makes your program run faster, especially when working with lots of data. Knowing DSA can help you perform better in job interviews and land great ...

  12. Data structures and Algorithms Course

    DSA: Introduction to Problem Solving. 2 Months. Module - 2. DSA: Data Structures and Algorithms. 4 Months. Module - 3. SQL. 0.5 Month. ... Introduction to Problem Solving Techniques (Prefix, Sliding Windows, Subarrays, Subsets, Subsequences, Sorting, Hashing, Recursion) ... Try the course for the first 2 weeks - full money-back guarantee if you ...

  13. Learn Data Structures and Algorithms

    Data Structures and Algorithms (DSA) refer to the study of methods for organizing and storing data and the design of procedures (algorithms) for solving problems, which operate on these data structures. 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 ...

  14. Guide to Master DSA and Crack the Coding Interview

    16-Week learning and coding interview preparation plan. This is recommended for intermediate learners who want to learn DSA concepts and sharpen problem-solving skills. Such learners should have a basic understanding of programming concepts. Minimum estimated time = 10 x 16 = 160 hours.

  15. DSA Interview Courses

    DSA Interview Course. A free self-paced DSA course for students and professionals who want to learn data structures and algorithms concepts, master problem-solving approaches, and crack the coding interview. Enjoy learning algorithms!

  16. SohanR/100-DSA-Interview-Problems

    Introduction. This repository is your go-to resource for mastering Data Structures and Algorithms. I have curated a list of the top 100 DSA problems from LeetCode, covering a wide array of topics such as Array, String, Linked List, Graph, Dynamic Programming, Tree, Stack and Queue, and Miscellaneous. These problems are carefully selected to ...

  17. Popular Approaches to Solve Coding Problems in DSA

    Here are some approaches based on loop: Using a single loop and variables, Using nested loops and variables, Incrementing the loop by a constant (more than 1), Using the loop twice (Double traversal), Using a single loop and prefix array (or extra memory), etc. Example problems: Insertion Sort, Finding max and min in an array, Valid mountain ...

  18. Basic Coding Problems in DSA for Beginners

    Basic Coding Problems. Count number of even and odd elements in an array. Average numbers in array. Program to print the given digit in words. Check if a large number is divisible by 6 or not. Check if a number is Palindrome. Program to count vowels in a string. Check if given number is perfect square.