What does the following Java code do? public Object function() { if(isEmpty()) return -999; else { Object high; high = q[front]; return high; } } a) Dequeue
View QuestionWhat is the term for inserting into a full queue known as?
a) overflow b) underflow c) null pointer exception d) program won’t be ...
View QuestionIn a circular queue, how do you increment the rear end of the queue?
a) rear++ b) (rear+1) % CAPACITY c) (rear % CAPACITY)+1 d) rear– Answer: b Explanation: Ensures rear ...
View QuestionWhich of the following properties is associated with a queue?
a) First In Last Out b) First In First Out c) ...
View QuestionMinimum number of queues to implement stack is ___________
a) 3 b) 4 c) 1 d) 2 Answer: c Explanation: ...
View QuestionWhich of the following data structures can be used for parentheses matching?
a) n-ary tree b) queue c) priority queue d) stack Answer: d Explanation: For every opening ...
View QuestionWhat does ‘stack overflow’ refer to?
a) accessing item from an undefined stack b) adding items to a full stack
View QuestionWhich of the following statements are not correct with respect to Singly Linked List(SLL) and Doubly Linked List(DLL)?
a) Complexity of Insertion and Deletion at known position is O(n) in SLL and O(1) in ...
View QuestionWhat is the best case time complexity of deleting a node in a Singly Linked list?
a) O (n) b) O (n2) c) O (nlogn) d) O (1) Answer: d Explanation: ...
View QuestionArray implementation of Stack is not dynamic, which of the following statements supports this argument?
a) space allocation for array is fixed and cannot be changed during run-time b) user unable to give ...
View Question