Alpingi.com

Freshers Jobs | AMCAT | FRESHERSWORLD | JEE | NEET | GATE & CAT

AMCAT coupon code --> ALP50 | Freshersworld Discount Code --> AFF1451AGI
Alpingi.com New UpdatesAMCAT Discount Code (ALP50) - get upto 100 flat off Alpingi.com UpdatesFreshersworld Coupon Code (AFF1451AGI) - - get flat 100 off

AMCAT Stacks and Queues Questions 2018 – Computer Programming section

AMCAT Stacks and Queues Questions-Computer Programming section 2018: AMCAT is one of the topmost employment tests. The level of the questions is also average.That makes it easy to score more in the test. The exam majorly comprises of 3 modules – Quantitative abilities, Reasoning abilities and English language. It also includes personality test. Computer programming section is one of the optional modules. This module also helps attracting more recruiters to the profile.

AMCAT Stacks and Queues Questions 2018

AMCAT Stacks and Queues Questions

One of the important topics in AMCAT Computer Programming section is stacks and queues. Most of all 1-2 question comes every time. In addition, the difficulty level of the questions is moderate. It usually takes 45- 50 seconds to solve the questions. Below we will be discussing in detail about stacks and queues and its sample questions.

About Stacks and Queues

Queues and stacks is a rather, important concept of data structures and algorithms.

Stacks: 

Stacks are dynamic data structures that follow the Last In First Out (LIFO) principle. The last item to be inserted into a stack is the first one to be deleted from it.

For example, you have a stack of trays on a table. The tray at the top of the stack is the first item to be moved if you require a tray from that stack.

Inserting and deleting elements

In data structures, stacks  have restrictions on the insertion and deletion of elements. Elements can be inserted or deleted only from one end of the stack i.e. from the toptop. The element at the top is called the toptop element. The operations of inserting and deleting elements are called push()push() and pop()pop() respectively.

When the top element of a stack is deleted, if the stack remains non-empty, then the element just below the previous top element becomes the new top element of the stack.

As an example, in the stack of trays, if you take the tray on the top and do not replace it, then the second tray automatically becomes the top element (tray) of that stack.

Features of stacks

  • Dynamic data structures
  • Do not have a fixed size
  • Do not consume a fixed amount of memory
  • Size of stack changes with each push()push() and pop()pop() operation. Each push()push() and pop()pop() operation increases and decreases the size of the stack by 11, respectively.

Queue:

Like Stack, Queue is a linear structure which follows a particular order in which the operations are performed. The order is First In First Out (FIFO).  A good example of queue is any queue of consumers for a resource where the consumer that came first is served first.
The difference between stacks and queues is in removing. In a stack we remove the item the most recently added; in a queue, we remove the item the least recently added.

Operations on Queue:
Mainly the following four basic operations are performed on queue:

Enqueue: Adds an item to the queue. If the queue is full, then it is said to be an Overflow condition.
Dequeue: Removes an item from the queue. The items are popped in the same order in which they are pushed. If the queue is empty, then it is said to be an Underflow condition.
Front: Get the front item from queue.
Rear: Get the last item from queue.

Download AMCAT Stacks and Queues Questions 2018 

AMCAT Stacks and Queues Question pdf

Sample questions on AMCAT Stacks and Queues Questions: 

Question1
These operations can be performed on which type of structure? Push, Pop, Peek
A. Queue
B. Priority Queue
C. Stack
D. Both 1 and 2
Answer:
Option D
Explanation:
Only stack has these queue has enqueue and dequeue

Question 2
Which one of the following is an application of Queue Data Structure?
A. When a resource is shared among multiple consumers.
B. When data is transferred asynchronously (data not necessarily received at same rate as sent) between two processes
C. Load Balancing
D. All of the above
Answer:
Option  D

Question 3
How many stacks are needed to implement a queue. Consider the situation where no other data structure like arrays, linked list is available to you.
A. 1
B. 2
C. 3
D. 4
Answer:
Option B

Question 4
A priority queue can efficiently implemented using which of the following data structures? Assume that the number of insert and peek (operation to see the current highest priority item) and extraction (remove the highest priority item) operations are almost same.
A. Array
B. Linked List
C. Heap Data Structures like Binary Heap, Fibonacci Heap
D. None of the above
Answer:
Option C

Question 5
In a queue, the initial values of front pointer f rare pointer r should be …….. and ……….. respectively.
A. -1, -1
B. 0, -1
C. 0, 0
D. -1, 0
Answer:  
Option B

You can also practice sample questions on AMCAT iteration, recursion and decision.

Download AMCAT questions for Data types

AMCAT questions for arrays, linked lists, trees,graph

Download AMCAT sample questions for procedure function and scope

Any questions and concern on AMCAT Stacks and Queues Questions then please ask in comment box.

More Articles AMCAT CSE Questions Paper:

Looking for AMCAT Discount? – check here AMCAT Discount Code

Leave a Reply

Your email address will not be published.

alpingi © 2018