Data Structures And Algorithms (Ucs408 And Ucs613)

10 Questions | Total Attempts: 24

SettingsSettingsSettings
Please wait...
Data Structures And Algorithms (Ucs408 And Ucs613)

Each question contains equal marks. Time: 10 Mins Maximum Marks: 10


Questions and Answers
  • 1. 
    The worst case complexity of bubble sort is ____________.
    • A. 

      O(nlogn)

    • B. 

      O(logn)

    • C. 

      O(n)

    • D. 

      O(n2)

  • 2. 
    Given the value of the size of the stack, STACK_SIZE is 10; what is the value of the top pointer?
    • A. 

      10

    • B. 

      9

    • C. 

      11

    • D. 

      12

    • E. 

      None

  • 3. 
    How many iterations will be required to sort the following array, arr={4,5,7,6} using bubble sort algorithm?
    • A. 

      4

    • B. 

      2

    • C. 

      1

    • D. 

      0

  • 4. 
    ___________  datastructure is appropriate to elicite hierarchical relationship between items.
    • A. 

      Graph

    • B. 

      Tree

    • C. 

      Linked List

    • D. 

      Priority Queue

  • 5. 
    The binary Search algorithm is based on
    • A. 

      Brute Force Technique

    • B. 

      Divide and Conqure

    • C. 

      Greedy Algorithm

    • D. 

      Dynamic Programming

  • 6. 
    Following is true about linked list over array:
    • 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. 

      The size of array has to be pre-decided, linked lists can change their size any time.

    • E. 

      All of the above

  • 7. 
    The queue doesn't support the following operation
    • A. 

      Insertion

    • B. 

      Deletion

    • C. 

      Retrieval

    • D. 

      Traversal

  • 8. 
    The first node is given (head of the linked list); What does the following function do?   void fun1(struct node* head) { if(head == NULL) return; fun1(head->next); printf("%d ", head->data); }
    • A. 

      Prints all nodes of linked lists

    • B. 

      Prints all nodes of linked list in reverse order

    • C. 

      Prints alternate nodes of Linked List

    • D. 

      Prints alternate nodes in reverse order

  • 9. 
    What will be the Output of the following code?  
    • A. 

      Value of jRef: 20, Value of j: 25  

    • B. 

      Value of jRef: 25, Value of j: 20  

    • C. 

      Value of jRef: 20, Value of j: 20  

    • D. 

      Value of jRef: 25, Value of j: 25  

  • 10. 
    Following is/are the differences between References and Pointers:
    • A. 

      No null references as pointers do

    • B. 

      A reference is bound to its initializer for its whole lifetime, pointers don’t

    • C. 

      A reference must be initialized after object is created, pointers can be initialized any time

    • D. 

      All of the above

Back to Top Back to top