Monday, June 12, 2017

Upwork DATA STRUCTURES TEST 2018

Hello Freelancer, Get the DATA STRUCTURES TEST of Latest version 2018. We are ready here to provide your desire upwork test answer. We already tested all exam test information Available include on here. So Dear, Why Late? Read the below full exam test and get more information from our website. 
Upwork DATA STRUCTURES TEST 2016

1. Which graph traversal algorithm uses a queue to keep track of the vertices which need to be processed?

Answers:
  1. Breadth-first search
  2. Depth-first search
2. A simple graph with n vertices and k components can have at the most _______.
Answers:
  1. n edges
  2. n-k edges
  3. (n-k)(n-k-1)/2 edges
  4. (n-k)(n-k+1)/2 edges
3. What is the minimum number of edges which must be removed from a complete bipartite graph of six nodes K(6) so that the remaining graph is a planar?
Answers:
  1. 2
  2. 3
  3. 4
  4. 6
4. Which feature of heaps allows them to be efficiently implemented using a partially filled array?
Answers:
  1. Heaps are binary search trees
  2. Heaps are complete binary trees
  3. Heaps are full binary trees
  4. Heaps contain only integer data
5. What happens if you make a recursive call without making the problem smaller?
Answers:
  1. The operating system detects the infinite recursion because of the “repeated state”
  2. The program keeps running until you press Ctrl-C
  3. The results are non-deterministic
  4. The run-time stack overflows, halting the program
6. Tree algorithms typically run in time O(d) . What is d?
Answers:
  1. The depth of the tree
  2. The number of divisions at each level
  3. The number of nodes in the tree
  4. The total number of entries in all the nodes of the tree
7. Here is a code for an integer variable n
while (n > 0)
{
n = n/10; // Use integer division
}
What is the worst case scenario analysis for the above loop?
Answers:
  1. O(1)
  2. O(log n)
  3. O(n)
  4. O(n2)
8. Suppose we have a circular array implementation of a queue, with ten items in the queue stored at data[2] through data[11]. The CAPACITY is 42. Where does the push member function place the new entry in the array?
Answers:
  1. data[1]
  2. data[2]
  3. data[11]
  4. data[12]
9. Which of the following sorting algorithms yield approximately the same worst-case and average-case running time behavior in O(n*log(n))?
Answers:
  1. Bubble sort and selection sort
  2. Heap sort and merge sort
  3. Quick sort and radix sort
  4. Tree sort and Median-of-3 quicksort
10. The operation for adding an entry to a stack is traditionally called ________.
Answers:
  1. add
  2. append
  3. insert
  4. push
11. For a complete binary tree with depth d, the total number of nodes is:
Answers:
  1. 2d+1
  2. 2d
  3. 2d-1
  4. 2d2
12. Which of the following is false?
Answers:
  1. A binary search begins with the middle element in the array
  2. A binary search continues halving the array either until a match is found or until there are no more elements to search
  3. If the search argument is greater than the value located in the middle of the binary, the binary search continues in the lower half of the array
13. Which of the following applications may use a stack?
Answers:
  1. A parentheses balancing program
  2. Keeping track of local variables at run time
  3. Syntax analyzer for a compiler
  4. All of the above
14. What is the value of the post-fix expression 6 3 2 4 + – *?
Answers:
  1. Something between -15 and -100
  2. Something between -5 and -15
  3. Something between 5 and 15
  4. Something between 15 and 100
15. The minimum number of interchanges needed to convert the array 89,19,14,40,17,12,10,2,5,7,11,6,9,70 into a heap with the maximum element at the root is:
Answers:
  1. 0
  2. 1
  3. 2
  4. 3
16. Suppose T is a complete binary tree with 14 nodes. What would be the minimum possible depth of T?
Answers:
  1. 0
  2. 3
  3. 4
  4. 5
17. In which data structure do the insertion and deletion take place at the same end?
Answers:
  1. Linked list
  2. Tree
  3. Stack
  4. Linked list of stack
18. What is the formulae to find maximum number of nodes n in a perfect binary tree?
Answers:
  1. 2h + 1 – 1
  2. 2h + 1
  3. 2h
  4. 2h + 1 + 1
19. A chained hash table has an array size of 512. What is the maximum number of entries that can be placed in the table?
Answers:
  1. 511
  2. 512
  3. 1024
  4. There is no maximum limit
