What requirement is placed on an array, so thatbinary searchmay be used to locate an entry?
1.The array must be sorted.
2.The array must have at least 2 entries.
3.The array’s size must be a power of two.
2) Determine the Big O( ) notation for the following:
(m + n)(10n3 + 50n)
O(mn3+ n4)
O(mn4+ n3)
What is the right code for the following method:
Mystery(x) : counts the number of x occurrences in a linked list with head reference on the first node in the list.
int Mystery( int x){
int count = 0;
Node current = head;
while(current != null){
if( current.element == x)
count++;
current = current.next;
}
return current;
return count;
while(current.next != null){
O(nm4+ m3)
O(nm3+ m4)
If both pointers of the node in a binary tree are NULL then it will be a/an _______ .
Root node
Leaf node
Inner node
None of the given options
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here