Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Data structure and algorithms using C, C++, Java, JavaScript
Rating: 4.2 out of 5(82 ratings)
3,732 students

Data structure and algorithms using C, C++, Java, JavaScript

Learn DSA in languages C and other languages
Created byData Structure
Last updated 6/2025
English

What you'll learn

  • Introduction to data structures
  • Algorithms
  • Arrays
  • Linked lists
  • Stack
  • Queues
  • Trees
  • Graphs
  • Searching
  • Sorting

Course content

8 sections67 lectures5h 5m total length
  • Welcome to the course0:24
  • Introduction to data structures1:29

    Data structures are fundamental concepts in computer science that allow us to organize and store data effectively so that we can perform operations on them efficiently.

    Imagine you have a bunch of data and you want to store it in such a way that you can easily access, manipulate, and manage it. Data structures provide a way to organize and manage data in a structured manner.

    There are many different types of data structures, each with its own strengths and weaknesses. Some common data structures include:

    1. Arrays

    2. Linked Lists

    3. Stacks

    4. Queues

    5. Trees

    6. Graphs

    7. Hash Tables

    Each of these data structures has its own set of operations that can be performed on it. For example, with an array, you can insert elements, delete elements, and access elements by their index. With a tree, you can perform operations like searching, insertion, and deletion.

    Understanding data structures is essential for writing efficient algorithms and solving complex problems in computer science. They are the building blocks upon which many algorithms and applications are built.

    In the next video we will learn the types of data structures.

  • Quiz
  • Types of data structures6:49

    Types of data structures


    In this video we will learn the types of data structures.


    Data structures can be broadly categorised into two main types:


    And They are.


    • Primitive data structure.

    • Non-primitive data structure.



    Let us first see. What are primitive data structures?


    Primitive data structures are basic data types that serve as the foundation for more complex data structures.


    They are usually directly supported by the programming language and are used to represent simple values.


    The main primitive data types include:

    • Integer:

      • Represents whole numbers (positive or negative) without any fractional part.

      • Examples include int in languages like C, C++, Java, and Python.

    • Floating Point:

      • Represents real numbers with a decimal point.

      • Examples include float and double in languages like C, C++, Java, and Python.

    • Character:

      • Represents individual characters such as letters, digits, and symbols.

      • Examples include char in languages like C, C++, Java, and Python.

    • Boolean:

      • Represents truth values, usually denoted as true or false.

      • Examples include bool in languages like C++, Java, and Python.

    • Pointers:

      • Represents a memory address, i.e., the location of another variable in memory.

      • Commonly found in languages like C and C++.

    • Enumerations (Enums):

      • Represents a set of named integer constants.

      • Provides a way to create named integer values in a program.

    • Void:

      • Represents the absence of a type.

      • Often used in languages like C and C++ as a return type for functions that do not return a value.

    These primitive data types are essential for programming in any language.


    They provide the basic building blocks for creating variables and structures that can be used to implement more complex algorithms.


    Each programming language may have its own set of primitive data types, but the concepts are similar across languages.


    Understanding these basic types is fundamental for writing programs and manipulating data in a computer program.



    Now we know what are primitive data structures, let us understand what are non primitive data structures.


    Non-primitive data structures are more complex data types


    that are composed of or derived from primitive data types.


    These structures allow for more sophisticated organisation and manipulation of data.


    Unlike primitive data types, which are directly supported by the programming language,


    non-primitive data structures are user-defined or abstract data types.


    Abstract data type is a high-level description of a set of operations that can be performed on a data structure.


    Non primitive data structures are further classified into two types.


    Linear and non linear data structures.


    Let’s first see what are linear data structures.


    Linear data structures are arrangements of elements in a sequential order,


    The key characteristic of linear data structures is that the elements are ordered in a linear sequence,


    each element has a unique predecessor and successor, except for the first and last elements.



    Here are some common examples:

    • Arrays

    • Linked lists

    • Stacks

    • Queues

    • Strings


    We will have quick look on these.


    1. Arrays:

    • An ordered collection of elements, each element identified by an index or a key.

    • Elements are stored in contiguous memory locations.

    • Accessing elements is done using their index.

    • Examples include static arrays in languages like C and dynamic arrays in languages like Python.

    2. Linked Lists:

    • A collection of elements, where each element points to the next one.

    • Elements are stored in nodes, and each node contains data and a reference to the next node.

    • Provides dynamic memory allocation and efficient insertion and deletion of elements.

    • Types include singly linked lists, doubly linked lists, and circular linked lists.

    3. Stacks:

    • Follows the Last In, First Out (LIFO) principle.

    • Elements are added and removed from the same end, called the top.

    • Common operations include push (add to the top) and pop (remove from the top).

    • Used in managing function calls, undo mechanisms, and parsing expressions.

    4. Queues:

    • Follows the First In, First Out (FIFO) principle.

    • Elements are added at the rear (enqueue) and removed from the front (dequeue).

    • Common operations include enqueue and dequeue.

    • Used in tasks like managing tasks in a printer queue or handling requests in networking.

    5. Strings:

    • A sequence of characters.

    • Can be implemented using arrays or linked lists.

    • String manipulation is a common operation in programming.

    Linear data structures are fundamental for various algorithms and applications. The choice of a particular linear data structure depends on the requirements of the problem at hand and the operations that need to be performed on the data. Each structure has its strengths and weaknesses in terms of memory usage, access time, and ease of manipulation.


    Now we will discuss about non linear data structures.


    Non-linear data structures do not organise elements in a sequential.


    they allow for more complex relationships among elements, often involving multiple connections or hierarchies.


    Here are some common types of non-linear data structures:

    1. Trees:

    • A hierarchical structure with a root node and branches.

    • Consists of nodes, where each node can have children nodes.

    • Types include binary trees, AVL trees, and B-trees.


    2. Graphs:

    • A collection of nodes (vertices) and edges that connect pairs of nodes.

    • Nodes represent entities, and edges represent relationships between entities.

    • Types include directed graphs, undirected graphs, weighted graphs.

    3. Heaps:

    • Tree-based structures with the heap property.

    • Used for priority queues and implementing heapsort.

    • Types include min heaps and max heaps.


    4. Hash Tables:

    • Uses a hash function to map keys to indexes, facilitating efficient data retrieval.

    • Commonly used for implementing associative arrays or dictionaries.


    Data structures can also be classified as:

    • Static data structure: It is a type of data structure where the size is allocated at the compile time. Therefore, the maximum size is fixed.

    • Dynamic data structure: It is a type of data structure where the size is allocated at the run time. Therefore, the maximum size is flexible.



    In this video we discussed the types of data structures.


    Data structures are mainly classified into two types.


    Primitive data structures and non primitive data structures.


    Primitive data structures are basic data types that serve as the foundation for more complex data structures.


    The main primitive data types include:

    • Integer

    • Floating Point

    • Character

    • Boolean

    • Pointers

    • Enumerations (Enums)

    • Void


    Next we discussed non primitive data structures.


    Non primitive data structures are further classified into two types.


    Linear data structures and non linear data structures.


    In Linear data structures elements are arranged in sequential manner.


    Some common examples are


    • Arrays

    • Linked lists

    • Stacks

    • Queues

    • Strings


    In Non linear data structures are elements are not arranged in a sequential manner.

    Some common examples are

    Trees

    Graphs

    Heaps

    Hash tables.

    In the next video we will discuss about major operations of data structures.

  • Quiz
  • Operation performed on data structures1:41

    In the last video we discussed the types of data structures and in this video we are going to see what are the operations performed on data structures.


    The major operations that can be performed on various data structures are fundamental actions that manipulate or retrieve data. The specific operations vary based on the type of data structure. Here's a general overview:


    • Searching: Searching is a fundamental operation in data structures, and various algorithms are used to find a specific element or determine its presence. The choice of the search algorithm depends on the characteristics of the data structure.


    • Sorting: Sorting is the process of arranging elements in a specific order, typically in ascending or descending order. Various sorting algorithms exist, and the choice of a particular algorithm depends on factors such as the size of the dataset, the presence of pre-sorted elements, and the desired time complexity.


    • Insertion: Insertion is a fundamental operation in data structures, and it involves adding a new element to the existing data structure. The specific steps and considerations for insertion vary depending on the type of data structure.


    • Updation: Updating data in a data structure involves modifying the value of an existing element. The specific steps for updating depend on the type of data structure.


    • Deletion: Deletion in data structures involves removing an element from the data structure. The specific steps for deletion depend on the type of data structure.


    In this video we came across the operations that can be performed on data structures.


    And they are


    Searching

    Sorting

    Insertion

    Updation

    Deletion


    In the upcoming chapters you will learn about these operation in depth.


    So in the next video we will discuss about the advantages of data structures.

  • Quiz
  • Advantages of data structures4:09

    In the last video we discussed the major operations performed on data structures.


    And in this video we will be discussing about the advantages of data structures.


    Data structures offer several advantages in computer science and programming. Here are some key advantages:


    1. Efficient Data Organisation:

    • Data structures enable the efficient organisation and storage of data, allowing for quick access and retrieval of information.



    2. Optimised Data Retrieval:

    • Different data structures are designed for specific operations, leading to optimised retrieval and search times. For example, hash tables provide constant-time average retrieval.

    3. Memory Utilisation:

    • Data structures help in effective memory utilisation. They allow for the allocation and deallocation of memory as needed, reducing wastage.

    4. Algorithm Efficiency:

    • The choice of the right data structure can significantly impact the efficiency of algorithms. For instance, sorting algorithms can perform differently based on the data structure used.

    5. Code Reusability:

    • Well-defined data structures promote code reusability. Once implemented, they can be used across different projects and scenarios, saving development time.

    6. Abstraction and Encapsulation:

    • Data structures provide abstraction, allowing programmers to focus on high-level concepts without worrying about low-level details. This simplifies problem-solving and code maintenance.

    7. Ease of Maintenance:

    • Organised and well-structured data makes the code easier to maintain and understand. Debugging and modifications become more straightforward with clear data structures.

    8. Facilitates Modularity:

    • Data structures support the creation of modular programs. Modules or components can be developed independently, promoting a modular and scalable software design.

    9. Improved Scalability:

    • Properly chosen data structures contribute to scalable solutions. As the volume of data increases, efficient data structures can handle larger datasets without a significant increase in processing time.

    10. Supports Multiple Operations:

    - Data structures are designed to support various operations efficiently. For example, stacks are excellent for managing function calls, while hash tables excel at key-value pair storage and retrieval.

    11. Enhanced Problem Solving:


    - Data structures provide a systematic way to organise and manipulate data, enhancing the ability to solve complex problems and design efficient algorithms.

    12. Concurrency and Parallelism:

    - Certain data structures are designed to handle concurrent access by multiple threads or processes. They provide mechanisms for synchronisation and data consistency in parallel computing.


    13. Enhances Performance:

    - The use of appropriate data structures contributes to overall system performance by reducing the time complexity of operations, resulting in faster and more responsive applications.


    14. Supports Dynamic Memory Allocation:

    - Data structures facilitate dynamic memory allocation, allowing the allocation and deallocation of memory during program execution, which is crucial for managing variable-sized data.


    In summary, data structures play a crucial role in organizing, storing, and manipulating data efficiently, leading to improved algorithm performance, code reusability, and easier maintenance. They are fundamental to effective problem-solving in computer science and software development.

  • Test your knowledge
  • Basic terminology used in data structures4:14


    Basic terminology


    Understanding the basic terminology related to data structures is essential for effective communication and comprehension in computer science.


    Here are some fundamental terms:


    1. Data Structure

    • A way of organising and storing data to perform operations efficiently.


    2. Element

    • A single unit of data, the smallest identifiable piece of data in a data structure.


    3. Node

    • An individual element in a linked data structure, such as a linked list or tree.


    4. Head

    • The first node in a linked list.


    5. Tail

    • The last node in a linked list.


    6. Root

    • The topmost node in a tree data structure.


    7. Parent

    • A node in a tree that has one or more child nodes.


    8. Child

    • A node in a tree that has a parent node.


    9. Sibling

    • Nodes in a tree that share the same parent.


    10. Leaf

    - A node in a tree that has no children.


    11. Level

    - The depth or distance of a node from the root in a tree.


    12. Depth

    - The level of a node in a tree.


    13. Height

    - The length of the longest path from a node to a leaf in a tree.


    14. Edge

    - A connection between nodes in a graph.


    15. Graph

    - A collection of nodes connected by edges.


    16. Vertex

    - A node in a graph.


    17. Directed Graph:

    - A graph where edges have a direction.


    18. Undirected Graph:

    - A graph where edges do not have a direction.


    19. Weighted Graph:

    - A graph where edges have weights or costs.


    20. Adjacency:

    - The relationship between two connected nodes in a graph.


    21. Array:

    - A collection of elements stored in contiguous memory locations.


    22. Linked List:

    - A linear collection of elements where each element points to the next one.


    23. Stack:

    - A data structure that follows the Last In, First Out (LIFO) principle.


    24. Queue:

    - A data structure that follows the First In, First Out (FIFO) principle.


    25. Hash Table:

    - A data structure that allows efficient insertion, deletion, and retrieval of data.


    26. Binary Tree:

    - A tree data structure where each node has at most two children.


    27. Binary Search Tree (BST):

    - A binary tree with the property that the left subtree of a node contains only nodes with keys less than the node's key, and the right subtree contains only nodes with keys greater than the node's key.


    28. Algorithm:

    - A step-by-step procedure or formula for solving a problem.


    29. Time Complexity:

    - A measure of the amount of time an algorithm takes to complete as a function of the size of the input.


    30. Space Complexity:

    - A measure of the amount of memory an algorithm uses as a function of the size of the input.


    Understanding these terms provides a solid foundation for delving into the world of data structures and algorithms in computer science.

  • Quiz
  • Why data structures are needed?3:26

    In the last video we saw the basic terminologies of data structure and in this video we will see what is the need of data structure.


    Need of data structure.

    Let’s first Understand the Need for Data Structures.


    As applications grow in complexity and the volume of data continues to surge daily,


    Challenges may arise in tasks such as data searching, processing speed, and handling multiple requests.


    Data Structures offer diverse techniques for efficiently organising, managing, and storing data.


    They facilitate seamless traversal of data items, providing benefits such as efficiency, reusability, and abstraction.



    Why should we learn Data Structures?


    Data Structures and Algorithms stand as pivotal elements in the realm of Computer Science. While Data Structures provide the means to organise and store data, Algorithms empower us to process that data with purpose. Acquiring proficiency in Data Structures and Algorithms is instrumental in elevating our programming skills. This knowledge enables us to craft code that is not only more effective and reliable but also empowers us to solve problems swiftly and efficiently.


    Some of the objectives of data structure are


    Accuracy: Data structures are crafted to function accurately across a spectrum of inputs relevant to the specific domain. In essence, ensuring correctness is the foremost goal of data structures, and it is conditional upon the challenges that the data structure aims to address.


    Optimisation: Data structures must also prioritise efficiency. They should swiftly handle data processing without excessive utilisation of computer resources such as memory space. In real-time scenarios, the efficiency of a data structure plays a pivotal role in determining the outcome of a process, be it success or failure.


    Key features of data structure are


    Robustness:

    In general, the goal of all computer programmers is to create software that produces accurate results for any conceivable input while executing efficiently across diverse hardware platforms. Such robust software should effectively handle both valid and invalid inputs.


    Adaptability:

    The development of software applications like web browsers, word processors, and internet search engines involves expansive software systems that must demonstrate correct and efficient performance over extended periods. Furthermore, software undergoes evolution due to emerging technologies and ever-changing market conditions.


    Reusability:

    The attributes of reusability and adaptability are inherently interconnected. Building software demands considerable resources, making it a costly endeavour. However, when software is developed with a focus on reusability and adaptability, it can be seamlessly applied in numerous future applications. By employing robust data structures, it becomes feasible to construct reusable software, thereby achieving cost-effectiveness and time savings.


    In this video we saw the

    The need of data structures.

    Discussed Why should we learn data structures.

    And saw what are the

    Objectives of data structure.

    Objectives are

    Accuracy

    Optimisation


    And discussed the key features of data structures and they are

    Robustness

    Adaptability

    Reusability


    In the next video we will see the classification of data structures.


  • Quiz
  • Classification of data structures1:29


    Classification of data structures

    In the last video, we discussed, what is the need for data structure and in this video, we are going to see the classification of data structures.


    Already you have got a brief introduction about the classification of data structures in the lecture types of data structures.


    You can skip this video if you have thoroughly got a concept of types of data structures.


    Now let’s understand the classification of data structures with the depiction of a flow diagram.


    As we already know the data structure is classified into two types primitive data structures and non-p primitive data structures.


    The primitive data structures are classified into 4 types, they are

    Integer

    Float

    Character

    Boolean


    And non primitive data structures are classified into two types which are Linear data structure and non-linear data structure.


    Here the Linear data structure is further classified into two types

    Static and dynamic.


    Static includes an array and in the dynamic Linked list, stacks, and queues are classified.


    And coming to the non-linear data structure it is further classified into two types Tree and Graph.


    You are going to learn all these concepts in detail in upcoming chapters.


    So in the next video, we will see the application of data structures.

  • Quiz
  • Applications of data structures1:20

    Applications of data structures


    In this video, we are going to see the applications of data structures.


    There are many applications of data structure, and we have listed here some of them.


    1. Data Structures play a vital role in organising data within a computer's memory.


    1. They are used in representing information within databases.


    1. Data Structures extend to implementing algorithms for data search.


    1. Enable the implementation of algorithms for data manipulation.


    1. Additionally, Data Structures support algorithms for data analysis.


    1. Furthermore, Data Structures facilitate algorithms for generating data.


    1. Support algorithms for compressing and decompressing data.

    2. Moreover, Data Structures are used for implementing algorithms for encrypting and decrypting data.

    3. The versatility of Data Structures is highlighted by their role in building software capable of managing files and directories.

    4. Additionally, they contribute to the development of software capable of rendering graphics.


    These are some of the applications of data structure, in the next video we will discuss algorithms.

  • Quiz

