oo Verizon 1:57 PM Home Page Given the following queue operations on an empty ex
ID: 3810303 • Letter: O
Question
oo Verizon 1:57 PM Home Page Given the following queue operations on an empty existing queue called nameQueue. name Queue enqueue(Sid) name Queue enqueue(Sal) name Queue enqueue(Sue) name Queue enqueue(Sam) name Queue dequeue0 display (name eue Front(0) What name is displayed? a. Sid b. Sal c. Sue d. Sam Given the following queue operations on an empty existing queue called nameQueue. name Queue enqueue(Bob) name Queue enqueue(Bill) name Queue enqueue(Bud) name Queue dequeue0 name Queue enqueue(Boo) What is now the contents of the queue (with front of the queue listed leftmost)? a. Bob, Bill, Bud b. Bob, Bud, Boo c. Bill, Bud, Boo d. Boo, Bud, Bill Which of the followings are applications of queue data structure? A. Buffer B. Scheduling C. Drill-and-Practice problem in class D. Back-up keyExplanation / Answer
Answers:
1)
nameQueue.enqueue(Sid)
Queue :Sid
nameQueue.enqueue(Sal)
Queue :Sid Sal
nameQueue.enqueue(Sue)
Queue :Sid Sal Sue
nameQueue.enqueue(Sam)
Queue :Sid Sal Sue Sam
nameQueue.dequeue()
Queue :Sal Sue Sam
display(nameQueue.Front()) : Sal (option b)
2)
nameQueue.enqueue(Bob)
Queue : Bob
nameQueue.enqueue(Bill)
Queue : Bob Bill
nameQueue.enqueue(Bud)
Queue : Bob Bill Bud
nameQueue.dequeue()
Queue : Bill Bud
nameQueue.enqueue(Boo)
Queue : Bill Bud Boo
front of queue listed leftmost : Bill, Bud, Boo (option c)
3)
Applications of queue data structure : Scheduling , Buffers (option A,B)
4)
queue is best ADT for queue forming at bakery or ticket counters.(option a)
5)
queue is best ADT for queue correcting typing errors by backspace key (option a)
6)
root node has no parent.(option b )
7)
the node that is directly above node n in a tree is called parent of node n.
8)
each node has Atmost two children in binary tree
9)
maximum height of binary tree of n nodes is n/2
10)
minimum height is log(n+1)
11)
height : 4
24+1-1 = 25 -1 = 32-1 = 31
12)
collision
13)
false : it clusters slow
14)
true
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.