Skip to main content

Questions tagged [trees]

A tree is a hierarchical data structure in which every node is accessed via a unique path that starts at a unique root node. Trees are often used for searching data and optimizing an ordered access to nodes. In the graph theory, a tree is a graph of connect nodes without cycles. Attention: use tag 'trie' for the tree like data structure aiming at string matching (prefix/suffix)

1 vote
1 answer
136 views

Tree impurity of a call graph

In his "Software Engineering. Principles and Practice," H. van Vliet mentions "tree impurity of a call graph." However, the term tree impurity is not used in this meaning anywhere ...
DYZ's user avatar
  • 339
0 votes
0 answers
55 views

How to group together common allowed descendants of a vertex in a tree data data structure?

I created an abstract class to represent a vertex in a tree structure. Later, a requirement was introduced where certain types of vertices are not allowed as descendants of certain other vertices. So ...
Cave Johnson's user avatar
0 votes
4 answers
192 views

implementing an n-ary tree with a single link node

Assume I have a set of nodes of an n-ary tree, packed in a dense array in depth-first order. This tree (I'm showing links between each parent and its list of children): [A] | [B]--[E]--[F] | ...
fearless_fool's user avatar
0 votes
1 answer
172 views

Trie data for searches in time ranges

I am developing an API responsible for returning the distinct searches made on a service given a date prefix. Example data: 2015-08-01 00:00:18 %22http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%...
alves's user avatar
  • 101
0 votes
0 answers
162 views

Is there a known algorithm for reducing a tree based on a list of its leaves?

For a given, tree-like data structure: - Alan - Barbara - Charlie - Cecil - Brian - Chris - Candice - Cohen - Boromir - Corcoran -...
StuperUser's user avatar
  • 6,123
-1 votes
1 answer
315 views

Building a function call tree at runtime

Edit #1 I believe that I misrepresented my intent when writing this question by focusing too much on the issues that have arisen from our misuse/misunderstanding of locks. I am making this edit to try ...
notphilphil's user avatar
4 votes
1 answer
2k views

Understanding usage of quadtree to store location data

I was reading this article, which talks about storing location-based information. The author says that while Latitude and Longitude info for the locations can be stored in a SQL database, retrieving ...
Ufder's user avatar
  • 244
2 votes
2 answers
261 views

What is the best practice for hierarchical container - item relationship in a SQL database?

I am in the process of designing a database organizing real world items in different storage locations. One main principle is that items can contain other items. So the relevant table is: An "...
gaugau's user avatar
  • 311
0 votes
0 answers
66 views

Sentinel nodes in a 2-3 tree

I want to implement a 2-3 tree in C# language, where every leaf has a unique key. The keys are from a given class that implements the IComparable interface (the specific class is unknown, and it's ...
Daniel's user avatar
  • 155
7 votes
2 answers
629 views

some misunderstanding in concept of Huffman algorithm

What is difference between Average length of codes and Average length of codewords in Huffman Algorithm? is both the same meaning? I get stuck in some facts: I see a fact that marked as False: for a ...
Emma Nic.'s user avatar
  • 183
0 votes
2 answers
607 views

Implementing C++ n-ary tree with Boost Graph Library

I would like to have a relatively small and simple tree in C++. Each node would contain an integer. The tree should be traversable both ways. I know it can be done with tree.hh by Kasper Peeters, but ...
Igor's user avatar
  • 1
-1 votes
1 answer
68 views

Efficiently keep different data structures synchronised - tree, list of objects

Problem description I have a pet project to translate TEI XML to standoff JSON and back: https://github.com/standoff-nlp/standoffconverter and I am currently thinking about a rewrite/restructuring. ...
Milla Well's user avatar
1 vote
1 answer
193 views

How to apply Graphs/Trees/BFS/DFS concepts to Lists

I have been doing problems on LeetCode recently, and keep getting stuck on some graph or tree problems. I understand the underlying concepts of Graphs, Trees, and different methods of traversal just ...
Brian C's user avatar
  • 147
-2 votes
1 answer
632 views

Optimal Data Structure for Searching though String

I am current developing a karaoke app in JavaFX, I need advise on the most optimal data structure storing a huge list of songs (library). I am inclined to use Binary Search Trees due to its Big O ...
Lavesh Deepak Panjwani's user avatar
0 votes
3 answers
291 views

How to implement a chain of events on a tree's CRUD operations?

I am working on a project in which I have a tree with 4 layers and the hierarchy is like this. Customer -> Site -> Location -> Guardroom In DB each entity has its own table and the child ...
Ricardo Duran's user avatar

15 30 50 per page
1
2 3 4 5
11