mirror of
https://github.com/xfarrow/lasd.git
synced 2025-06-05 21:49:14 +02:00
Library 3
cleaner code
This commit is contained in:
@ -1,7 +1,8 @@
|
||||
|
||||
namespace lasd {
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* ----- begin of struct NodeVec ----- */
|
||||
|
||||
template <typename Data>
|
||||
BinaryTreeVec<Data>::NodeVec::NodeVec(Data& dat, ulong idx, BinaryTreeVec<Data>* ref){
|
||||
data = dat;
|
||||
@ -64,6 +65,10 @@ struct BinaryTree<Data>::Node& BinaryTreeVec<Data>::NodeVec::RightChild() const{
|
||||
throw std::out_of_range("Right child does not exist!");
|
||||
}
|
||||
|
||||
/* ----- end of struct NodeVec ----- */
|
||||
|
||||
/* ----- begin of class BinaryTreeVec ----- */
|
||||
|
||||
template <typename Data>
|
||||
BinaryTreeVec<Data>::BinaryTreeVec(const LinearContainer<Data>& lc){
|
||||
tree.Resize(lc.Size());
|
||||
@ -137,6 +142,7 @@ bool BinaryTreeVec<Data>::operator!=(const BinaryTreeVec& bt) const noexcept{
|
||||
|
||||
template <typename Data>
|
||||
struct BinaryTree<Data>::Node& BinaryTreeVec<Data>::Root() const{
|
||||
if(size==0) throw std::length_error("Empty tree!");
|
||||
return *(tree.Front());
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user