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

Implement AVL tree in c++ #170

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Implement AVL tree in c++ #170

wants to merge 2 commits into from

Conversation

smileybin
Copy link

@smileybin smileybin commented Jun 5, 2018

Submission Checklist

  • Your pull request targets the master branch of the repository.
  • You have only one commit (if not, squash them into one commit).
  • You have read the Contributing guidelines and your changes follow them.

Type of Change

  • Bug fix
  • New implementation

PR Description

Implement AVL tree in c++
It's just base structure that has only two functions( insert, print).

Issue [#169]



public:
AVLNode() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// constructor

data = 0;
mBF = 0;
};
~AVLNode() {};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// destructor


public:

AVLTree() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// constructor

AVLTree() {
root = NULL;
}
~AVLTree() {};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// destructor


if (root == NULL)
{
AVLNode* avlnode = new AVLNode();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// set the new AVLNode by dynamic allocation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants