0% found this document useful (0 votes)
19 views23 pages

Data Structure 1

The document discusses key concepts of data structures including data, information, entities, attributes, fields, records, files, and tables. It then describes common data structures like arrays, linked lists, stacks, queues, and trees. It provides examples of each data structure and explains common operations like traversing, searching, inserting, deleting, and sorting. Algorithms are presented for each operation using pseudocode on how they would be implemented on arrays and linked lists.

Uploaded by

shail
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views23 pages

Data Structure 1

The document discusses key concepts of data structures including data, information, entities, attributes, fields, records, files, and tables. It then describes common data structures like arrays, linked lists, stacks, queues, and trees. It provides examples of each data structure and explains common operations like traversing, searching, inserting, deleting, and sorting. Algorithms are presented for each operation using pseudocode on how they would be implemented on arrays and linked lists.

Uploaded by

shail
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

Adarsh Education Society

Computer Science
Std:- XII
By :- Mr. Siddhesh Naik
v DATA STRUCTURE :-
Ø IMPORTANCE ELEMENTS OF DATA STRUCTURE:–
üDATA:— RAW INFORMATION
üINFORMATION :— PROCESSED DATA
üENTITY :— HUDGE SET OF INFORMATION
LIKE STUDENT, EMPLOYEE,CUSTOMERS.
üATTRIBUTE :— SUB INFORMATION RELATED ENTITY
LIKE ROLL NO NAME , ADDRESS ETC.
THE ATTRIBUTE DIVIDED INTO SUB INFORMATION
IS CALLED AS GROUP ITEM .
LIKE NAME DIVIDE INTO FIRST NAME MIDDLE NAME AND
LAST NAME.
THE ATTRIBUTE IS NOT DIVIDED INTO SUB ITME ITS
CALLED AS ELIMINATORY ITEMS.
Like PINCODE NUMBER.
üFIELD :— INDIVIDUAL REPRESENTATION OF
ATTRIBUTES. ITS CALLED AS COLOMN.
üRECORD :— THE COLLECTION OF FIELDS ITS CALLED AS
RECORDS. ITS COLLED AS ROW.
üFILE :- COLLECTION OF RECORDS ITS CALLED AS FILE.
üTABLE :- ITS REPRESENTATION OF DATA IN TABULAR
FORMAT
DATA STRUCTURE :-
• Data can be organised in a different ways.
• The logical or mathematical model of particular organisations is
called as DATA STRUCTURE.
• The model should reflect in the actual relationship of data in real
world and it should be simple enough so that data can be processed
whenever required.
• Ex:-
• Array
• Link list
• Graph
• Stack
• Queue
• OPERATIONS OF DATA STRUCTURE :-
1. TRAVERSING :- Accessing the each and every elements only once
so it can be processed.
2. Searching:– Finding the element in given array.
3. Inserting:– To add new element in existing elements.
4. Deleting:– Remove the specific element from existing elements.
5. Sorting:- To arrange the elements in specific order either ascending
or descending order.
6. Merging:– Merge means to combine the multiple records or
elements in single.
• ARRAY :-
ü An Array is Linear Data structure.
üIt is used to store multiple elements in single variable.
ü Data types of all the elements should be same.
üArray deals with Index Number.
üIndex number is used to define the position of each and every
elements stored in array.
üIndex value always start with zero and ends with N-1.
(N is total Number of elements)
Syntax:-
datatype Nameofvarible[Size of array]
EXAMPLE OF ARRAY:-
Int a[5]; a
Index Number Elements

0 10

1 20

2 30

3 40

