💩

programierds

C / Binary Search Tree (BST) Simulation

Binary Trees
step by step

See graphically how nodes are created and connected in a BST using recursion, followed by an in-order traversal.

1) Code & Execution Context main()
1struct Nodo* insertar(struct Nodo* raiz, int valor) {
2  if (raiz == NULL) {
3    return crearNodo(valor);
4  }
5  if (valor < raiz->dato) {
6    raiz->izquierdo = insertar(raiz->izquierdo, valor);
7  } else if (valor > raiz->dato) {
8    raiz->derecho = insertar(raiz->derecho, valor);
9  }
10  return raiz;
11}
Paso 1: ...
Step 1 / 19
2) Visual Tree Representation // BST
50 30 70 40
3) Memory & Scope State
Parameter: valor-
Parameter: raiz-
Comparison / Action-
4) Standard Output (stdout)
./arboles-binarios-demostdout
[ BACK TO DIRECTORY ]