🤖 AI Summary
This study addresses the efficient implementation of fundamental binary search tree operations in the graph programming language GP 2. By designing graph programs based on root-preserving graph transformation rules, the authors present the first GP 2 implementation supporting insertion, deletion, and search operations on binary search trees. The approach achieves a worst-case time complexity of O(n) and an expected average-case complexity of O(log n), matching the performance of equivalent implementations in conventional imperative languages. This work not only demonstrates the feasibility of realizing efficient data structures in GP 2 but also extends the applicability of graph transformation-based programming to practical algorithm engineering.
📝 Abstract
We present an approach to implement binary search trees in the rule-based graph programming language GP 2. Our implementation uses GP 2's rooted graph transformation rules to be fast and supports insertion, deletion and query operations. We argue that the worst-case runtime for each of the operations is O(n) for a tree with n nodes. In addition, we expect that, on average, the operations run in time O(log(n)). Hence the implementation would match the time complexity of binary search trees implementations in imperative languages.