Skip to content

Instantly share code, notes, and snippets.

@StevenJL
Created May 24, 2017 08:22
Show Gist options
  • Save StevenJL/561e97ef26be01ed6f203d62aaaff0f8 to your computer and use it in GitHub Desktop.
Save StevenJL/561e97ef26be01ed6f203d62aaaff0f8 to your computer and use it in GitHub Desktop.
c_notes_struct_pointer_2
// a binary search tree can be implemented using structs with
// pointers to other structs as members.
struct bin_tree_node
{
int value;
struct bin_tree_node *left_child, *right_child;
};
struct tree_node node1, node2, node3, node4;
node1.value = 10;
node2.value = 5;
node3.value = 15;
node4.value = 12
node1.left_child = &node2;
node1.right_child = &node3;
node3.left_child = &node4;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment