September 14, 2023 in Data Structure
Q – Queue X – element to added to the queue Q IsFull(Q)– Checks and true if Queue Q is full Q->Size – Number of elements in the queue Q Q->Rear – Points to last element of the queue Q Q->Array – array used to store queue elements voidenqueue (int X, Queue Q) {if(IsFull(Q)) Error […]
September 14, 2023 in Data Structure
The various operations performed on the queue are CREATE(Q) – Creates Q as an empty Queue. Enqueue(Q,X) – Adds the element X to the Queue. Dequeue(Q) – Deletes a element from the Queue. ISEMTPTY(Q) – returns true if Queue is empty else false. ISFULL(Q) – returns true if Queue is full else false.
September 14, 2023 in Data Structure
A Queue is an ordered list in which all insertions take place at one end called the rear, while all deletions take place at the other end called the front. Rear is initialized to -1 and front is initialized to 0. Queue is also referred as First In First Out (FIFO) list.
September 14, 2023 in Data Structure
In recursive algorithms, stack data structures is used to store the return address when a recursive call is encountered and also to store the values of all the parameters essential to the current state of the function.