Write the answers for the following questions. (Java ) 1. 2, 4, 1, 3 are added to a stack in this order. Write the resu
Posted: Sun May 15, 2022 12:13 pm
Write the answers for the following questions. (Java )
1. 2, 4, 1, 3 are added to a stack in this
order. Write the results of 4 removals:
2. 2, 4, 1, 3 are added to a queue in this
order. Write the results of 4 removals:
3. 2, 4, 1, 3 are added to a priority queue
in this order. Write the results of 4 removals:
4. 2, 4, 1, 3 are added to a heap in this
order. Write the results of 4 removals:
5. 2, 4, 1, 3 are added to the first position
of a deque in this order. Write the results of 4 removals from the
last position:
6. 2, 4, 1, 3 are added to the last position
of a deque in this order. Write the results of 4 removals from the
last position:
7. 2, 4, 1, 3 are added to a binary search
tree in this order. Write the results of post-order
traversal:
8. 2, 4, 1, 3 are added to a binary search
tree in this order. Write the results of in-order traversal:
9. 1, 2, 3, 4 are added to a binary search
tree in this order. Write the results of pre-order traversal:
10. 1, 2, 3, 4 are added to a binary search tree
in this order. Write the results of in-order traversal:
1. 2, 4, 1, 3 are added to a stack in this
order. Write the results of 4 removals:
2. 2, 4, 1, 3 are added to a queue in this
order. Write the results of 4 removals:
3. 2, 4, 1, 3 are added to a priority queue
in this order. Write the results of 4 removals:
4. 2, 4, 1, 3 are added to a heap in this
order. Write the results of 4 removals:
5. 2, 4, 1, 3 are added to the first position
of a deque in this order. Write the results of 4 removals from the
last position:
6. 2, 4, 1, 3 are added to the last position
of a deque in this order. Write the results of 4 removals from the
last position:
7. 2, 4, 1, 3 are added to a binary search
tree in this order. Write the results of post-order
traversal:
8. 2, 4, 1, 3 are added to a binary search
tree in this order. Write the results of in-order traversal:
9. 1, 2, 3, 4 are added to a binary search
tree in this order. Write the results of pre-order traversal:
10. 1, 2, 3, 4 are added to a binary search tree
in this order. Write the results of in-order traversal: