diff --git a/darshit.py b/darshit.py new file mode 100644 index 0000000..18d5b98 --- /dev/null +++ b/darshit.py @@ -0,0 +1,56 @@ +#include +using namespace std; + +struct Node { + int data; + struct Node* left; + struct Node* right; + + // val is the key or the value that + // has to be added to the data part + Node(int val) + { + data = val; + + // Left and right child for node + // will be initialized to null + left = NULL; + right = NULL; + } +}; + +int main() +{ + + /*create root*/ + struct Node* root = new Node(1); + /* following is the tree after above statement + + 1 + / \ + NULL NULL + */ + + root->left = new Node(2); + root->right = new Node(3); + /* 2 and 3 become left and right children of 1 + 1 + / \ + 2 3 + / \ / \ + NULL NULL NULL NULL + */ + + root->left->left = new Node(4); + /* 4 becomes left child of 2 + 1 + / \ + 2 3 + / \ / \ + 4 NULL NULL NULL + / \ + NULL NULL + */ + + return 0; +} diff --git a/test b/test index 3739875..672a553 100644 --- a/test +++ b/test @@ -1 +1,2 @@ -This is my first repo!! +This is my repo!!! +Hello India!!!!