Most voted "tree" questions
Tree is a data structure that inherits the characteristics of tree topologies. Conceptually different from the linked lists, in which the data are in a sequence, in the trees the data are arranged hierarchically. If the doubt isn’t about Trees, don’t use this tag, even if you’re using Trees in your project.
Learn more…26 questions
Sort by count of
-
42
votes3
answers6498
viewsHow to model a tree data structure using a relational database?
How to appropriately and efficiently define naturally organized tree-based data in relational databases, considering the physical implications of this? That is, organize in a way that minimizes the…
-
13
votes2
answers699
viewsWhat would be a tree and a forest?
Sometimes here I found here in the OR, questions about trees, graphs and even forests, in the most diverse languages, but In programming, what would a tree be? And what would a forest be? It would…
-
12
votes1
answer517
viewsWhat’s Breadth First and Depth First?
When we are dealing with trees and graphs we find these terms. What do they mean and why are they important in using data structures of these types and algorithms that manipulate them? What I gain…
-
11
votes1
answer601
viewsWhat’s a B tree?
What types of problem is it suitable for? How and why should it be used? It is possible to include an example of code?…
-
10
votes3
answers561
viewsNth value of a binary search tree
I’ve been trying to create a recursive function from the function that lists a binary tree in order. This function would return the term N-th, in order, from a binary search tree. Each node is in…
-
10
votes1
answer187
viewsPersist "pieces" of a tree (large) in parallel
I find myself with the following problem at hand: Goal: Parallelize an ETL process that: Reads from an external interface a tree with an undetermined number of elements. Transforms the…
-
7
votes1
answer146
viewsWhat is Tree Depth and height?
I asked the question What is Breadth First and Depth First?. Perhaps a slightly simpler subject matter would be what are the depth and height of a tree structure. And why this matters in the data…
-
6
votes2
answers934
viewsHow to create an index file using B+ tree
I have a B+ tree that acts as the index of a data file. This index must be saved in an index file. A struct node or node of the B+ tree is: typedef struct node { void ** pointers; int * keys; struct…
-
6
votes1
answer286
viewsWhat is the best way to create a binary tree in C language?
Being a binary tree a set of records that meets certain conditions. I would like to know how best to implement a binary search tree in language C would be using a structure with head or without…
-
6
votes0
answers145
viewsAlgorithm by Christofides - TSP, Problem in transforming the AGM into a graph with all vertices with even degree
I am carrying out the implementation of the algorithm of Christofides and input I receive the data from TSPLIB. Christofides' Algorithm has the following steps: Find the minimum generating tree Find…
-
5
votes1
answer461
viewsRescue all nodes from an Sqlite database tree
I have a serialized tree in my database in the table arvore. Like any good tree, every node can have at most a single parent node. Your data is in this format: id | id_pai | valor…
-
3
votes1
answer691
viewsRemove from binary search tree
Studying BST (binary search tree) did not understand some parts of the code in the function delete of "mycodeschool". That part of the code, more specifically: // Case 1: No child if(root->left…
-
3
votes1
answer101
viewsTree Page - Oracle Apex
I’m having trouble creating a tree page on oracle Apex. I created the page, but the Apex displays the results, but not grouped by the specified node. It is a paid bond ratio. I would like to create…
-
3
votes1
answer108
viewsAre the keys in a knot of a B-Tree in non-decreasing or ascending order?
CRLS (Introduction to the Algorithms, Cormen et al) defines that the keys of a node in a B-Tree must be in non-degressing order (K1 <= K2 <= ... <= Kn). However, as there is no repetition…
-
2
votes0
answers111
viewsDistinguish nodes in a TRIE tree
I have a multi-word TRIE tree (dictionary function), in the node that is the last character of the word I need to have a "type" inside this node. I need to distinguish what kind of word each is, so…
-
2
votes1
answer405
viewsWhat is a balanced tree and what are the advantages of using it?
Well the question is basically this, what is a balanced tree? What differs it from a normal tree, and what are the advantages of using it? A brief description and a use of it is already very…
-
2
votes1
answer376
viewsAlign CSS tree vertically
I’m developing a project where I need to show a family tree. The closest I found was through of this topic. But it’s displaying horizontally. How to change to show vertically? *, *:before, *:after {…
-
2
votes0
answers246
viewsPath in C++ Binary Tree
I’m solving this exercise : http://br.spoj.com/problems/PREEMPOS/, but I do not know the logic of, from the result of the search in a tree of pre-order and order, arriving at the result of…
-
2
votes1
answer188
viewsnome.exe has stopped working. I can’t fix this
My C code gives a crash displaying following po error: filename.exe has stopped working I don’t know how to fix it. Follow the code I’ve already made: #include <stdio.h> #include…
-
2
votes1
answer70
viewsWhy is this C code not working (binary tree)?
Good morning, I’m trying to create a recursive function that traverses a binary tree and finds the largest integer contained in the nodes. My idea is to move to the function the pointer to the node…
-
1
votes0
answers428
viewsCheck whether the tree is AVL or not
Hello, I need to make the function verificaAVL (which is called in case 8, line 364), check whether the tree is AVL or not, that is, if the result of its nodes is -1,0 or 1, it just writes on the…
-
0
votes1
answer125
viewsRead text file and store fields in variables
I need help on the following: I will do a b-tree to present a work at the college, which consists of reading the data from a text file and passing them to the B Tree. I will do as follows: I created…
-
0
votes1
answer334
viewsProblems with binary search tree in C
Now reinstating my post more clearly (this is a continuation of my previous question). In the code, I try to create a binary search tree and insert elements into it. They must be saved in .txt.…
-
0
votes1
answer35
viewsTree b is partitioning the wrong node
I’m having trouble with the b-tree structure, it’s misporting the node and it’s missing some keys. I honestly don’t know what I did wrong. #include <stdio.h> #include <stdlib.h> #define…
-
0
votes0
answers41
viewsBug in AVL tree implementation
I’m trying to implement an AVL tree, but when I call the Inserts function in the main and step some value(int) happens something strange. The first time the if (of the Inserts function) is…
-
-1
votes1
answer62
views