DS Lect2
DS Lect2
(CSC303)
Lecture 2
Shilpa Ingoley
• Linear Data Structure:
• A data structure is said to be linear if its elements form sequence
or linear list
• Eg Arrays, linked list, stack, queue
if(top==-1)
printf(“\n Stack underflow”)
else
{
printf(“Popped element is %d”,arr[top]);
top=top-1;
}
Stack Full/ Stack Overflow:
Stack Full/ Stack Overflow: