Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple Tree in C #25

Open
wants to merge 44 commits into
base: maths
Choose a base branch
from
Open

Simple Tree in C #25

wants to merge 44 commits into from

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.

7 participants