0% found this document useful (0 votes)
2 views

Data Structure

A data structure is a method for organizing and storing data efficiently in a computer, with classifications into linear and non-linear types. Common linear data structures include arrays, linked lists, stacks, and queues, while non-linear structures include trees and graphs. Each type has specific characteristics and operations that facilitate data management and access.

Uploaded by

roynandita079
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Data Structure

A data structure is a method for organizing and storing data efficiently in a computer, with classifications into linear and non-linear types. Common linear data structures include arrays, linked lists, stacks, and queues, while non-linear structures include trees and graphs. Each type has specific characteristics and operations that facilitate data management and access.

Uploaded by

roynandita079
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Data Structure

A data structure is a way of organizing and storing data in a computer


so that it can be accessed and used efficiently. It refers to the logical
or mathematical representation of data, as well as the implementation
in a computer program.
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
Classification/Types of Data Structures:
Linear Data Structure
Non-Linear Data Structure
Linear Data Structure:
Elements are arranged in one dimension, also known as linear
dimension.
Example: lists, stack, queue, etc.
Non-Linear Data Structure
Elements are arranged in one-many, many-one and many-many
dimensions.
Example: tree, graph, table, etc.
Most Popular Data Structures:
1. Array:
An array is a collection of similar data items stored at contiguous
memory locations. The idea is to store multiple items of the same type
together.

2. Linked Lists:
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.

Stack Operations:
push (): When this operation is performed, an element is inserted into
the stack.
Pop (): When this operation is performed, an element is removed from
the top of the stack and is returned.
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.

Queue Operations:
Enqueue (): Adds an element to the end of the queue..
Dequeue (): Removal of elements from the queue.
Front (): Acquires the data element available at the front node of the
queue without deleting it.
Rear (): This operation returns the element at the rear end without
removing it.
5. 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.

6. 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).
7. Graph:
Graph is a data structure that consists of a collection of nodes
(vertices) connected by edges.

You might also like