stack and queues Flashcards

(22 cards)

1
Q

“A ___ is a list of homogeneous elements, wherein the addition
and deletion of elements occurs only at one end, called the top of
the stack”

A

stack

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

“A stack is a list of homogeneous elements, wherein the addition
and deletion of elements occurs only at one end, called the ____ of
the stack”

A

top

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

“Stack: A data structure in which the elements are added and
removed from one end only, a ____________ data
structure”

A

Last In First Out (LIFO)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

“Stack: A _______ in which the elements are added and
removed from one end only, a Last In First Out (LIFO) data
structure”

A

data structure

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

“Adds a new element to the top of the stack.”

A

push(E item)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

“Removes the top element of the stack”

(Malik,2012)

A

pop()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

“Returns the top element of the stack” (Malik,2012)

A

top()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

“Looks at the object at the top of this stack without
removing it from the stack.” (oracle)

A

peek()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Check if stack is empty.

A

empty(),isEmpty()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

“If the stack is full, then it is said to be an____________” (geeksforgeeks)

A

Overflow
condition

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

“If the stack is empty, then it is said to be an
_______________.” (geeksforgeeks)

A

Underflow condition

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

“A _______ is a set of elements of the same type in which the
elements are added at one end, called the back or rear , and
deleted from the other end , called the front or first

A

queue

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

“A queue is a set of elements of the same type in which the
elements are added at one end, called the ______ , and
deleted from the other end , called the front or first

A

back or rear

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Inserts an element at the end of the queue i.e. at the rear end.

A

enqueue(E item)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

This operation removes and returns an element that is at the front end of the
queue.

A

dequeue( )

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

This operation indicates whether the queue is empty or not.

17
Q

This operation indicates whether the queue is full or not.

18
Q

________ also known as a linear queue is the most
basic version of a queue.

19
Q

In a ______, the element of the queue act as a
circular ring. The working of a circular queue is similar to the linear queue
except for the fact that the last element is connected to the first element.

A

circular queue

20
Q

“___: This queue is a special type of queue. Its specialty is that it
arranges the elements in a queue based on some priority.

A

Priority Queue

21
Q

___ is also known as Double Ended Queue. As the name
suggests double ended, it means that an element can be inserted or
removed from both ends of the queue, unlike the other queues in which it can
be done only from one end. Because of this property, it may not obey the
First In First Out property. .”

22
Q

Dequeue is also known as _________. As the name
suggests double ended, it means that an element can be inserted or
removed from both ends of the queue, unlike the other queues in which it can
be done only from one end. Because of this property, it may not obey the
First In First Out property. .”

A

Double Ended Queue