Repository navigation
Expand file tree
/
Copy path23.cpp
More file actions
87 lines (74 loc) · 2.71 KB
/
Copy path23.cpp
File metadata and controls
87 lines (74 loc) · 2.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/*
Print and display /
Insertion: Beginning, Position, End /
Deletion: Beginning, Position, End /
Traversing linked list
Linear search - iterative and recursive(ineffieciency why learn)
Sorting
Linked list Reversal - Iterative and Recursive
Searching Sorted list
Doubly linked list /
Insertion operations Doubly linked list /
Deletion operations Doubly linked list /
finding kth node from last
finding middle node from singly LL
finding 2nd last node from singly LL and insert
detect cycle or loop from singly LL
merge 2 sorted singly LL
doubly reverse LL
middle of doubly LL
2nd last node address
Circular linked list
Doubly circular linked list
XOR linked list
Stack
Queue
Postfix prefix infix operation expression notation
*/
/*
Polish prefix
Reverse polish notation postfix
Operators ka priority order, rules, etc.
When more ops come use associativity rule: usually left to right but not at all times.
*/
/*
Infix to postfix conversion
----------------------------
1. print operands as they arrive
2. if the stack is empty or contains a left parenthesis on top, push the incoming operator on to the stack.
3. If the incoming symbol is "(" push it onto stack.
4. If the incoming symbol is ")", pop the stack and print the operator until left parenthesis is found.
5. if incoming symbol is highest precedance than to top of stack, push it on the stack.
6. if incoming symbol has lower precedence than top of stack, pop and print the top, then test the incoming operator against the new top of the stack.
7. if the incoming operator has equal precedence with top of the stack use associative rule.
i) At the end of expression pop and print all operators of the stack.
ii) If associativity is left to right then pop and print the top of stack and then push the incoming operator.
iii) if associativity is right to left then push the incoming operator.
*/
/*
Without using stack -
eqn: 1. A+B/C
= A + BC/
= ABC/+
*/
/*
Program list
1.Generic array operations
2.Array sorting and searching
3. Generic Linkedlist operations
4. Doubly linkedlist operations
5. Circular and doubly circular linkedlist operations
6. Polynomial addition and multiplication using linkedlist
7. Music playlist sorting using linkedlist
8. Implementation of stack using array
9. Implementation of stack using linkedlist
10. Implementation of queue using array
11. Implementation of queue using linkedlist
12. Implementation of queue using circular array
13. Implementation of deque using doubly linkedlist
14. Infix to postfix conversion using stack
15. Postfix expression evaluation using stack
16. Two way stack implementation
17. Implementation of binary tree using array
18. Implementation of binary tree using linkedlist
*/