Priority search tree
In computer science, a priority search tree is a tree data structure for storing points in two dimensions.[src] It was originally introduced by Edward M.[src] McCreight.[src] It is effectively an extension of the priority queue with the purpose of improving the search time from O(n) to O(s + log n) time, where n is the number of points in the tree and s is the number of points returned by the search.[src]
In computer science, a priority search tree is a tree data structure for storing points in two dimensions.[src] It was originally introduced by Edward M.[src] McCreight.[src] It is effectively an extension of the priority queue with the purpose of improving the search time from O(n) to O(s + log n) time, where n is the number of points in the tree and s is the number of points returned by the search.[src] tree construct_tree(data) { if length(data) > 1 { node_point = find_point_with_minimum_priority(data) // Select the point with the lowest priority reduced_data = remove_point_from_data(data, node_point) node_key = calculate_median(reduced_data) // calculate median, excluding the selected point // Divide the points left_data = [] right_data = [] for (point in reduced_data) { if point.key However, if the points are sorted by their key values then the tree can be constructed in linear time.[src] This can easily be done by constructing a balanced binary tree over the key values (as leaves) in linear time.[src] Each internal node stores a pointer to the lowest priority node and count of number of items in the subtree rooted at that node.[src] Thus, the node with minimum priority can be identified in constant time.[src] The median of remaining points and the item with next smallest priority can be identified in O(log n) time.[src] Thus, the recurrence relation is T(n)=2T(n/2)+O(log n)=O(n).[src] points search_tree(tree, min_key, max_key, max_priority) { root = get_root_node(tree) result = [] if get_child_count(root) > 0 { if get_point_priority(root) > max_priority return null // Nothing interesting will exist in this branch.[src] Return if min_key[src]
16 sentences · 16 cited inline · 0 references stored
References
No reference rows published for this article.
Cite this article
MLA
"Priority search tree." encyclopegia.org, 2026, https://encyclopegia.org/wiki/priority-search-tree. Accessed 30 November 2026.
Chicago
"Priority search tree." encyclopegia.org. Accessed November 30, 2026. https://encyclopegia.org/wiki/priority-search-tree.
APA
encyclopegia.org. (2026). Priority search tree. Retrieved November 30, 2026, from https://encyclopegia.org/wiki/priority-search-tree
Accessed November 30, 2026 · CC BY-SA 4.0 · citation page · JSON