Home / CSE MCQs / Data Structure MCQs :: Data Structure Abstract Data Types

CSE MCQs :: Data Structure MCQs

  1. What is the output of the following piece of code?

    public class array
    {
    public static void main(String args[])
    {
    int []arr = {1,2,3,4,5};
    System.out.println(arr[5]);
    }
    }
  2. A.
    4
    B.
    5
    C.
    ArrayIndexOutOfBoundsException
    D.
    InavlidInputException

    View Answer

    Workspace

    Discuss Discuss in Forum


  3. Choose the code snippet which inserts a node to the head of the list?
  4. A.

    public void insertHead(int data)


    {


    B.

    public void insertHead(int data)


    {


    C.

    public void insertHead(int data)


    {


    D.

    public void insertHead(int data)


    {


    View Answer

    Workspace

    Discuss Discuss in Forum


  5. Which of the following can be used to delete an element from the rear end of the queue?
  6. A.

    public Object deleteRear() throws emptyDEQException


    {


    B.

    public Object deleteRear() throws emptyDEQException


    {


    C.

    public Object deleteRear() throws emptyDEQException


    {


    D.
    None of the mentioned

    View Answer

    Workspace

    Discuss Discuss in Forum


  7. What is the time complexity of inserting a node in a doubly linked list?
  8. A.
    O(nlogn)
    B.
    O(logn)
    C.
    O(n)
    D.
    O(1)

    View Answer

    Workspace

    Discuss Discuss in Forum


  9. What is not a disadvantage of priority scheduling in operating systems?
  10. A.
    A low priority process might have to wait indefinitely for the CPU
    B.
    If the system crashes, the low priority systems may be lost permanently
    C.
    Interrupt handling
    D.
    None of the mentioned

    View Answer

    Workspace

    Discuss Discuss in Forum


  11. A data structure in which elements can be inserted or deleted at/from both the ends but not in the middle is?
  12. A.
    Queue
    B.
    Circular queue
    C.
    Dequeue
    D.
    Priority queue

    View Answer

    Workspace

    Discuss Discuss in Forum


  13. What is the need for a circular queue?
  14. A.
    effective usage of memory
    B.
    easier computations
    C.
    all of the mentioned
    D.
    none of the mentioned

    View Answer

    Workspace

    Discuss Discuss in Forum


  15. In linked list implementation of a queue, from where is the item deleted?
  16. A.
    At the head of link list
    B.
    At the centre position in the link list
    C.
    At the tail of the link list
    D.
    None of the mentioned

    View Answer

    Workspace

    Discuss Discuss in Forum


  17. What would be the asymptotic time complexity to find an element in the linked list?
  18. A.
    O(1)
    B.
    O(n)
    C.
    O(n2)
    D.
    None of the mentioned

    View Answer

    Workspace

    Discuss Discuss in Forum


  19. Which of the following points is/are true about Linked List data structure when it is compared with array
  20. A.
    Arrays have better cache locality that can make them better in terms of performance
    B.
    It is easy to insert and delete elements in Linked List
    C.
    Random access is not allowed in a typical implementation of Linked Lists
    D.
    All of the mentioned

    View Answer

    Workspace

    Discuss Discuss in Forum