Posts

Showing posts with the label Stack basic in Data structure

Featured post

-Write C program to find even and odd number using macro

-Write C program to find even and odd number using macro #include<stdio.h> #define number(n)((n%2==0)?1:0) int main() { int num; printf("enter any number"); scanf("%d",&num); if(number(num)) printf("number is even"); else printf("number is odd"); return 0; } ***************************Output*********************** amr@amrj-virtual-machine:~$ gccevenodd.c amr@samr-virtual-machine:~$ ./a.out enter any number 2 number is evensmj@amr-virtual-machine:~$

Stack in Data structure

      Stack Definition:           Amreshtechknowledge.blogspot.com Stack is a order collection of homogeneous data elements where the insertion and deletion operation take place only one end that is called Stack. It is a LIFO (Last in First out) Technique.  It is a Abstract Data type. The position of stack where the operation is perform is called TOS(Top of Stack).                                                    Stack is Basically there are two operation. Push:-This is a insert or adding element in a stack i.e is called Push. Pop:-This is a delete or remove the element of stack is called POP.       Insert and delete   a specific number in stack by using push() and pop() #include<stdio.h> struct Node {    int data...