![]() ![]() Choose correct output for the following sequence of operations.ģ. * Which statement is correct with respect to stack? The process of deleting/removing a new data element from the stack is known as pop. * The process of adding/inserting a new data element in a stack is known as push. Stack can be implemented using array and linked list. ![]() * Which of the following can be used to implement stack? This is the general question asked in exams or in interviews. Examples include CPU scheduling, Disk Scheduling. When a resource is shared among multiple consumers. In these message brokers, the producer publish the message in a queue and consumers consume those messages in First In First Out order.Ģ) Serving requests of a single shared resource (printer, disk, CPU).ģ) Transferring data asynchronously (data not necessarily received at same rate as sent) between two processes (IO buffers), e.g., pipes, file IO, sockets.Ĥ) In consumer producer problem. But they have to be processed in First In First Out order.ġ) Queues are used in message broker such as Kafka, RabbitMQ etc. ![]() Queue are mostly used in an application when things doesn’t have to be process immediately. Application of Stack Data Structureī) This data structure is used internally in function calls.Ĭ) Expression conversion such as – Infix to Postfix ,Infix to Prefix, Postfix to Infix,Prefix to Infix. Insertion and deletion operation in queue is known as enqueue and dequeue. In queue, insertion operation is known as Enqueue whereas deletion operation is known as Dequeue. In Stack, insertion operation is known as Push whereas deletion operation is known as Pop. That’s why it also known as FIFO (First In First Out) data structure. The element which we enqueued first is the first element to be dequeued from the queue. In queue insertion are performed on one end (Rear) and deletion is performed on other end (Front). The element which we inserted at last is the first element to be popped out that is why it also called as LIFO (Last In First Out) data structure. In Stack insertions and deletions are allowed only at one end. Stack and Queue both are linear data structure. The purpose of this objective questions is to test how well you understand the concept of stack and queue.ġ. Queue data structure and their implementation. In my previous post, i have discussed how to implement stack and queue data structure. Also you’ll find MCQ on stack and queues. In this tutorial, you are going to learn about stack and queue data structure. Both Stack and Queue data structure is very important in computer science. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |