DATA STRUCTRES TOPICS
Arrays-
It Is a linear data STRUCTURE used to store homogenous elements in continuous manner.
- its a linear data structure.
- storing the data sequentially(one by one).
- arrays have index , elements can be accessed by index.
- index always starts from 0.
- arrays can be represented as a[2].
Linked listπ
- it is also linear data structure.
- each elements are called as nodes.
- which will consists two items
- 1.data and 2.address of the next node.
most important word:- node {example:- train}.
node➖
node basically have two parts
- data(information).
- addresses(of next node)
TYPES OF linked list➖
- SINGLY LINKED LIST.
- DOUBLY LINKED LIST.
1.SINGLY LINKED LIST.
every node contains both data and reference (address)
- this can travel in one direction only.
- the last node address will be null.
- DOUBLY LINKED LIST.
- linked list.
- insertion in linked list
- case1: insertion at first node
- case2: insertion @end of the node
- case3: insertion in between node.
- case3: insert after a node.
#Algorithm to push operation at stack➖
Step1:- if(top==max stk=-1)
then
printf (”overflow!”);
return
Step 2:- top =top+1;
Step3:- stack[top]=item;
Step4:- return[stop]
#functional block to push operation at stack➖
void push()
{
if(top==maxstk-1)
printf(”stack overflow”)
else
{
printf(”enter the element”,item);
scanf(”%d”,&item);
}
top++;
{
stack[top]=item;
}
}
Did you know? Python stacks power functions calls in programming languages and aid in solving complex algorithms like Depth-First Search (DFS) ππ».”
Very helpful for college students like me.
ReplyDelete