Limitation of binary search, Data Structure & Algorithms

Limitation of Binary Search: -

(i)  The complexity of Binary search is O (log2 n). The complexity is similar irrespective of the position of the element, even if it is not present in the array.

(ii)  The algorithm supposes that one has direct access to middle element in the list on a sub list. This means that the list must be kept in some type of array. Unfortunately inserting an element in an array requires element to be moved down the list and deleting an element from an array needs element to be moved up the list.

(iii) The list must be sorted.

 

 

Posted Date: 5/11/2013 1:37:35 AM | Location : United States







Related Discussions:- Limitation of binary search, Assignment Help, Ask Question on Limitation of binary search, Get Answer, Expert's Help, Limitation of binary search Discussions

Write discussion on Limitation of binary search
Your posts are moderated
Related Questions
Colouring The use of colours in CAD/CAM has two main objectives : facilitate creating geometry and display images. Colours can be used in geometric construction. In this case,

Worst Case: For running time, Worst case running time is an upper bound with any input. This guarantees that, irrespective of the type of input, the algorithm will not take any lo

Explain the Arrays in Ruby Ruby arrays are dynamic arrays which expand automatically whenever a value is stored in a location beyond current end of the array. To the programmer

Deletion in a RBT uses two main processes, namely, Procedure 1: This is utilized to delete an element in a given Red-Black Tree. It involves the method of deletion utilized in

Define Strictly Binary Tree Strictly Binary Tree: - If each non leaf node in binary tree has non empty left and right sub-trees , then the tree is known as a strictly binary t

Determine about the logic gates Many electronic circuits operate using binary logic gates. Logic gates essentially process signals that represent true or false or equivalent i.

In this example, suppose the statements are simple unless illustrious otherwise. if-then-else statements if (cond) { sequence of statements 1 } else { sequence of st

1) preorder, postorder and inorder 2) The main feature of a Binary Search Tree is that all of the elements whose values is less than the root reside into the nodes of left subtr

Can a Queue be shown by circular linked list with only single pointer pointing to the tail of the queue? Yes a Queue can be shown by a circular linked list with only single p

Q. Explain various graph traversal schemes and write their advantages and disadvantages. A n s . Graph Traversal Scheme is explained below In many troubles we wish