Consider the current elements and its indexes in the queue of size 15: {index[00]=102, index[01]=165, index[02]=115, index[03]=384, index[04]=248, index[05]=111}, draw a table (like shown below) the sequence of elements using the operations listed from number 1 to 26 using the queue approach (A) - in shifting the elements one position forward every time an element is deleted. The following are the description of other operations to be used that would result in a QUEUE that contains the elements. IsTopValue – returns the value at the TOP of the queue. IsRearValue – returns the value at the REAR of the queue. IsTopIndex – returns the index of the value at the TOP of the queue. IsRearIndex – returns the index of the value at the REAR of the queue. IsIndexOf – returns the index of the specific value. IsValueOf – returns the value of the specific index. Insert (Q, 12) Dequeue (Q) Dequeue (Q) Insert (Q, 65) Insert (Q, 100) Insert (Q, 43) Dequeue (Q) IsTopValue (Q) Insert (Q, 61) Dequeue (Q) Dequeue (Q) Dequeue (Q) IsRearIndex (Q) Insert (Q, 29) Insert (Q, 91) IsTopIndex(Q) IsIndexOf(Q, 100) Insert (Q, 121) Insert (Q, 34) Insert (Q, 75) IsRearValue (Q) IsValueOf (Q, [10]) Insert (Q, 17) Dequeue (Q) IsTopValue (Q)
Consider the current elements and its indexes in the queue of size 15: {index[00]=102, index[01]=165, index[02]=115, index[03]=384, index[04]=248, index[05]=111}, draw a table (like shown below) the sequence of elements using the operations listed from number 1 to 26 using the queue approach (A) - in shifting the elements one position forward every time an element is deleted. The following are the description of other operations to be used that would result in a QUEUE that contains the elements.
IsTopValue – returns the value at the TOP of the queue.
IsRearValue – returns the value at the REAR of the queue.
IsTopIndex – returns the index of the value at the TOP of the queue.
IsRearIndex – returns the index of the value at the REAR of the queue.
IsIndexOf – returns the index of the specific value.
IsValueOf – returns the value of the specific index.
- Insert (Q, 12)
- Dequeue (Q)
- Dequeue (Q)
- Insert (Q, 65)
- Insert (Q, 100)
- Insert (Q, 43)
- Dequeue (Q)
- IsTopValue (Q)
- Insert (Q, 61)
- Dequeue (Q)
- Dequeue (Q)
- Dequeue (Q)
- IsRearIndex (Q)
- Insert (Q, 29)
- Insert (Q, 91)
- IsTopIndex(Q)
- IsIndexOf(Q, 100)
- Insert (Q, 121)
- Insert (Q, 34)
- Insert (Q, 75)
- IsRearValue (Q)
- IsValueOf (Q, [10])
- Insert (Q, 17)
- Dequeue (Q)
- IsTopValue (Q)
Trending now
This is a popular solution!
Step by step
Solved in 2 steps