GoConqr has a new look! Let us know what you think.

Quiz

Design

Zara Klak 45 questions

Take the quiz

Questions in this quiz (45)

  1. 1Suppose a stack is to be implemented with a linked list instead of an array. What would be the effect on the time complexity of the push and pop operations of the stack implemented using linked list (assuming stack is implemented efficiently)?
    1. AO(1) for insertion and O(1) for deletion
    2. BO(1) for insertion and O(n) for deletion
    3. CO(n) for insertion and O(n) for deletion
    4. DO(n) for insertion and O(1) for deletion
  2. 2The keys 12,18,13,2,3,23,5 and 15 are inserted into to initially empty hash table of lenght 10 using open addressing with hash function h(k) = k mod 10 and linear probing. What is the resultant hash table?Image for question 2
    1. AC
    2. BA
    3. CB
    4. DD
  3. 3The maximum number of binary trees that can be formed with three untabeled nodes is:
    1. A5
    2. B4
    3. C3
    4. D1
  4. 4A hash table of lenght 10 uses open addressing with hash function h(k)=k mod 10, and linear probing. After inserting 6 values into an empty hash table, the table is as shown below.
    Which one of the following choices gives a possible order in which the key values could have beem inserted in the table?
    Image for question 4
    1. A42,46,33,23,34,52
    2. B46,34,42,23,52,33
    3. C34,42,23,52,33,46
    4. D46,42,34,52,23,33
  5. 5What is the worst case possible height of Red-Black tree? Assume base of Log as 2 in all options
    1. A2log(n+1)
    2. Bостальных вариков не видно, лол, просто запомни 1 правильный ответ
  6. 6Consider the following function that takes reference to head of a Doubly Linked List as a parameter. Assume that a node of doubly linked list has previous pointer as a "prev" and next pointer as a "next".
    Assume that reference of head of following doubly linked list is passed above function 1<->2<->3<->4<->5<->6. What should be the modified linked list after the function call?
    Image for question 6
    1. A5<->4<->3<->2<->1<->6
    2. B2<->1<->4<->3<->6<->5
    3. C6<->5<->4<->3<->1<->2
    4. D6<->5<->4<->3<->2<->1
  7. 7Consider the following nested representation of binary trees indicates y and z are the left right subtrees, respectively, of node x. Note that y and z may be NULL or further nested. Which of the following represents a valid binary tree?
    1. A(1 (2 3 4)(5 6 7))
    2. B(1 (2 3 4)5 6) 7)
    3. C(1 (2 3 NULL)(4 5))
    4. D(1 2(4 5 6 7))
  8. 8In the worst case, the number of comparisons needed to search a singly linked list of length n for a given element is
    1. Alog (2n-1)
    2. Blog 2n
    3. Cn/2
    4. Dn
  9. 9A single array A[1..MAXSIZE] is used to implement two stacks. The two stacks grow from opposite ends of the array. Variables top1 and top2 (top1 < top2) point to the location of the topmost element in each of the stacks. If the space is to be used efficiently, the condition for "stack.full" is
    1. Atop1 = top2-1
    2. B(top1 = MAXSIZE/2) or (top2=MAXSIZE)
    3. Ctop1 + top2 = MAXSIZE
    4. D(top1 = MAXSIZE/2) and (top2 = MAXSIZE/2+1)
  10. 10The height of a binary tree is the maximum number of edges in any root to leaf path. The maximum number of nodes in a binary tree of height h is:
    1. A2*(h+1)
    2. B2^h-1
    3. C2^(h+1)-1
    4. D2^(h-1)-1

Information

Description
Quiz on Design, created by Zara Klak on 30/05/2019.
Author
Zara Klak
Language
English
Views
97
Rating
No ratings yet
Rate this quiz
Rate this quiz

Feedback

What is it about?

What do you think of the new look?

How do you like it?