Questions tagged [tree]
A tree is a graph in which there is exactly one path between any two nodes. It is often used as a hierarchical data structure.
888
questions
2
votes
0
answers
38
views
Fast and low Memory Requiring Lookup Tree Library
Background
While working on solving the end game of the russian card game Durak I developed a library small_memory_tree to store the simulation results. You can try the game on my website Modern Durak ...
2
votes
1
answer
67
views
Schedule using binary tree in C
I'm trying to organize the code according to the run menu of a schedule using the binary tree data structure because if I search for a user, the menu always appears first, and the listed user is left ...
2
votes
0
answers
85
views
Rust implementation of a BTree
I'm studying rust, and I decided to implement a BTree as a way of learning the language.
Can anyone give me suggestions on the code?
As the language has no inheritance, and we must replace it with ...
5
votes
1
answer
109
views
Making sklearn's decision trees easier to traverse
scikit-learn's decision tree structure is difficult for me to navigate. I would prefer to have functionality like tree.left, ...
5
votes
1
answer
337
views
Leetcode: Largest Number
I was trying out leetcode's Largest Number.
As per the challenge's description:
Given a list of non-negative integers nums, arrange them such that
they form the largest number and return it. Since ...
2
votes
2
answers
660
views
Binary tree deepcopy using the Morris traversal in C
I need to perform a deep copy of a binary tree using the Morris traversal.
I think I managed to do it, that is the code below returns what I expect; however, I am not 100% sure I have covered every ...
1
vote
3
answers
127
views
Maximum Sum BST in a Binary Tree
I was trying to find the Maximum sum BST of a binary tree on LeetCode. While the Java code I have come up with, mostly seems right and is able to pass 55 out of the given 59 test cases too, the error ...
5
votes
2
answers
841
views
Simple tree dictionary structure in C
Good morning, everyone.
I have developed a C library whose goal is to store strings in an easily searchable tree structure (which I have dubbed tree-dictionary). I come from a math background and I ...
2
votes
1
answer
81
views
Semi-dynamic range minimum query (RMQ) tree in Java
Introduction
I have this semi-dynamic range minimum query (RMQ) tree in Java. It is called semi-dynamic due to the fact that it cannot be modified after it is constructed. However, the values ...
3
votes
0
answers
51
views
Assign unique identifiers to binary matrices using a binary tree
Context
I want to build a transposition table where the game states are binary square matrices which size MATRIX_SIZE is known at compile time. Rather than storing ...
4
votes
1
answer
79
views
Hashing a fixed size binary stream with a tree structure in Rust
For a research project, I want to assign a unique identifier to a stream of bits. I can assume that all the streams will always have the same size.
Because of this nice property, my idea has been to ...
2
votes
2
answers
125
views
Binary search tree with Iterators
One more BST implementation with iterators added. Did not manage to find another implementation with iterators and it is my first attempt at implementing them so thought to check on your opinion:
<...
6
votes
2
answers
1k
views
Avoiding memory leaks and using pointers the right way in my binary search tree implementation - C++
I'm learning C++ and I wanted to test my knowledge by implementing a Binary Search Tree using struct (I know, I’m using C++ I should use classes but I want to keep ...
5
votes
2
answers
460
views
Optimizing a node search method given a 2-D spatial point
I have a tree-like structure called grid. I have designed it as a structured numpy array. Each element of grid is a tree-node. ...
3
votes
1
answer
129
views
Parallel semi-sequential bottom-up tree traversal algorithm
I'm trying to traverse a tree-like structure from the bottom-up, and in parallel. Due to some other constraints I also have to allow for thread counts that may be lower than the width of a given set ...