TL;DR: It is proved that the Stern-Brocot tree can be linearised looplessly into Stern's diatonic sequence (also known as Dijkstra’s fusc function) and that it is a permutation of the Bird tree.
Abstract: The Stern-Brocot tree contains all rational numbers exactly once and in their lowest terms. We formalise the Stern-Brocot tree as a coinductive tree using recursive and iterative specifications, which we have proven equivalent, and show that it indeed contains all the numbers as stated. Following Hinze, we prove that the Stern-Brocot tree can be linearised looplessly into Stern’s diatonic sequence (also known as Dijkstra’s fusc function) and that it is a permutation of the Bird tree. The reasoning stays at an abstract level by appealing to the uniqueness of solutions of guarded recursive equations and lifting algebraic laws point-wise to trees and streams using applicative functors.
TL;DR: A new algorithm for deleting a node from an HB(k) tree is presented, whose main idea is to process certain subtrees from above to below first and then to delete the node, instead of relating to the backtracking from below to above.
Abstract: The main idea of Foster's algorithm for deleting a node from an HB(k) tree is to delete the node first and then to process certain subtrees from below to above,relating to the backtracking from below to above.A new algorithm for deleting a node from an HB(k) tree is presented,whose main idea is to process certain subtrees from above to below first and then to delete the node,instead of relating to the backtracking from below to above.The execution of the new algorithm is illustrated by an example.The new algorithm is proved correct.Compared with Foster's algorithm for deleting a node from an HB(k) tree,the new algorithm does not relate to the use of an auxiliary stack.Let n be the number of nodes of an HB(k) tree.The time complexity of the new algorithm is O(log2n),and it is the same as that of Foster's algorithm for deleting a node from an HB(k) tree.Experimental results show that the average execution time of the new algorithm is shorter than that of Foster's algorithm for deleting a node from an HB(k) tree.The space complexity of the new algorithm is O(1),and it is lower than that of Foster's algorithm for deleting a node from an HB(k) tree.
TL;DR: A new algorithm builds a balanced k-d tree by presorting the data in each of k dimensions prior to building the tree, then preserves the order of the k presorts during recursive subdivision of the data and builds the tree in O(kn log n) time.
Abstract: The original description of the k-d tree recognized that rebalancing techniques, such as are used to build an AVL tree or a red-black tree, are not applicable to a k-d tree. Hence, in order to build a balanced k-d tree, it is necessary to obtain all of the data prior to building the tree then to build the tree via recursive subdivision of the data. One algorithm for building a balanced k-d tree finds the median of the data for each recursive subdivision of the data and builds the tree in O(n log n) time. A new algorithm builds a balanced k-d tree by presorting the data in each of k dimensions prior to building the tree, then preserves the order of the k presorts during recursive subdivision of the data and builds the tree in O(kn log n) time. This new algorithm is amenable to execution via MapReduce and permits building and searching a k-d tree that is represented as a distributed graph.