Online Test On Algorithms And Data Structures - Icttrends-dsa-01

50 Questions | Total Attempts: 1842

SettingsSettingsSettings
Please wait...
Online Test On Algorithms And Data Structures - Icttrends-dsa-01

ICTTRENDS-DSA-01FM: 50 PM: 30 Time: 1 hrAttempt All of the following questions. Each question carry equal markAttempt online MCQ test on Data Structures and Algorithms presented by ICT TRENDS (www. Icttrends. Com). Questions presented here suits the level for Higher Secondary or Bachelors in Computer Science or BCA, BIT, BSc IT and competitive exams like Computer Officer, IT Officer. Confused on any question? Check https://icttrends. Com/dsa-mcq-set-1/ for explanations on these questions. Visit Data Structures And Algorithms on PS Exam


Questions and Answers
  • 1. 
    In linked lists there are no NULL links in
    • A. 

      Single linked list

    • B. 

      Linear doubly linked list

    • C. 

      Circular linked list

    • D. 

      None of these

  • 2. 
    In a stack the command to access nth element from the top of the stack S will be
    • A. 

      S [Top-n]

    • B. 

      S [Top+n]

    • C. 

      S [Top-n-1]

    • D. 

      None of the above

  • 3. 
    If yyy, xxx and zzz are the elements of a lexically ordered binary tree, then in preorder traversal which node will be traverse first
    • A. 

      Xxx

    • B. 

      Yyy

    • C. 

      Zzz

    • D. 

      Can not be determined

  • 4. 
    In a balance binary tree the height of two sub trees of every node can not differ by more than
    • A. 

      2

    • B. 

      1

    • C. 

      0

    • D. 

      3

  • 5. 
    The result of evaluating prefix expression */b+0dacd, where a=3, b=6, c=1, d=5 is
    • A. 

      0

    • B. 

      5

    • C. 

      10

    • D. 

      15

  • 6. 
    In array representation of binary tree teh right child of root will be at location of
    • A. 

      2

    • B. 

      5

    • C. 

      3

    • D. 

      0

  • 7. 
    The total number of comparisons in a bubble sort is
    • A. 

      O(n logn)

    • B. 

      O(2n)

    • C. 

      O(n2)

    • D. 

      None of above

  • 8. 
    IThe dummy header in linked list contain
    • A. 

      First record of the actual data

    • B. 

      Last record of the actual data

    • C. 

      Pointer to the last record of the actual data

    • D. 

      None of above

  • 9. 
    Write the output of following program:int a[ ] = {1,2,3,} *p;
    • A. 

      3

    • B. 

      Junk value

    • C. 

      Run time error

    • D. 

      Address of the third element

  • 10. 
    If the out degree of every node is exactly equal to M or 0 and the num ber of nodes at level K is Mk-1 [con sider root at level 1], then tree is called as  (i) Full m-ary try(ii) Com plete m-ary tree(iii)Positional m-ary tree
    • A. 

      Only (i)

    • B. 

      Only (ii)

    • C. 

      Both (i) and (ii)

    • D. 

      Both (ii) and (III)

  • 11. 
    In the following tree:If post order traversal generates sequence xy-zw*+, then label of nodes 1,2,3,4,5,6,7 will be
    • A. 

      +, -, *, x, y, z, w

    • B. 

      X, -, y, +, z, *, w

    • C. 

      X, y, z, w, -, *, +

    • D. 

      -, x, y, +, *, z, w

  • 12. 
    If the following tree is used for sorting, then a new number 10 should be placed at
    • A. 

      Right child of node labeled 7

    • B. 

      Left child of node labeled 7

    • C. 

      Left child of node labeled 14

    • D. 

      Right child of node labeled 8

  • 13. 
    A queue has configuration a,b,c,d. To get configuration d,c,b,a. One needs a minimum of 
    • A. 

      2 deletion and 3 additions

    • B. 

      3 deletions and 2 additions

    • C. 

      3 deletions and 3 additions

    • D. 

      3 deletions and 4 additions

  • 14. 
    Number of possible ordered trees with 3 nodes A,B,C is
    • A. 

      16

    • B. 

      12

    • C. 

      6

    • D. 

      10

  • 15. 
    Number of swapping, operations need to sort numbers 8, 22, 7, 9, 31, 19, 5, 13 in ascending order using bubble sort
    • A. 

      11

    • B. 

      12

    • C. 

      13

    • D. 

      14

  • 16. 
    • A. 

      L1,L2

    • B. 

      Max(L1,L2)

    • C. 

      Min(L1,L2)

    • D. 

      L1+L2-1

  • 17. 
    A hash tabale with 10 buckets with one slot per bucket is depicted in following diagram. Symbols S1 to S7 are initially entered using a hashing function with linear probing. Maximum number of comparisions needed in searching an item that is not present is 
    • A. 

      4

    • B. 

      5

    • C. 

      6

    • D. 

      3

  • 18. 
    Following sequence of operation is performed on a stack. Push(1), Push(2), Pop, Push(1), Push(2), Pop, Pop, Pop, Push(2), Pop. The sequences of popped out values are
    • A. 

      2,2,1,2,2

    • B. 

      2,2,1,1,2

    • C. 

      2,1,2,2,1

    • D. 

      2,1,2,2,2

  • 19. 
    A binary tree in which every non-leaf node has non-empty left and right sub trees is called a strictly binary tree. Such a tree with 10 leaves
    • A. 

      Has 19 nodes

    • B. 

      Has 16 nodes

    • C. 

      Has 15 nodes

    • D. 

      None of the above

  • 20. 
    Depth of a binary tree with n node is
    • A. 

      Log (n +1) - 1

    • B. 

      Log (n)

    • C. 

      Log (n -1)n -1

    • D. 

      Log (n) + 1

  • 21. 
    To arrange a binary tree in ascending order we need 
    • A. 

      Post order traversal

    • B. 

      Inorder traversal

    • C. 

      Preorder traversal

    • D. 

      None of above

  • 22. 
    Average successful search time taken by binary search on sorted array of 10 items is
    • A. 

      2.6

    • B. 

      2.7

    • C. 

      2.8

    • D. 

      2.9

  • 23. 
    Hash function f is defined as f(key) = key mod 7. If linear probing is used to insert the key 37, 38, 72, 48, 98, 11, 56 into a table indexed from 0 to 6,  11 will be stored at the location
    • A. 

      3

    • B. 

      4

    • C. 

      5

    • D. 

      6

  • 24. 
    Average successful search time for sequential search on 'n' item is 
    • A. 

      N/2

    • B. 

      (n-1)/2

    • C. 

      (n+1)/2

    • D. 

      Log (n) + 1

  • 25. 
    Running time of an algorithm T(n), where n is input size is given by T(n) = 8 T(n/2) + qn, if n>1 T(n) = p, if, n=1 where p and q are constants. The order of algorithm is
    • A. 

      N2

    • B. 

      Nn

    • C. 

      N3

    • D. 

      N