chore: Update AVL Tree
Description of Change
Updated AVL Tree data structure using modern C++ STL library features like std::unique_ptr and implemented Object Oriented structure. Also added additional tests and updated existing tests to use assert.
Checklist
- [x] Added description of change
- [x] Added file name matches File name guidelines
- [x] Added tests and example, test must pass
- [x] Added documentation so that the program is self-explanatory and educational - Doxygen guidelines
- [x] Relevant documentation/comments is changed or added
- [x] PR title follows semantic commit guidelines
- [x] Search previous suggestions before making a new one, as yours may be a duplicate.
- [x] I acknowledge that all my contributions will be made under the project's license.
Notes: Completed the following TODO
/**
* \todo update code to use C++ STL library features and OO structure
* \warning This program is a poor implementation and does not utilize any of
* the C++ STL features.
* /
this pr should be put on hold until #2746 merges
Is it necessary to add class names and variables in snake_case as well?
Is it necessary to add class names and variables in snake_case as well?
No, the contributing.md file prefers pascal or camel case last i checked please do check and confirm
Is it necessary to add class names and variables in snake_case as well?
No, the contributing.md file prefers pascal or camel case last i checked please do check and confirm
For classes, variables, and functions, there is no explicit mention of a case preference, although the description below led me to believe that snake_case is preferred.
/**
* @brief Class documentation
*/
class class_name {
private:
int variable; ///< short info of this variable
char *message; ///< short info
public:
// other members should be also documented as below
}
Also, this makes me believe that snake_case is preferred for functions
template <typename T>
bool is_number_on_array(const std::vector<T> &arr, const int &number) {
for (int i = 0; i < sizeof(arr) / sizeof(int); i++) {
if (arr[i] == number) {
return true;
}
else {
// Number not in the current index, keep searching.
}
}
return false;
}
feel free to use snake case instead https://github.com/TheAlgorithms/C-Plus-Plus/discussions/2488 is a discussion worth checking out if you'd like to further make your point
This pull request has been automatically marked as abandoned because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Please ping one of the maintainers once you commit the changes requested or make improvements on the code. If this is not the case and you need some help, feel free to ask for help in our Gitter channel or our Discord server. Thank you for your contributions!