{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}


To delete an element we merely mark it deleted using

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: at the top of the stack and the order of all the items is preserved. Using enqueue and dequeue operations for the queue and push and pop operations for stack, design and implement an efficient O(n) algorithm to accomplish the above task, using only constant amount of additional storage. Question 6: An alternative to the deletion strategy we have given is to use lazy deletion. To delete an element, we merely mark it deleted (using an extra bit field). The number of deleted or non deleted elements in the list is kept as part...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online