binary-search-tree
Is there strong reason not to include multiple node pointers in a node to use in more than one data structure?
Take for example the assignment I\'m working on.We\'re to use a binary search tree for one piece of a set of data and then a linked list for another piece in the set. The suggested method by the profe[详细]
2023-02-16 00:28 分类:问答Implement a map of strings
I have to implement a class that behaves like a map of strings using binary search tree. This is the class I implemented:[详细]
2023-02-15 08:02 分类:问答calculate Internal path length of a BST only from preorder or postorder traversal
Hello StackOverflow community! I am trying to figure out how to calculate the internal path length of BST given only the preorder or postorder traversal (it shouldn\'t make much difference) without c[详细]
2023-02-13 08:07 分类:问答Concrete examples of using binary search trees?
I understand how binary search trees are implemented, but I am not sure what are the advantages of using it over the hash tables that most p开发者_运维知识库rogramming languages have built into their[详细]
2023-02-11 05:10 分类:问答How can I check if a BST is valid?
How can I check if a BST is a valid one, given its definition and using a generalized version of fold for BST?[详细]
2023-02-09 23:29 分类:问答balanced binary search tree using sortedset
Please help I\'ve been trying to generate a random binary search tree of size 1024 and the elements needs to be random sortedset ... I\'m able to write a code to c开发者_如何学编程reate a binary searc[详细]
2023-02-06 02:09 分类:问答How to Serialize Binary Tree
I went to an interview today where I was asked to serialize a binary tree. I implemented an array-based approach where the children of node i (numbering in level-order traversal) were at the 2*i index[详细]
2023-02-03 06:35 分类:问答Pre-order to post-order traversal
If the pre-order traversal of a binary search 开发者_如何学运维tree is 6, 2, 1, 4, 3, 7, 10, 9, 11, how to get the post-order traversal?You are given the pre-order traversal of the tree, which is cons[详细]
2023-02-01 21:02 分类:问答Binary Search Tree in Scheme, trying to use Dr. Racket to simply return true or false if value is present in BST. Error
I\'m using Dr. Racket, language Pretty Big, and I\'m trying to make a simple binary search tree \"in?\" method, that will return if a value is in the binary search tree or not. It needs to be general,[详细]
2023-01-29 02:25 分类:问答Is there a better way to find lowest common ancestor?
I know similar questions have been asked before, but I think my solution is far simpler. Especially compared to Wikipedia.[详细]
2023-01-22 09:57 分类:问答