1. Suppose a circular queue of capacity (n-1) elements is implemented with an array of n elements. Assume that the insertion and deletion operations are carried out using REAR and FRONT as array index variables, respectively. Initially REAR FRONT=0. The conditions to detect queue full and queue is empty are?
A. Full: (REAR+1)mod n == FRONT
Empty: REAR==FRONT
B. Full: (REAR+1)mod n == FRONT
Empty: (FRONT+1) mod n == REAR
C. Full: REAR==FRONT
Empty: (REAR+1) mod n==FRONT
D. Full: (FRONT+1)mod n==REAR
Empty: REAR==FRONT
Answer: B. Full: (REAR+1) mod n==FRONT
Empty: (FRONT+1) mod n==REAR
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: D. All of the above
3. Which of the following is true about linked list implementation of queue?
A. In push operation, if new nodes are inserted at the beginning of linked list, then in pop operation, nodes must be removed from end.
B. In push operation, if new nodes are inserted at the end, then in pop operation, nodes must be removed from the beginning.
C. Both of the above
D. None of the above
Answer: B. In push operation, if new nodes are inserted at the end, then in pop operation, nodes must be removed from the beginning
4. Which class is used to design the base class?
A. abstract class
B. derived class
C. base class
D. None of the mentioned
Answer: A. abstract class
5. Which is also called as abstract class?
A. virtual function
B. pure virtual function
C. derived class
D. None of the mentioned
Answer: B. pure virtual function
Other Related Questions
1. Pick out the correct option. A. We cannot make an instance of an abstract base class B. We can make an instance of an abstract base class C. Both a & b D. None of the mentioned View Answer Answer: A. We cannot make an instance of an abstract base class Hide Answer 2. Where does the abstract class is used? A. base class only B. derived class C …
1. Suppose a circular queue of capacity (n-1) elements is implemented with an array of n elements. Assume that the insertion and deletion operations are carried out using REAR and FRONT as array index variables, respectively. Initially REAR FRONT=0. The conditions to detect queue full and queue is empty are? A. Full: (REAR+1)mod n == FRONT Empty: REAR==FRONT B. Full: (REAR+1)mod n == FRONT Empty: (FRONT+1) mod n == REAR …
1. Which is used to define the member of a class externally? Α. : B. :: C. # D. None of the mentioned View Answer Answer: B. :: Hide Answer 2. Which of the following is a valid class declaration? A. class A { int x; }; B. class B { } C. public class A{} D. object A { int x; }; View Answer Answer: A. class A {int …
1. Heap is an example of A. complete binary tree B. spanning tree C. sparse tree D. binary search tree View Answer Answer: A. complete binary tree Hide Answer 2. Which of the following is not derived data type in c? A. Array B. Pointer C. Struct D. Enum View Answer Answer: D. Enum Hide Answer 3. Which of the following approach help us understand better about Real time examples, …
1. The complexity of searching an element from a set of n elements using Binary search algorithm is A. O(n) B. O(log n) C. O(n2) D. O(n log n) View Answer Answer: B. O(log n) Hide Answer 2. What is not true about insertion sort? A. Exhibits the worst case performance when the initial array is sorted in reverse order. B. Worst case and average case performance is O(n2) C …
1. A______is a linear list in which insertions and deletions are made from either end of the structure. A. circular queue B. random of queue C. priority D. dequeuer View Answer Answer: D. dequeuer Hide Answer 2. Linked lists are not suitable to for the implementation of? A. Insertion sort B. Radix sort C. Polynomial manipulation D. Binary search View Answer Answer: D. Binary search Hide Answer 3. A characteristic …
1. Items in a priority queue are entered in a________order A. random B. order of priority C. as and when they come D. None of above View Answer Answer: B. order of priority Hide Answer 2. In a heap, element with the greatest key is always in the________node. A. leaf B. root C. first node of left sub tree D. first node of right sub tree View Answer Answer: B …
1. The insertion operation in the stack is called_____ A. insert B. push C. pop D. top View Answer Answer: B. push Hide Answer 2. ________ is the term used to insert an element into stack. A. push B. pull C. pop D. pump View Answer Answer: A. push Hide Answer 3. What will be the output of the program given below in 16-bit platform? #include <stdio.h> int main() { …