20. In which dynamically created linked list can the first node be recovered after moving to the second node?
Answers:
  1. Simple linked list
  2. Circular linked list
  3. Doubly linked list
  4. Both b and c
21. What is the best definition of a collision in a hash table?
Answers:
  1. Two entries are identical except for their keys
  2. Two entries with different data have exactly the same key
  3. Two entries with different keys have exactly the same hash value
  4. Two entries with exactly the same key have different hash values
22. What is the pre-order traversal equivalent of the following algebraic expression?
[a+(b-c)]*[(d-e)/(f+g-h)]
Answers:
  1. abc-+de-fg+h-/*
  2. *+a-bc/-de-+fgh
  3. a+*b-/c-d-e+fgh
  4. *+a-bc-/d+e-fgh
23. A sparse matrix can be a lower-triangular matrix when____.
Answers:
  1. all the non-zero elements lie only on the leading diagonal
  2. all the non-zero elements lie above the leading diagonal
  3. all the non-zero elements lie below the leading diagonal
  4. None of the above
24. A graph in which all nodes are of an equal degree is known as:
Answers:
  1. Multigraph
  2. Non – regular graph
  3. Regular graph
  4. Complete graph
25. What is the maximum number of statements that may be recursive calls in a single function declaration?
Answers:
  1. 1
  2. 2
  3. n (n is the argument)
  4. There is no fixed maximum
26. Which additional requirement is placed on an array so that binary search may be used to locate an entry?
Answers:
  1. The array elements must form a heap
  2. The array must have at least 2 entries
  3. The array must be sorted
  4. The array’s size must be a power of two
27. What is the worst-case scenario for heapsort to sort an array of n elements?
Answers:
  1. O(log n)
  2. O(n)
  3. O(n log n)
  4. O(n2)
28. The recurrence relation T(n)=mT(n/2)+an2 is satisfied by___
Answers:
  1. T(n)=O(nm)
  2. T(n)=O(m*log(m))
  3. T(n)=O(n*log(m))
  4. T(n)=O(m*log(n))
29. If ‘data’ is a circular array of CAPACITY elements and ‘last’ is an index in that array, what is the formula for the index after ‘last’?
Answers:
  1. (last % 1) + CAPACITY
  2. last % (1 + CAPACITY)
  3. (last + 1) % CAPACITY
  4. last + (1 % CAPACITY)
30. Consider the node of a complete binary tree whose value is stored in data[i] for an array implementation. If this node has a right child, where will the right child’s value be stored (the array’s first index is 0)?
Answers:
  1. data[i+1]
  2. data[i+2]
  3. data[2*i + 1]
  4. data[2*i + 2]
31. In a complete binary tree, the parent of any node k can be determined by ________.
Answers:
  1. 2k
  2. 2k+1
  3. K/2
  4. 2K-1
32. Consider a linked list of n elements which is pointed by an external pointer. What is the time taken to delete the element which is a successor of the pointed element by a given pointer?
Answers:
  1. O(1)
  2. O(log2n)
  3. O(n)
  4. O(n*log2n)
33. Suppose X is a B-tree leaf containing 41 entries and has at least one sibling. Which of the statements would be true in this case?
Answers:
  1. Any sibling of X is also a leaf
  2. Any sibling of X contains at least 41 entries
  3. The parent of X has exactly 42 entries
  4. X has at least 41 siblings
34. In a complete binary tree of n nodes, how far are the most distant two nodes? Assume each in the path counts 1. Assume log(n) is log base 2.
Answers:
  1. about log(n)
  2. about 2*log(n)
  3. about 3*log(n)
  4. about 4*log(n)
35. In a graph G, F is a spanning forest of G if
(i)F is a subgraph of G containing all the nodes of G
(ii)F is an order forest containing trees T1,T2,…Tn
(iii)Ti contains all the nodes that are reachable in G from the root Ti and are contained in Tj for some j<i..
Which of the above conditions is/are true?
Answers:
  1. (i),(ii)
  2. (ii),(iii)
  3. (i),(iii)
  4. (i),(ii) and (iii)
36. Which information is not saved in the activation record when a function call is executed?
Answers:
  1. Current depth of recursion
  2. Formal parameters
  3. Location where the function should return when done
  4. Local variables
37. The linked list implementation of sparse matrices is superior to the generalized dope vector method because it is __________.
Answers:
  1. conceptually easier and completely dynamic
  2. efficient if the sparse matrix is a band matrix
  3. efficient in accessing an entry
  4. all of these
38. Which situation occurs frequently if the selected hash function is poor?
Answers:
  1. Overflow
  2. Underflow
  3. Collision
  4. None of the above
39. The post-order traversal of a binary tree starts with:
Answers:
  1. Post-order traversal of the left sub tree
  2. Post-order traversal of the right sub tree
  3. Post-order traversal of the root
  4. Post-order traversal of the lowest node
40. One difference between a queue and a stack is:
Answers:
  1. Queues require dynamic memory but stacks do not
  2. Stacks require dynamic memory but queues do not
  3. Queues use two ends of the structure but stacks use only one
  4. Stacks use two ends of the structure but queues use only one
41. What is the minimum number of nodes in a full binary tree with depth 3?
Answers:
  1. 4
  2. 8
  3. 11
  4. 15
42. Using which traversal in a sorted binary insertion tree can a sorted array of numbers be obtained?
Answers:
  1. Pre-order traversal
  2. Post-order traversal
  3. In order traversal
  4. Top-down traversal
43. Where does the push member function place the new entry on the linked list in the linked list implementation of a queue?
Answers:
  1. At the head
  2. At the tail
  3. After all other entries that are greater than the new entry
  4. After all other entries that are smaller than the new entry
44. Which term is used to describe an O(n) algorithm?
Answers:
  1. Constant
  2. Linear
  3. Logarithmic
  4. Quadratic
45. What is the minimum number of nodes in a complete binary tree with depth 3?
Answers:
  1. 4
  2. 8
  3. 11
  4. 15
46. What is true of the complete bipartite graphs K(3,3) and K(2,4)?
Answers:
  1. Both are planar
  2. Neither is a planar
  3. Both are isomorphic
  4. None of these
47. If X is the adjacency matrix of a graph G with no self loops, the entries along the principle diagonal of X are ______.
Answers:
  1. all zeros
  2. all ones
  3. both zeros and ones
  4. different
48. Consider a linked list implementation of a queue with two pointers: front and rear. The time needed to insert element in a queue of length n is:
Answers:
  1. O(1)
  2. O(log2n)
  3. O(n)
  4. O(n*log2n)
49. What is the worst-case scenario for mergesort to sort an array of n elements?
Answers:
  1. O(log n)
  2. O(n)
  3. O(n log n)
  4. O(n2)
50. Consider a hashing function that resolves collision by quadratic probing. Assume that the address space is indexed from 1 to 8. If a collision occurs at position 4, the location which will never be probed is:
Answers:
  1. 4
  2. 5
  3. 8
  4. 2
51. In which data structure is the concept of rotation used?
Answers:
  1. Binary search tree
  2. Circular queue
  3. AVL tree
  4. Circular linked list
52. You have implemented a queue with a circular array keeping track of the first, the last, and the count (the number of items in the array). Suppose the first is zero, and the last is CAPACITY-1, what can you say about the count?
Answers:
  1. The count must be zero
  2. The count must be CAPACITY
  3. The count can be zero or CAPACITY, but no other value can occur
  4. None of the above
53. A procedure that calls itself in a program is called _______.
Answers:
  1. Repeat
  2. Loop
  3. Recursion
  4. Tree
54. State whether True or False.
For all possible inputs, a linear algorithm to solve a problem must perform faster than a quadratic algorithm to solve the same problem.
Answers:
  1. True
  2. False
55. If a max heap is implemented using a partially filled array called data, and the array contains n elements (n > 0), where is the entry with the greatest value?
Answers:
  1. data[0]
  2. data[n-1]
  3. data[n]
  4. data[2*n + 1]
56. What is the worst-case scenario for quicksort to sort an array of n elements?
Answers:
  1. O(log n)
  2. O(n)
  3. O(n log n)
  4. O(n2)
57. Which of the following lines of the code will delete two successive nodes of a single linked linear list(with more than two nodes)? Here ‘LINK[X]’ denotes the address field of node X.
Answers:
  1. LINK[X]:=LINK[LINK[X]]
  2. X:=LINK[LINK[X]]
  3. LINK[LINK[X]]:=X
  4. LINK[X]:=LINK[LINK[LINK[X]]]
58. A non- planar graph with the minimum number of vertices has:
Answers:
  1. 10 edges, 5 vertices
  2. 9 edges, 6 vertices
  3. 6 edges, 4 vertices
  4. 9 edges, 5 vertices
59. A circuit which is a connected graph and which includes every vertex of the graph is known as_____.
Answers:
  1. Euler
  2. Unicursal
  3. Hamiltonian
  4. Clique
60. A one dimensional array A has indices 1…75. Each element is a string and takes up three memory words. The array is stored starting at location 1120 decimal. The starting address of A[49] is:
Answers:
  1. 1267
  2. 1164
  3. 1264
  4. 1169
61. A simple graph in which there exists an edge between every pair of vertices is called a/an _________.
Answers:
  1. incomplete graph
  2. complete graph
  3. Euler graph
  4. planner graph
62. Let A be a sorted array of n=10 elements. Assume that only one comparison is required to determine whether the target is equal to, less than, or greater than A[i]. Which of the following denotes the average successful time of finding an arbitrary element x in A using the binary search?
Answers:
  1. 1.6
  2. 2.9
  3. 4.2
  4. 5.5
63. Which operations require linear time for their worst-case behavior in the linked-list version of a queue?
Answers:
  1. front
  2. push
  3. empty
  4. None of these operations require linear time
64. Which of the following statements about binary trees is false?
Answers:
  1. Every Node must have at least two children
  2. Every non-empty tree has exactly one root node
  3. Every node has at the most two children
  4. None of the above
65. How many real links are required for a sparse matrix having 10 rows, 10 columns and 15 non-zero elements? (Pick the nearest answer)
Answers:
  1. 15
  2. 20
  3. 50
  4. 100
66. In a graph G having the cut set matrix C(G) and an incidence matrix A(G), the rank of C(G) would be____
Answers:
  1. The same as that of A(G)
  2. More than that of A(G)
  3. Less than that of A(G)
  4. Independent of the rank of A(G)
67. Which of the operations is simpler in the doubly linked list than it is in the simple linked list?
Answers:
  1. Insertion
  2. Deletion
  3. Both a and b
  4. None of the above
68. Which of the following formulae in big-Oh notation best represents the expression n2+35n+6?
Answers:
  1. O(n3)
  2. O(n2)
  3. O(n)
  4. O(42)
69. The operation for removing an entry from a stack is traditionally called _______.
Answers:
  1. delete
  2. peek
  3. pop
  4. remove
70. Which queue allows insertion and deletion at both ends?
Answers:
  1. Simple queue
  2. Circular queue
  3. Dequeue
  4. Special queue
71. What kind of initialization needs to be done for a chained hash table?
Answers:
  1. None
  2. The key at each array location must be initialized
  3. The head pointer of each chain must be set to NULL
  4. Both B and C must be carried out
72. The number of nodes in the largest maximal independent set of the complete bipartite graph K(4,2) is_____ .
Answers:
  1. 2
  2. 3
  3. 4
  4. 6
73. Which of the following techniques is used to resolve collision in hashing?
Answers:
  1. Separate chaining
  2. Open addressing
  3. Linear probing
  4. All of the above
74. You have implemented a queue with a linked list keeping track of a front pointer and a rear pointer. Which of these pointers will you change during an insertion into a NONEMPTY queue?
Answers:
  1. Neither of them changes
  2. Only front_ptr changes
  3. Only rear_ptr changes
  4. Both change
75. Which of the following operations is performed more efficiently by the doubly linked list than by the linear linked list?
Answers:
  1. Deleting a node the location of which is given
  2. Searching an unsorted list for a given item
  3. Inserting a node after the node with a given location
  4. Traversing the list to process each node
76. Four characters are placed in a queue in the following order: D, C, B, and A. If they are removed one at a time, what will be the order of their removal?
Answers:
  1. ABCD
  2. ABDC
  3. DCAB
  4. DCBA
77. What is the meaning of the statement: “Entries in a stack are ‘ordered'”?
Answers:
  1. A collection of stacks can be sorted
  2. Stack entries may be compared with the ‘<‘ operation
  3. The entries must be stored in a linked list
  4. There is a first entry, a second entry, and so on
78. A given connected graph G is a Euler graph if and only if all vertices of G are of ______.
Answers:
  1. the same degree
  2. even degrees
  3. odd degrees
  4. different degrees
79. Which of the following data structures has a balanced condition?
Answers:
  1. AVL Tree
  2. Doubly Linked List
  3. Double Ended Queue
  4. Stack
80. A matrix is called sparse when______
Answers:
  1. most of its elements are non-zero
  2. most of its elements are zero
  3. all of its elements are non-zero
  4. None of the above
81. Which of the following operations in the simple linked list will modify the beginning of the linked list?
Answers:
  1. Deletion of the first node
  2. Insertion after the last node
  3. Insertion after the first node
  4. None of the above
82. You have implemented a queue with a circular array keeping track of the first item, the last item, and the count (the number of items in the array). Suppose the address of the first is zero, and that of the last is CAPACITY-1, what can you say about the count?
Answers:
  1. The count must be zero
  2. The count must be CAPACITY
  3. The count can be zero or CAPACITY, but no other value can occur
  4. None of the above
83. What is the worst-case scenario for the binary search for finding a single item in an array?
Answers:
  1. Constant time
  2. Logarithmic time
  3. Linear time
  4. Quadratic time
84. A binary tree, all the levels of which except possibly the last have the maximum number of nodes and all the nodes at the last level appear as far left as possible, is known as:
Answers:
  1. Full binary tree
  2. 2-Tree
  3. Threaded tree
  4. Complete binary tree
85. What is the pre-order traversal equivalent of the following algebraic expression?
[a+(b-c)]*[(d-e)/(f+(g-h))]
Answers:
  1. abc-+de-fg+h-/*
  2. *+a-bc/-de+f-gh
  3. a+*b-/c-d-e+fgh
  4. *+a-bc-/d+e-fgh
86. In the linked representation of a sparse matrix, the head node for a column list stores_____
Answers:
  1. a pointer to the next column head node
  2. a pointer to the first node in the column list
  3. column number
  4. All of the above
87. The hashing function which dynamically adapts to changes in the table being accessed is called ________.
Answers:
  1. Real
  2. Linear
  3. Partial
  4. Virtual
88. What will happen if in data structure a pop operation on the stack causes the stack pointer to move past the origin of the stack?
Answers:
  1. Overflow
  2. Underflow
  3. Null
  4. Garbage collection
89. If h is the depth of the tree, which formula will be used to find the maximum number of nodes n in a perfect binary tree?
Answers:
  1. 2h + 1 – 1
  2. 2h + 1
  3. 2h
  4. 2h + 1 + 1
90. What is the minimum number of edges and vertices possible in a non- planar graph?
Answers:
  1. 10 edges, 5 vertices
  2. 9 edges, 6 vertices
  3. 6 edges, 4 vertices
  4. 9 edges, 5 vertices
91. Which of the following is the worst-case scenario for operations on heaps?
Answers:
  1. Neither insertion nor removal is better than linear
  2. Insertion is better than linear, but removal is not
  3. Removal is better than linear, but insertion is not
  4. Both insertion and removal are better than linear
92. Which of these are standard operations of Stack Data Structure?
Answers:
  1. Push, delete
  2. Insert, pop
  3. Put, extract
  4. Push, pop
93. Suppose we have a circular array implementation of a queue, with ten items in the queue stored at data[2] through data[11]. The CAPACITY is 42. Where does the enqueue member function place the new entry in the array?
Answers:
  1. data[1]
  2. data[2]
  3. data[11]
  4. data[12]
94. A binary search tree is generated by inserting the following integers in the order: 50,15,62,5,20,58,91,3,8,37,60,24. How many nodes are in the left and right subtrees, respectively?
Answers:
  1. (4,7)
  2. (7,4)
  3. (8,3)
  4. (3,8)
95. What is the worst-case scenario for the binary search for finding a single item in an sorted array?
Answers:
  1. Constant time
  2. Logarithmic time
  3. Linear time
  4. Quadratic time
96. What is the maximum depth of recursive calls a function may make?
Answers:
  1. 1
  2. 2
  3. n (where n is the argument)
  4. There is no fixed maximum
97. Consider this binary search tree.
Which will be the new root if you remove the root and replace it with something from the left subtree?
Answers:
  1. 1
  2. 2
  3. 4
  4. 5
98. The number of distinct simple graphs with up to three nodes is _______.
Answers:
  1. 15
  2. 10
  3. 7
  4. 9
99. In a selection sort algorithm, the number of passes required to perform the sort are ______.
Answers:
  1. N
  2. N-1
  3. N-2
  4. N^2


Finally no more words require about the DATA STRUCTURES TEST  information in this session of this content. If you are require knowing more, Please ask to us via our contact us form or comment box. Please make sure that, you don’t send Personal information via the Comment box.  Thanks for Being with us.

No comments:

Post a Comment