4 50
In above example a is variable type
integer having size 5.
LINKED LIST :—
• It’s non linear data structure.It is used
to store the data in list and linked with
each other.
•It’s deal with Node.
•Node is divided into two parts Info and
Pointer.
•Info is used to store the actual data and
pointer is used to store the address of
next node.
•MEMORY REPRESENTATIONS OF
LINK LIST:-
• STACK AND QUEUE
• A stack is a basic data structure that can be logically
thought of as a linear structure represented by a real
physical stack or pile, a structure where insertion
and deletion of items takes place at one end called
top of the stack.
• A queue is a collection of entities that are
maintained in a sequence and can be modified by the
addition of entities at one end of the sequence and
the removal of entities from the other end of the
sequence
• TREE DATA STRUCTURE
• As a data structure, a linked tree is a group of nodes, where
each node has a value and a list of references to other nodes (its
children). There is also the requirement that no two
"downward" references point to the same node.
• BINARY TREE:-
• A binary tree is a hierarchical data structure in which each node
has at most two children generally referred as left child and
right child.
• ALGORITHMS:-
1. TRAVERSING :- Accessing the each and every elements only once
so it can be processed.
Algo:-
Consider LA is linear array with LB lower bound and UB upper
Bound. N is total no of elements.
Algo:-
1. Start
2. Set i = LB
3. Repeat step 4 and 5 till i <= UB
4. Visit LA[i] atleast once to apply the process.
5. i =i+1
6. Stop
2. Inserting:– This means add a new element in existing elements.
Algo:-
Consider LA is linear array with LB lower bound and UB upper Bound. N is
total no of elements.K is positive integer to define the position of DATA
element to be add.
Algo:-
1. Start
2. Set i = UB
3. Repeat step 4 and 5 till I>=K
4. Move the ith element downward ie LA[i+1]=LA[i]
5. i =i-1
6. Add the new element in Position K ie LA[K]= DATA
7. Reset N=N+1
8. Stop
3. Deleting:– This means remove the element in existing elements.
Algo:-
Consider LA is linear array with LB lower bound and UB upper Bound. N is
total no of elements.K is positive integer to define the position element to be
delete.
Algo:-
1. Start
2. Set i = K
3. Repeat step 4 and 5 till i<=UB
4. Move the ith element upward ie LA[i]=LA[i+1]
5. i =i+1
6. Reset N=N-1
7. Stop
4. Searching:– Searching means to find out the elements from given elements
.There are two types of searching .
• Linear Search :- In this method to findout the elements from start to end .
Once elements found then stop the search .
Algo:-
Consider LA is linear array with LB lower bound and UB upper Bound. N is
total no of elements.. DATA is element to be search.
Algo:-
1. Start
2. Set i = LB
3. Repeat step 4 till LA[i]!=DATA
4. i =i+1
5. If LA[i]= DATA search successful else element not found ie I>UB
6. Stop
• Binary Search :- In this method to findout the elements.Once
elements found then stop the search .For searching it use
following steps
• In this method first arrange the elements in ascending or
descending order.
• Then findout the mid term using formula
MID=INT(BEG+END)/2.
• IF LA[MID]=DATA search successful.
• If DATA<LA[MID]
Then Set END=MID-1
Else BEG=MID+1
If BEG> END that mean Search Unsuccessful.
Algo:-
Consider LA is linear array with LB lower bound and UB upper Bound. N is total no
of elements.. DATA is element to be search.
Algo:-
1. Start
2. Set BEG=LB and END=UB
3. Find out MID=INT(BEG+END)/2
4. Repeat step 5 and 6 till BEG<END & LA[MID]!= DATA
5. If DATA<LA[MID]
Set END=MID-1
Else. Set BEG=MID+1
6. MID= INT(BEG+END)/2
7. If BEG>END DATA not found
8. Stop.
6. Sorting:- Sorting means Arrange the elements in Ascending or
Descending order.Even this method is also called as BUBBLE sort
method.
• In this method perform N no of steps and N-1 no of comparisons in
every steps..
Algo:-
Consider LA is linear array with LB lower bound and UB upper Bound. N
is total no of elements..
Algo:-
1. Start
2. Set j= 0 ( j for steps)
3. Repeat step 4 to 8 til j<N
4. Set i=LB ( I for comparison)
5. Repeat ste 6 and 7 till I<N-1
6. If LA[i] > LA[i+1] then
Exchange the value between LA[i] and LA[i+1]
7. Set I=I+1
8. Set j=j+1
9. stop.
Thank You!!!!!!!!!!!

You might also like