Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Data Structure

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 16

CLASS:-BSC CS (1ST YEAR)

TOPIC :- DATA STRUCTURE


SUBJECT:-PROGRAMMING METHODOLOGIES
& DATA STRUCTURE.

SUBMITTED BY:- SUBMITTED TO :-


PAWAN VERMA MR. MAHENDRA GEHLOD SIR
S/O: MR.RAJESH VERMA (ASST. PROFESSOR OF COMPUTER SCIENCE)
OUTLINE:-

Introduction.
Classification of Data Structure.
Need Of Data structure.
Most Popular Data Structures.
Applications of Data Structures.
Advantages of Data Structures.
INTRODUCTION:-

A data structure is a group of


data elements that provides
the easiest way to store and
perform different actions on
the data of the computer. A
data structure is a particular
way of organizing data in a
computer so that it can be
used effectively. The idea is
to reduce the space and time
complexities of different
tasks.
Classification of Data Structure:-

DATA STRUCTURE

LINEAR DATA NON LINEAR DATA


STRUCTURE STRUCTURE
LINEAR DATA STRUCTURE:-
A data structure is said to be linear if its elements combine to form any specific order.
There are two techniques for representing such linear structure within memory.

• The first way is to provide a linear relationship between all the elements represented
using a linear memory location. These linear structures are called arrays.
• The second technique provides a linear relationship between all the elements
represented using the concept of pointers or links. These linear structures are called
linked lists.

The typical examples of the linear data structure are:

 Arrays
 Queues
 Stacks
 Linked lists
Non-linear Data Structure:-
This structure mainly represents data with a hierarchical
relationship between different elements.
Examples of Non-Linear Data Structures are listed below:
 Graphs
 Family of trees and
 Table of contents
N E E D O F D ATA ST R U C T U R E.
The structure of the data and the synthesis of the algorithm are relative
to each other. Data presentation must be easy to understand so the
developer, as well as the user, can make an efficient implementation of
the operation.
Data structures provide an easy way of organizing, retrieving,
managing, and storing data.

• Here is a list of the needs for data.

Data structure modification is easy.


It requires less time.
Save storage memory space.
Data representation is easy.
Easy access to the large database
Most Popular Data Structures.
1. Array: An array is a collection of data items stored at contiguous memory locations. The idea is
to store multiple items of the same type together. This makes it easier to calculate the position of
each element by simply adding an offset to a base value, i.e., the memory location of the first
element of the array (generally denoted by the name of the array).

2. Linked Lists: Like arrays, Linked List is a linear data structure. Unlike arrays, linked list elements are not
stored at a contiguous location; the elements are linked using pointers.

3. Stack: Stack is a linear data structure which follows a particular order in which the operations are performed. The
order may be LIFO(Last In First Out) or FILO(First In Last Out). In stack, all insertion and deletion are permitted at
only one end of the list.
MOST POPULAR DATA STRUCTURES.
4. Queue: Like Stack, Queue is a linear structure which follows a particular order in which the operations are
performed. The order is First In First Out (FIFO). In the queue, items are inserted at one end and deleted from the
other end. A good example of the queue is any queue of consumers for a resource where the consumer that came first
is served first. The difference between stacks and queues is in removing. In a stack we remove the item the most
recently added; in a queue, we remove the item the least recently added.

Mainly the following four basic operations are performed on queue:

 Enqueue: Adds an item to the queue. If the queue is full, then it is said to be an
Overflow condition.
 Dequeue: Removes an item from the queue. The items are popped in the same o
order in which they are pushed. If the queue is empty, then it is said to be an
Underflow condition.
 Front: Get the front item from the queue.
 Rear: Get the last item from the queue.
MOST POPULAR DATA STRUCTURES.
5. Trie: Trie is an efficient information reTrieval data structure. Using Trie, search complexities can be
brought to an optimal limit (key length). If we store keys in the binary search tree, a well-balanced BST will
need time proportional to M * log N, where M is maximum string length and N is the number of keys in the
tree. Using Trie, we can search the key in O(M) time. However, the penalty is on Trie storage requirements.
MOST POPULAR DATA STRUCTURES.
6. Binary Tree: Unlike Arrays, Linked Lists, Stack and queues, which are linear data structures, trees are
hierarchical data structures. A binary tree is a tree data structure in which each node has at most two
children, which are referred to as the left child and the right child. It is implemented mainly using Links.
A Binary Tree is represented by a pointer to the topmost node in the tree. If the tree is empty, then the value of
root is NULL.
A Binary Tree node contains the following parts.
1.Data
2.Pointer to left child
3. Pointer to the right child

7. Binary Search Tree: A Binary Search Tree is a Binary Tree following the additional properties:

• The left part of the root node contains keys less than the root node key.
• The right part of the root node contains keys greater than the root node key.
• There is no duplicate key present in the binary tree.

A Binary tree having the following properties is known as Binary search tree (BST).
MOST POPULAR DATA STRUCTURES.
Heap: A Heap is a special Tree-based data structure in which the tree is a complete binary tree.
Generally, Heaps can be of two types:

Max-Heap: In a Max-Heap the key present at the root node must be greatest among the keys present at
all of its children. The same property must be recursively true for all sub-trees in that Binary Tree.
Min-Heap: In a Min-Heap the key present at the root node must be minimum among the keys present
at all of its children. The same property must be recursively true for all sub-trees in that Binary Tree.
MOST POPULAR DATA STRUCTURES.
 Hashing Data Structure: Hashing is an important Data Structure which is designed to use a
special function called the Hash function which is used to map a given value with a particular
key for faster access of elements. The efficiency of mapping depends on the efficiency of the hash
function used.
Let a hash function H(x) maps the value x at the index x%10 in an Array. For example, if the list
of values is [11, 12, 13, 14, 15] it will be stored at positions {1, 2, 3, 4, 5} in the array or Hash table
respectively.
MOST POPULAR DATA STRUCTURES.

 Matrix: A matrix represents a collection of numbers arranged in an order of rows and columns. It
is necessary to enclose the elements of a matrix in parentheses or brackets.
A matrix with 9 elements is shown below.
Applications of Data
Structures:
 Operating system
 Graphics

 Computer Design
 Blockchain

 Genetics

 Image Processing

 Simulation,

 etc.
15
Advantages of Data structures
1. Data structure facilitates effective data storage in storage devices.
2. The use of data structures makes it easier to retrieve data from a storage device.
3. The data structure allows for the effective and efficient processing of both little and big
amounts of data.
4. Manipulation of vast amounts of data is simple when a proper data structure technique is
used.
5. The use of a good data structure may assist a programmer to save a lot of time or
processing time while performing tasks such as data storage, retrieval, or processing.
6. Most well-organized data structures, including stacks, arrays, graphs, queues, trees, and
linked lists, have well-built and pre-planned approaches for operations such as storage,
addition, retrieval, modification, and deletion. The programmer may totally rely on these
facts while utilising them.
7. Data structures such as arrays, trees, linked lists, stacks, graphs, and so on are thoroughly
verified and proved, so anybody may use them directly without the need for study and
development. If you opt to design your own data structure, you may need to do some study,
but it will almost certainly be to answer a problem that is more sophisticated than what
these can supply.
8. In the long term, data structure utilization might merely encourage reusability.

You might also like