N-ary Tree Tutorial and Code Review: N-ary Tree creation N-ary Tree node insertion N-ary Tree node verification N-ary Tree node freeing github path for files: https://github.com/johndspence/n_trees.git files: ntree_insert.c, path_exists.c, and ntree_free.c Files should be compiled on Ubuntu 14.04 LTS, using gcc (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4 Holberton School 20160816 John Spence
Overview • This presentation demonstrates how to create an N-ary Tree/insert a new node, validate if a node exists, and finally “free” the N-ary Tree. “N tree” and “N-ary tree” are used interchangeably in this presentation. • The code was written in C, for ubuntu 14.04. • Source files are here: https://github.com/johndspence/n_trees.git • This presentation was given in the context of a code review for the Holberton School in San Francisco. • The tasks themselves were written by Alex Gautier: https://github.com/Mattrack
Task 0: N Tree Insert
Task 0: N Tree Insert (example)
Task 0: N Tree Insert (Expected Output)
Complete n-tree
4 Scenarios that ntree_insert traversal logic must address
Insert a new node into the n-tree
Insert a new node into the n-tree: codeTask 0: N Tree Insert (Code)
Task 1: Determine if an N Tree path/node exists
Task 1: Determine if an N Tree path/node exists (example)
Task 1: Determine if an N Tree path/node exists (Expected Output)
Determine if a path exists using: path_exists in an n-tree
Determine if a path exists in a n-tree: code
Task 2: Free an N Tree
Free an n-tree
Free an n-tree: code

N-ary Trees for C Programming Language

  • 1.
    N-ary Tree Tutorialand Code Review: N-ary Tree creation N-ary Tree node insertion N-ary Tree node verification N-ary Tree node freeing github path for files: https://github.com/johndspence/n_trees.git files: ntree_insert.c, path_exists.c, and ntree_free.c Files should be compiled on Ubuntu 14.04 LTS, using gcc (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4 Holberton School 20160816 John Spence
  • 2.
    Overview • This presentationdemonstrates how to create an N-ary Tree/insert a new node, validate if a node exists, and finally “free” the N-ary Tree. “N tree” and “N-ary tree” are used interchangeably in this presentation. • The code was written in C, for ubuntu 14.04. • Source files are here: https://github.com/johndspence/n_trees.git • This presentation was given in the context of a code review for the Holberton School in San Francisco. • The tasks themselves were written by Alex Gautier: https://github.com/Mattrack
  • 3.
    Task 0: NTree Insert
  • 4.
    Task 0: NTree Insert (example)
  • 5.
    Task 0: NTree Insert (Expected Output)
  • 6.
  • 7.
    4 Scenarios thatntree_insert traversal logic must address
  • 8.
    Insert a newnode into the n-tree
  • 9.
    Insert a newnode into the n-tree: codeTask 0: N Tree Insert (Code)
  • 10.
    Task 1: Determineif an N Tree path/node exists
  • 11.
    Task 1: Determineif an N Tree path/node exists (example)
  • 12.
    Task 1: Determineif an N Tree path/node exists (Expected Output)
  • 13.
    Determine if apath exists using: path_exists in an n-tree
  • 14.
    Determine if apath exists in a n-tree: code
  • 15.
    Task 2: Freean N Tree
  • 16.
  • 17.