void InOrderPrint(BookLink x, FILE *fp){
	if(x != NULL){
		InOrderPrint(x -> left, fp);
		fprintf(fp, "%07d %30s %30s %8.2lf\n", x -> b.key, x -> b.title, x -> b.author, x -> b.price);
		InOrderPrint(x -> right, fp);
	}
}
コード例 #2
0
ファイル: bst.cpp プロジェクト: liuyal/Template-Classes
void BST<T>::InOrderPrint(Node<T>* nd)
{
	if (nd != NULL)
	{
		InOrderPrint(nd->left);
		cout << nd->data << " ";
		InOrderPrint(nd->right);
	}
}
コード例 #3
0
ファイル: prob14942556.cpp プロジェクト: Instigo/CareerCup
// 
// Name: InOrderPrint
//
// Description: Performs an Inorder traversal print of the Binary Tree
// which prints the tree in the following order: Left Subtree, Root, Right Subtree
//
// Argument: root - Pointer to the root node.
//
void InOrderPrint(Node *root){

    if(!root){
        return;
    }

    InOrderPrint(root->left);
    std::cout << root->data << " ";
    InOrderPrint(root->right);
}
コード例 #4
0
ファイル: bst.cpp プロジェクト: liuyal/Template-Classes
void BST<T>::Print()
{
	cout << "Pre Order" << endl;
	PreOrderPrint(root);
	cout << endl << "In Order" << endl;
	InOrderPrint(root);
	cout << endl << "Post Order" << endl;
	PostOrderPrint(root);
}
コード例 #5
0
ファイル: prob14942556.cpp プロジェクト: Instigo/CareerCup
int main(void){
   
    
    InsertItem(&root, 10);
    InsertItem(&root, 8);
    InsertItem(&root, 15);
    InsertItem(&root, 7);
    InsertItem(&root, 9);
    InsertItem(&root, 11);
    InsertItem(&root, 16);

    std::cout << "Original Tree: ";
    InOrderPrint(root);
    std::cout << std::endl;
    std::cout << "Reverse Level Print: ";
    ReverseLevelPrint(root);
    std::cout << std::endl;
    return 0;
}
void InPrint(BST btree, FILE *fp){
	BookLink bl = btree -> root;
	fprintf(fp, "\nThe InOrder Tree Walk Gives:\n");
	InOrderPrint(bl, fp);
}