Already have an account? Get multiple benefits of using own account!
Login in your account..!
Remember me
Don't have an account? Create your account in less than a minutes,
Forgot password? how can I recover my password now!
Enter right registered email to receive password!
Q. Write down the algorithm for binary search. Which are the conditions under which sequential search of a list is preferred over the binary search?
Ans.
Algorithm for the Binary Search is as follows
1. if (low> high)
2. return (-1)
3. Mid = (low + high)/2
4. if ( X = = a[mid])
5. return (mid);
6. if (X < a[mid])
7. search for X in a[low] to a[mid-1]
8. else
9. search for X in a[mid+1] to a[high]
Sequential Search is preferred over the binary search when the list is disorder and haphazardly constructed. When searching is to be done on unsorted list then linear search is the only option.
Multiplication Method: The multiplication method operates in 2 steps. In the 1ststep the key value K is multiplied by a constant A in the range O
According to this, key value is divided by any fitting number, generally a prime number, and the division of remainder is utilized as the address for the record. The choice of s
difference between recursion and iteration
State about the pre- and post conditions Programmers can easily document other pre- and post conditions and class invariants, though, and insert code to check most value preco
Q. Explain the basic concept of the primitive data structures. Ans. The concept of P r i m i t i ve Data
Q. Describe the basic concept of binary search technique? Is it more efficient than the sequential search? Ans : The bin ary search technique:- This tec
N = number of rows of the graph D[i[j] = C[i][j] For k from 1 to n Do for i = 1 to n Do for j = 1 to n D[i[j]= minimum( d ij (k-1) ,d ik (k-1) +d kj (k-1)
A Binary Search Tree is binary tree which is either empty or a node having a key value, left child & right child. By analyzing the above definition, we notice that BST comes int
Example of worse case of time
Explain the term totalling To add up a series numbers the subsequent type of statement must be used: Total = total + number This literally means (new) total = (old) t
Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!
whatsapp: +91-977-207-8620
Phone: +91-977-207-8620
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd