When.com Web Search

Search results

  1. Results From The WOW.Com Content Network
  2. Binary search - Wikipedia

    en.wikipedia.org/wiki/Binary_search

    Binary search Visualization of the binary search algorithm where 7 is the target value Class Search algorithm Data structure Array Worst-case performance O (log n) Best-case performance O (1) Average performance O (log n) Worst-case space complexity O (1) Optimal Yes In computer science, binary search, also known as half-interval search, logarithmic search, or binary chop, is a search ...

  3. Binary search tree - Wikipedia

    en.wikipedia.org/wiki/Binary_search_tree

    Since the search may proceed till some leaf node, the running time complexity of BST search is () where is the height of the tree. However, the worst case for BST search is O ( n ) {\displaystyle O(n)} where n {\displaystyle n} is the total number of nodes in the BST, because an unbalanced BST may degenerate to a linked list.

  4. Best, worst and average case - Wikipedia

    en.wikipedia.org/wiki/Best,_worst_and_average_case

    But given a worst-case input, its performance degrades to O(n 2). Also, when implemented with the "shortest first" policy, the worst-case space complexity is instead bounded by O(log(n)). Heapsort has O(n) time when all elements are the same. Heapify takes O(n) time and then removing elements from the heap is O(1) time for each of the n elements.

  5. AVL tree - Wikipedia

    en.wikipedia.org/wiki/AVL_tree

    Time complexity; Function: Amortized: Worst case: Search ... It is the first self-balancing binary search tree data structure to be invented. [3]

  6. B-tree - Wikipedia

    en.wikipedia.org/wiki/B-tree

    Time complexity in big O notation ... Worst case: Search: O(log n) O(log n ... The auxiliary indices have turned the search problem from a binary search requiring ...

  7. Search tree - Wikipedia

    en.wikipedia.org/wiki/Search_tree

    For all nodes, the left subtree's key must be less than the node's key, and the right subtree's key must be greater than the node's key. These subtrees must all qualify as binary search trees. The worst-case time complexity for searching a binary search tree is the height of the tree, which can be as small as O(log n) for a tree with n elements.

  8. k-d tree - Wikipedia

    en.wikipedia.org/wiki/K-d_tree

    Building a static k-d tree from n points has the following worst-case complexity: O(n log 2 n) if an O(n log n) sort such as Heapsort or Mergesort is used to find the median at each level of the nascent tree; O(n log n) if an O(n) median of medians algorithm [5] [6] is used to select the median at each level of the nascent tree;

  9. Tree sort - Wikipedia

    en.wikipedia.org/wiki/Tree_sort

    Expected O(n log n) time can however be achieved by shuffling the array, but this does not help for equal items. The worst-case behaviour can be improved by using a self-balancing binary search tree. Using such a tree, the algorithm has an O(n log n) worst-case performance, thus being degree-optimal for a comparison sort.