Skip to main content
Code Review

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.

Filter by
Sorted by
Tagged with
5 votes
2 answers
479 views

For another project of mine, I decided that it would be handy to have a tree structure to dictate hierarchy between pieces of data, but I didn't want to unnecessarily keep that data alive if it would ...
2 votes
0 answers
81 views

I'm working my way through Structure and Interpretation of Computer Programs and got to exercises 2.27-2.28, reproduced here: Exercise 2.27. Modify your reverse procedure of exercise 2.18 to produce ...
Luke's user avatar
  • 21
6 votes
2 answers
89 views

In different code bases I regularly encounter tree data structures of different design and usually need to traverse it at some point. I finally got tired of writing yet another iterative traversal by ...
besc's user avatar
  • 163
2 votes
1 answer
106 views

I've implemented an AA Tree (a type of self-balancing binary search tree) using Numba, a just-in-time compiler for Python. This implementation includes rank and select operations, which are useful for ...
7 votes
3 answers
786 views

I have been studying intermediate or more advanced data structures in Python, one of which I've decided to try out is the Tree Data Structure. I've been studying the theories as well as the ...
5 votes
1 answer
136 views

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 ...
1 vote
0 answers
129 views

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
146 views

scikit-learn's decision tree structure is difficult for me to navigate. I would prefer to have functionality like tree.left, ...
6 votes
3 answers
559 views

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
706 views

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 ...
Slav's user avatar
  • 121
2 votes
3 answers
181 views

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 ...
8 votes
3 answers
1k views

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 have been coding in Python ...
2 votes
1 answer
110 views

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
68 views

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
100 views

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 ...

15 30 50 per page
1
2 3 4 5
...
60

AltStyle によって変換されたページ (->オリジナル) /