minor fixes for indented bst print
This commit is contained in:
parent
def78cb76f
commit
466c09b944
@ -28,7 +28,7 @@ public:
|
|||||||
|
|
||||||
void postOrder(void visit(const T&)) const { _postorder(visit, root); }
|
void postOrder(void visit(const T&)) const { _postorder(visit, root); }
|
||||||
|
|
||||||
void printTree(void visit(const T&, int)) const { _printTree(visit, rootPtr, 1); }
|
void printTree(void visit(const T&, int)) const { _printTree(visit, root, 1); }
|
||||||
|
|
||||||
// abstract functions to be implemented by derived class
|
// abstract functions to be implemented by derived class
|
||||||
virtual void insert(const T& newData) = 0;
|
virtual void insert(const T& newData) = 0;
|
||||||
@ -99,7 +99,7 @@ template<class T>
|
|||||||
void BinaryTree<T>::_printTree(void visit(const T&, int), BinaryTreeNode<T>* nodePtr, int level) const
|
void BinaryTree<T>::_printTree(void visit(const T&, int), BinaryTreeNode<T>* nodePtr, int level) const
|
||||||
{
|
{
|
||||||
if (nodePtr) {
|
if (nodePtr) {
|
||||||
ItemType item = nodePtr->getItem();
|
T item = nodePtr->getItem();
|
||||||
visit(item, level);
|
visit(item, level);
|
||||||
_printTree(visit, nodePtr->getRightPtr(), level + 1);
|
_printTree(visit, nodePtr->getRightPtr(), level + 1);
|
||||||
_printTree(visit, nodePtr->getLeftPtr(), level + 1);
|
_printTree(visit, nodePtr->getLeftPtr(), level + 1);
|
||||||
|
2
CPU.h
2
CPU.h
@ -74,7 +74,7 @@ public:
|
|||||||
|
|
||||||
void display(const CPU &cpu);
|
void display(const CPU &cpu);
|
||||||
|
|
||||||
void iDisplay(const string &cpuId, int level);
|
void iDisplay(const std::string &cpuId, int level);
|
||||||
|
|
||||||
void rowDisplay(const CPU &cpu, const std::vector<int> &widths);
|
void rowDisplay(const CPU &cpu, const std::vector<int> &widths);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user