Requirements

  • Basic knowledge of any programming language like C, C++, Java, Python

Description

Programming examples are given in all possible languages like C, C++, Java, Python, JavScript, Ruby, etc.


Data structure and algorithms are very important parts of the software and web development careers. One must have a thorough knowledge of DSA to stand out in an IT career. No matter which platform you work on or which language you prefer to code, DSA is a must-have knowledge to grow in the software field.

This is the perfect course for people who want to learn DSA right from the beginning and become masters at the end of the course.

This course is designed for beginners and intermediates, this course will be the perfect choice for people who are new to data structures, here all topics are explained in detail from scratch with suitable examples along with the possible programming code.

To make it easy to learn for you, topics are explained using real-world examples.

Course overview.


☞ Arrays
☞ Linked List
☞ Stacks
☞ Pointers
☞ Queues
☞ Tree
☞ Binary Tree
☞ Binary Search Tree
☞ AVL Tree
☞ Graph
☞ Set
☞ Hash Table
☞ Algorithms
☞ Brute Force
☞ Greedy
☞ Recursive
☞ Backtracking
☞ Divide & Conquer
☞ Dynamic Programming
☞ Randomized
☞ Bubble Sort
☞ Quick Sort
☞ Selection Sort
☞ Insertion Sort
☞ Heap Sort
☞ Merge Sort
☞ Counting Sort
☞ Bucket Sort
☞ Comb Sort
☞ Hash Functions
☞ AES
☞ RSA
☞ Problems & solutions on numbers, strings, arrays
☞ Problems & solutions on stacks, trees, linked lists, queues
☞ DSA MCQ

Who this course is for:

  • For beginners and Intermediates, willing to learn data structure and algorithms from scratch
  • Programming example codes given in all possible languages