You are on page 1of 11

Enter Elements in Array: 1 2 333 4 -1

Max Element: 333


Min Element: -1

________________________________________________________________
_

Enter elements in array:


1 1 1 1 1
PRESS
1 for deletion
2 for insertion
3 for printing array:
2
Displaying Array before insertion: 1 1 1 1 1
Enter position to insert: 3
Enter value to insert: 2
Displaying Array after insertion: 1 1 2 1 1 1

________________________________________________________________
_

Enter elements in array (only 5): 1 2 3 4 55


Displaying Array: 1 2 3 4 55
Enter value to find index of: 55
4

________________________________________________________________
_

Displaying Array: 1 2 3 4 5
Enter value to find index of: 4
3

________________________________________________________________
_

1 2 3
4 5 6
7 8 9
Enter value to find index of: 6

Value Found
Row: 2
Column: 3
Enter 1 for Addition
Enter 2 for Subtraction
Enter 3 for Transpose
Enter 4 for Multiplication:
1

2 2 2
2 2 2
2 2 2

Enter 1 for Addition


Enter 2 for Subtraction
Enter 3 for Transpose
Enter 4 for Multiplication:
2

0 0 0
0 0 0
0 0 0

Enter 1 for Addition


Enter 2 for Subtraction
Enter 3 for Transpose
Enter 4 for Multiplication:
3

1 2 3
4 5 6
7 8 9

1 4 7
2 5 8
3 6 9

Enter 1 for Addition


Enter 2 for Subtraction
Enter 3 for Transpose
Enter 4 for Multiplication:
4

3 3 3
3 3 3
3 3 3

________________________________________________________________
_
Press 1 for Insertion At Beginning
Press 2 for Insertion At End
Press 3 for Insertion At Given Position
Press 4 for Deletion From Beginning
Press 5 for Deletion From End
Press 6 for Deletion From Given Position
Press 7 for Deletion From Given Key
Press 8 for Displaying Linked List
PRESS Any Other Key for Termination
1
Enter Element to insert: 1
1
Enter Element to insert: 2
1
Enter Element to insert: 3
1
Enter Element to insert: 4
1
Enter Element to insert: 5

2
Enter Element to insert: 7

8
5 4 3 2 1 7

3
Enter Element to insert: 66
Enter Element's position: 1

8
5 4 66 3 2 1 7

4
5

8
4 66 3 2 1

6
Enter Element's position: 0

7
Enter Element: 3

8
4 2 1
9
Press 1 for Insertion At Beginning
Press 2 for Insertion At End
Press 3 for Insertion At Given Position
Press 4 for Deletion From Beginning
Press 5 for Deletion From End
Press 6 for Deletion From Given Position
Press 7 for Deletion From Given Key
Press 8 for Displaying Linked List
PRESS Any Other Key for Termination
1
Enter Element to insert: 1
1
Enter Element to insert: 2
1
Enter Element to insert: 3
1
Enter Element to insert: 4
2
Enter Element to insert: 6
4
5

1
Enter Element to insert: 55555
8
55555 3 2 1

1
Enter Element to insert: 1
1
Enter Element to insert: 1
1
Enter Element to insert: 1
2
Enter Element to insert: 454
8
1 1 1 55555 3 2 1 454

4
5

6
Enter Element's position: 0
7
Enter Element: 1
8
55555 3 2 1
9
Press 1 for Insertion At Beginning
Press 2 for Insertion At End
Press 3 for Insertion At Given Position
Press 4 for Deletion From Beginning
Press 5 for Deletion From End
Press 6 for Deletion From Given Position
Press 7 for Deletion From Given Key
Press 8 for Displaying Linked List
PRESS Any Other Key for Termination
1
Enter Element to insert: 1
1
Enter Element to insert: 2
1
Enter Element to insert: 3
1
Enter Element to insert: 4
1
Enter Element to insert: 5
1
Enter Element to insert: 6

2
Enter Element to insert: 66

3
Enter Element to insert: 565
Enter Element's position: 3

8
6 5 4 3 565 2 1 66

4
5

6
Enter Element's position: 0

7
Enter Element: 1

8
5 3 565 2

9
Press 1 for PUSH
Press 2 for POP
Press 3 for Display
PRESS Any Other Key for Termination
1
Enter Element to push: 1

Press 1 for PUSH


Press 2 for POP
Press 3 for Display
PRESS Any Other Key for Termination
1
Enter Element to push: 2

Press 1 for PUSH


Press 2 for POP
Press 3 for Display
PRESS Any Other Key for Termination
1
Enter Element to push: 3

Press 1 for PUSH


