3. Motivation
Data Structures and Algorithms Knowledge
give us the ability to improve our solution to
the problem and the ability to write much
better and efficient code. Thus, learning
Data Structures and Algorithms can be a
major learning curve for any computer
science student
4. Data Structure
Data Structure can be defined as the group of data elements
which provides an efficient way of storing and organizing data in
the computer so that it can be used efficiently.
Algorithm
Algorithm is a step-by-step procedure, which defines a set of
instructions to be executed in a certain order to get the desired
output or to solve a particular problem.. An algorithm can be
implemented in more than one programming language.
Learning data structures and algorithms allow us to write efficient
and optimized computer programs.
5. Some Data Structure Algorithms
Searching: Algorithm to search an item in a data structure.
• Linear Search
• Binary Search
Sorting: Algorithm to sort items in a certain order.
• Selection Sort
• Bubble Sort
• Merge Sort
Insert: Algorithm to insert item in a data structure.
Update: Algorithm to update an existing item in a data structure.
Delete: Algorithm to delete an existing item from a data structure
7. Types
2. Non-Linear Data Structure
Non-linear Data Structure: Data structures
where data elements are not arranged
sequentially or linearly are called non-linear
data structures.
Examples of non-linear data structures are:
Tree
BST (Binary Search Tree)
Graphs
1. Linear Data Structure
A Linear data structure have data elements
arranged in sequential manner and each
member element is connected to its previous
and next element. Such data structures are
easy to implement as computer memory is
also sequential.
Examples of linear data structures are:
Array
Linked List
Queue
Stack
In linear data structure, data elements are sequentially connected and each element is traversable through a single
run. In non-linear data structure, data elements are hierarchically connected and are present at various levels.