Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upadded OOP approach for BST #966
Conversation
lgtm-com
bot
commented
Jul 21, 2020
|
This pull request introduces 4 alerts when merging e94f7f0 into 8d68e61 - view on LGTM.com new alerts:
|
|
Thank you for your contribution
|
|
Ok. I will make the changes. |
Thank you. Please review code in this file as well for reference. |
|
Thank you for your contribution. 1. Document what functions do, and what parameters do. |
|
|
||
| #include<bits/stdc++.h> | ||
| #include<queue> | ||
| using namespace std; |
This comment has been minimized.
This comment has been minimized.
| * \Object Oriented approach | ||
| */ | ||
|
|
||
| #include<bits/stdc++.h> |
This comment has been minimized.
This comment has been minimized.
Panquesito7
Jul 21, 2020
Member
Don't use this library as it slows down the compilation process and is quite Linux-specified.
| #include<queue> | ||
| using namespace std; | ||
|
|
||
| struct node { |
This comment has been minimized.
This comment has been minimized.
| root = NULL; | ||
| } | ||
|
|
||
| void insert(int data){ |
This comment has been minimized.
This comment has been minimized.
| void insert(int data){ | ||
| node *newnode = new node; | ||
| newnode->value = data; | ||
| newnode->left = NULL; |
This comment has been minimized.
This comment has been minimized.
| return current; | ||
| } | ||
|
|
||
| node *deleteNode(node *current, int target){ |
This comment has been minimized.
This comment has been minimized.
| } | ||
| }; | ||
|
|
||
| int main() { |
This comment has been minimized.
This comment has been minimized.
| break; | ||
| case 6: | ||
| BST.postOrder(BST.getRoot()); | ||
| break; |
This comment has been minimized.
This comment has been minimized.
| } | ||
|
|
||
| void insert(int data){ | ||
| node *newnode = new node; |
This comment has been minimized.
This comment has been minimized.
| /** | ||
| * \file | ||
| * \brief A simple tree implementation using structured nodes | ||
| * \Object Oriented approach | ||
| */ |
This comment has been minimized.
This comment has been minimized.
|
Please fix |
Please, avoid posting multiple reviews until at least one of them is complete. Multiple reviews confuse the authors and create an unnecessary branching of fixes. |
|
Hi @kvedala @Panquesito7 , I have updated the PR, there are couple of errors and warnings for destructor method and deletion of node. Can you please guide me. |
|
Thank you for the fixes, @Dharni0607. While the documentation fixes still remain, please note the following concerning the errors reported by the CI:
class BinarySearchTree {
public:
BinarySearchTree(BinarySearchTree const&) = delete;
BinarySearchTree& operator =(BinarySearchTree const&) = delete;
}as class member functions
Without the use of smart pointers, the implementation is so rudimentary that it can be implemented almost verbatim as a C program. |
068f8c4
to
26eebec
|
The error mentions that either
|
…into issue_#777
BinarySearchTree(BinarySearchTree const&&) = delete;
|
|
@Dharni0607 open the Gitpod link above and open the file you added. If you are still a bit confused, I can make a review fixing various |


Dharni0607 commentedJul 21, 2020
•
edited by gitpod-io bot
Added object oriented approach for BST. Please review and let me know if any changes are required.