Press 2 for POP
Press 3 for Display
PRESS Any Other Key for Termination
3
3 2 1

Press 1 for PUSH


Press 2 for POP
Press 3 for Display
PRESS Any Other Key for Termination
2

Press 1 for PUSH


Press 2 for POP
Press 3 for Display
PRESS Any Other Key for Termination
3
2 1

Press 1 for PUSH


Press 2 for POP
Press 3 for Display
PRESS Any Other Key for Termination
7

________________________________________________________________
_

------------------------------------
STACK IMPLEMENTATION PROGRAM
------------------------------------
1. Push
2. Pop
3. Display
4. Exit
------------------------------------
Enter your choice: 1
Enter data to push into stack: 11
Data pushed to stack.

Enter your choice: 1


Enter data to push into stack: 12
Data pushed to stack.

Enter your choice: 1


Enter data to push into stack: 1111
Data pushed to stack.

Enter your choice: 2

Enter your choice: 3


The Stack is:
12 11

Enter your choice: 4


Exiting ...

________________________________________________________________
_

Enter the expression : ((4+8)(6-5))/((3-2)(2+2))

4 8 + 6 5 - 3 2 - 2 2 + /

________________________________________________________________
_

Press 1 for Insertion


Press 2 for Deletion
Press 3 for Display
PRESS Any Other Key for Termination
1
Enter Element to Insert: 1

Press 1 for Insertion


Press 2 for Deletion
Press 3 for Display
PRESS Any Other Key for Termination
1
Enter Element to Insert: 2

Press 1 for Insertion


Press 2 for Deletion
Press 3 for Display
PRESS Any Other Key for Termination
1
Enter Element to Insert: 33

Press 1 for Insertion


Press 2 for Deletion
Press 3 for Display
PRESS Any Other Key for Termination
2

Press 1 for Insertion


Press 2 for Deletion
Press 3 for Display
PRESS Any Other Key for Termination
3
2 33

Press 1 for Insertion


Press 2 for Deletion
Press 3 for Display
PRESS Any Other Key for Termination
4

________________________________________________________________
_
Press 1 for Insertion
Press 2 for Deletion
Press 3 for Display
PRESS Any Other Key for Termination
1
Enter value: 1

Press 1 for Insertion


Press 2 for Deletion
Press 3 for Display
PRESS Any Other Key for Termination
1
Enter value: 12

Press 1 for Insertion


Press 2 for Deletion
Press 3 for Display
PRESS Any Other Key for Termination
1
Enter value: 111

Press 1 for Insertion


Press 2 for Deletion
Press 3 for Display
PRESS Any Other Key for Termination
2

Press 1 for Insertion


Press 2 for Deletion
Press 3 for Display
PRESS Any Other Key for Termination
3

Queue values ...


12 111

Press 1 for Insertion


Press 2 for Deletion
Press 3 for Display
PRESS Any Other Key for Termination
4
Press 1 for Insertion
Press 2 for Deletion
Press 3 for Display
PRESS Any Other Key for Termination
1
Enter Element to Insert: 1

Press 1 for Insertion


Press 2 for Deletion
Press 3 for Display
PRESS Any Other Key for Termination
1
Enter Element to Insert: 111

Press 1 for Insertion


Press 2 for Deletion
Press 3 for Display
PRESS Any Other Key for Termination
1
Enter Element to Insert: 1345

Press 1 for Insertion


Press 2 for Deletion
Press 3 for Display
PRESS Any Other Key for Termination
2

Press 1 for Insertion


Press 2 for Deletion
Press 3 for Display
PRESS Any Other Key for Termination
3
111 1345

Press 1 for Insertion


Press 2 for Deletion
Press 3 for Display
PRESS Any Other Key for Termination
4

________________________________________________________________
_

Inorder traversal
15 ->1 ->16 ->1 ->9 ->
Preorder traversal
1 ->1 ->15 ->16 ->9 ->
Postorder traversal
15 ->16 ->1 ->9 ->1 ->

1.Insertion
2.Searching Element
3.Deletion
4.Minimum
5.Maximum
6.Display
7.Exit

Enter your choice: 1


Enter the element to insert: 11

Enter your choice: 1


Enter the element to insert: 12

Enter your choice: 1


Enter the element to insert: 45
Enter your choice: 2
Enter the element to search: 45
The Searched item is found

Enter your choice: 3


Enter the element to delete: 45

Enter your choice: 4


Min Value: 11

Enter your choice: 5


Min Value: 12

Enter your choice: 6

Inorder Traversal:
11 -> 12 ->

Enter your choice: 7

You might also like