Skip to content

Conversation

@Nikitapande
Copy link

#include <bits/stdc++.h>
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;

}

ShivamDubey7 and others added 27 commits October 17, 2020 14:35
Added Fast exponentiation
Adding Fast Exponentiation: both recursive and iterative method
Added Recursive BinarySeach
Refactored BubbleSort to proper location
Added Iterative exponentiation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants