Modify queue data structure to support enqueue() , dequeue() , findmin() .... Is it possible to do this in O(1) with extra space ?
implement a stack using one queue
reverse a stack using one queue
What is the complexity of insertion and deletion of the following
1) Queue 2)Linked list 3)Queue implemented using linked list
Implement Queue using stack. How many stacks you need? Note that you can only use following functions on a queue.
enQueue() deQueue() isEmpty() isFull()
And your stack should support following operations. push() pop() isEmpty() isFull()
write an algo that deletes all negative integers without changing the order of remaining elements of the queue
What are the different ways to implement priority queue and how to choose one?
Why do we make queue circular? what is the use?
Give a good data structure for having n queues (n not fixed) in a finite memory segment. You can have some data-structure separate for each queue. Try to use at least 90% of the memory space.
What is the minimum number of queues needed to implement the priority queue?
What do you mean by a stack or a queue in which each item is a variable number number of integers? Is it a queue of a queue, queue of a stack etc
IntQueue q = new IntQueue(); q.enqueue(0); q.enqueue(1); for (int i = 0; i < 10; i++) { int a = q.dequeue(); int b = q.dequeue(); q.enqueue(b); q.enqueue(a + b); ptint(a); }
How will implement queue using 2 stacks such that enqueue and dequeue operations are efficient
RSS link for this tag
You must log in to post.
Register or log in:
Lost Password?