Created
May 24, 2017 08:22
-
-
Save StevenJL/561e97ef26be01ed6f203d62aaaff0f8 to your computer and use it in GitHub Desktop.
c_notes_struct_pointer_2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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