Data Structures B

40 Questions | Attempts: 204
Share

SettingsSettingsSettings
Data Structures B - Quiz

Questions and Answers
  • 1. 

    What is Non-linear data structure

    • A.

      Tree

    • B.

      Stack

    • C.

      Linked-list

    • D.

      Array

    Correct Answer
    A. Tree
  • 2. 

    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

    Correct Answer
    C. Circular linked list
  • 3. 

    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

    Correct Answer
    A. S [Top-n]
  • 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

    Correct Answer
    B. 1
  • 5. 

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

    • A.

      0

    • B.

      5

    • C.

      10

    • D.

      15

    Correct Answer
    C. 10
  • 6. 

    In array representation of binary tree the right child of root will be at location of

    • A.

      2

    • B.

      5

    • C.

      3

    • D.

      0

    Correct Answer
    A. 2
  • 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

    Correct Answer
    C. O(n2)
  • 8. 

    The 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

    Correct Answer
    D. None of above
  • 9. 

    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

    Correct Answer
    C. 3 deletions and 3 additions
  • 10. 

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

    • A.

      16

    • B.

      12

    • C.

      6

    • D.

      10

    Correct Answer
    C. 6
  • 11. 

    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

    Correct Answer
    C. 13
  • 12. 

    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

    Correct Answer
    A. 4
  • 13. 

    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

    Correct Answer
    B. 2,2,1,1,2
  • 14. 

    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

    Correct Answer
    A. Has 19 nodes
  • 15. 

    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

    Correct Answer
    A. Log (n +1) - 1
  • 16. 

    To arrange a binary search tree in ascending order we need 

    • A.

      Post order traversal

    • B.

      Inorder traversal

    • C.

      Preorder traversal

    • D.

      None of above

    Correct Answer
    B. Inorder traversal
  • 17. 

    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

    Correct Answer
    D. 2.9
  • 18. 

    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

    Correct Answer
    C. 5
  • 19. 

    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

    Correct Answer
    C. (n+1)/2
  • 20. 

    An algorithm consists of two modules X1, X2. Their order is f(n) and g(n), respectively. The order of algorithm is

    • A.

      Max(f(n),g(n))

    • B.

      Min(f(n),g(n))

    • C.

      F(n)+g(n)

    • D.

      F(n)*g(n)

    Correct Answer
    A. Max(f(n),g(n))
  • 21. 

    Bib O notation w.r.t algorithm signifies

    • A.

      It decides the best algorithm to solve a problem

    • B.

      It determines maximum size of a problem, that can be solved in given system in given time

    • C.

      It is the lower bound of growth rate of algorithm

    • D.

      None of the above

    Correct Answer
    D. None of the above
  • 22. 

    Running time T(n), where 'n' is input size of recursive algorithm is given as follows:T(n) = c + T(n-1), if n>1,T(n) = d if n<1. The order of algorithm is

    • A.

      N2

    • B.

      N

    • C.

      N3

    • D.

      Nn

    Correct Answer
    B. N
  • 23. 

    Four algorithm A1, A2, A3, A4 solves a problem with order log(n), log log(n), nlog(n), n. Which is best algorithm

    • A.

      A1

    • B.

      A2

    • C.

      A3

    • D.

      A4

    Correct Answer
    A. A1
  • 24. 

    Arranging a pack of cards by picking one by one is an example of

    • A.

      Bubble sort

    • B.

      Selection sort

    • C.

      Insertion sort

    • D.

      Merge sort

    Correct Answer
    C. Insertion sort
  • 25. 

    In evaluating arithmatic expression 2*3-(4+5) using postfix stack form. Which of the following stack configuration is not possible

    • A.

      -------Top--| 4 | 6 |------------

    • B.

      ------Top--| 5 | 4 | 6 |------------

    • C.

      -------Top--| 9 | 6 |------------

    • D.

      ------Top--| 9 | 3 | 2 |------------

    Correct Answer
    D. ------Top--| 9 | 3 | 2 |------------
  • 26. 

    To arrange the books of library the best method is

    • A.

      Bubble sort

    • B.

      Quick sort

    • C.

      Merge sort

    • D.

      Heap sort

    Correct Answer
    D. Heap sort
  • 27. 

    The information about an array used in a program will be stored in

    • A.

      Symbol table

    • B.

      Dope vector

    • C.

      Register vector

    • D.

      Activation table

    Correct Answer
    B. Dope vector
  • 28. 

    In which of the following cases linked list implementaion of sparse matrices consumes same memory as a normal array

    • A.

      5 x 6 matrix with 9 non-zero entries

    • B.

      5 x 6 matrix with 8 non-zero entries

    • C.

      6 x 5 matrix with 8 non-zero entries

    • D.

      6 x 5 matrix with 9 non-zero entries

    Correct Answer
    C. 6 x 5 matrix with 8 non-zero entries
  • 29. 

    On which principle does stack work?

    • A.

      FILO

    • B.

      FIFO

    • C.

      LIFO

    • D.

      Both a and c above

    Correct Answer
    A. FILO
  • 30. 

    The order of binary search algorithm is

    • A.

      N

    • B.

      N2

    • C.

      N log n

    • D.

      Log n

    Correct Answer
    D. Log n
  • 31. 

    The Worst case occur in linear search algorithm when

    • A.

      Item is somewhere in the middle of the array

    • B.

      Item is not in the array at all

    • C.

      Item is the last element in the array

    • D.

      Item is the last element in the array or is not there at all

    Correct Answer
    D. Item is the last element in the array or is not there at all
  • 32. 

    Arrays are best data structures

    • A.

      For relatively permanent collections of data

    • B.

      For the size of the structure and the data in the structure are constantly changing

    • C.

      For both of above situation

    • D.

      For none of above situation

    Correct Answer
    A. For relatively permanent collections of data
  • 33. 

    Linked lists are best suited

    • A.

      For relatively permanent collections of data

    • B.

      for the size of the structure and the data in the structure are constantly changing

    • C.

      For both of above situation

    • D.

      For none of above situation

    Correct Answer
    B. for the size of the structure and the data in the structure are constantly changing
  • 34. 

    The elements of an array are stored successively in memory cells because

    • A.

      By this way computer can keep track only the address of the first element and the addresses of other elements can be calculated

    • B.

      the architecture of computer memory does not allow arrays to store other than serially

    • C.

      Both of above

    • D.

      None of above

    Correct Answer
    A. By this way computer can keep track only the address of the first element and the addresses of other elements can be calculated
  • 35. 

    Under which condition circular queue is Full

    • A.

      Front=-1

    • B.

      Front=(rear+1)%maxsize

    • C.

      Front=(front+1)%maxsize

    • D.

      Rear=(rear+1)%maxsize

    Correct Answer
    B. Front=(rear+1)%maxsize
  • 36. 

    Which is not application of stack

    • A.

      Reversal of string

    • B.

      Evaluation of arithimatic operation

    • C.

      Real operating system

    • D.

      Recursion

    Correct Answer
    C. Real operating system
  • 37. 

    A leaf node have degree

    • A.

      1

    • B.

      2

    • C.

      0

    • D.

      3

    Correct Answer
    C. 0
  • 38. 

    The value of structure is resizing during run time by using

    • A.

      Malloc

    • B.

      Calloc

    • C.

      Free

    • D.

      Realloc

    Correct Answer
    D. Realloc
  • 39. 

    How many types of queue's are available

    • A.

      0

    • B.

      1

    • C.

      2

    • D.

      4

    Correct Answer
    D. 4
  • 40. 

    Disadvantage of linear queue is overcome by using

    • A.

      Link list

    • B.

      Circular queue

    • C.

      Stack

    • D.

      Double ended queue

    Correct Answer
    B. Circular queue

Quiz Review Timeline +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 18, 2022
    Quiz Edited by
    ProProfs Editorial Team
  • Nov 26, 2013
    Quiz Created by
    Seelak123
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.