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 an algorithm for finding a key from a sorted list using the binary search technique or method.
Ans.
Binary Search Algorithm is written below
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 [mid -1];
8 else
9 search for X in a [mid + 1] to a [high];
Define Merge Sort Merge sort is a perfect example of a successful application of the divide and conquer method. It sorts a given array A[0...n-l] by separating it into two ha
What is binary search? Binary search is most useful when list is sorted. In binary search, element present in middle of the list is determined. If key (the number to search)
Write an algorithm by using pseudocode which: Inputs top speeds of 5000 cars Outputs fastest speed and the slowest speed Outputs average speed of all the 5000 cars
Example of pre order traversal: Reading of a book, since we do not read next chapter unless we complete all sections of previous chapter & all its sections. Figure : Rea
Define about the Structure - Container - Some containers hold elements in some sort of structure, and some don't. Containers with no structure include bags and sets. Containe
Explain the representations of graph. The different ways of representing a graph is: Adjacency list representation : This representation of graph having of an array Adj of
how multiple stacks can be implemented using one dimensional array
A graph G might be defined as a finite set V of vertices & a set E of edges (pair of connected vertices). The notation utilized is as follows: Graph G = (V, E) Consider the g
To delete an element in the list at the end, we can delete it without any difficult. But, assume if we desire to delete the element at the straining or middle of the list, then, we
give me algorithm of simple interest
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