You are on page 1of 1

Quiz 2

Q.1
pop(): Removes the top object of the linked list and returns it; if the list is empty an error occurs.
top(): return the top object of the linked list, without removing it; if the list is empty an error occurs.

Q.2
void Push()
{
int x;

if(Top==Size-1)
{
printf("\nOverflow!!");
}
else
{
printf("\nEnter element to be inserted to the stack:");
scanf("%d",&x);
Top=Top+1;
inp_array[Top]=x;
}
}

You might also like