コード例 #1
0
ファイル: main.c プロジェクト: BaxterStockman/OSU-CS
int main(int argc, char *argv[])
{	
    testAddNode();
    testContainsBSTree();
    testLeftMost();
    testRemoveLeftMost();
    testRemoveNode();
    return 0;
}
コード例 #2
0
ファイル: bst.c プロジェクト: jdorweiler/osu_homework
int main(int argc, char *argv[]){

    testAddNode();
    printf("\n");
    testContainsBSTree();
    printf("\n");
    testLeftMost();
    printf("\n");
    testRemoveLeftMost();
    printf("\n");
    testRemoveNode();
    return 0;
    getch();

}
コード例 #3
0
ファイル: main.c プロジェクト: avisinha1/CS-261
int main(int argc, char *argv[]){	

    /*After implementing your code, please uncommnet the following calls to the test functions and test your code */
    testAddNode();
	
    printf("\n");
    testContainsBSTree();
	
    printf("\n");
    testLeftMost();
	
    printf("\n");
    testRemoveLeftMost();
	
    printf("\n");
    testRemoveNode();
	
    return 0;
}
コード例 #4
0
ファイル: bst.c プロジェクト: KamalChaya/KamalC_code
int main(int argc, char *argv[]){	

   //After implementing your code, please uncommnet the following calls to the test functions and test your code 
	
	/*
	printf("\nTesting first struct using the first compare function...");

	mydata1->name = "ann";
	mydata1->number = 6;
	mydata2->name = "bob";
	mydata2->number = 5;
	mydata3->name = "jill";
	mydata3->number = 7;
	mydata4->name = "jack";
	mydata4->number = 7;

	printf("\nPopulating tree: 6, 5, 7, 7");
	addBSTree(tree, mydata1);
	addBSTree(tree, mydata2);
	addBSTree(tree, mydata3);
	addBSTree(tree, mydata4);

	printf("\nTesting compare() on nodes 6(root) and 5(root->left), should return 1");
	printf("\nbecause 6 > 5");
	if (compare(tree->root->val, tree->root->left->val) == 1)
		printf("\ncompare() works correctly on nodes 6 and 5");
	 
	else 
		printf("\ncompare() doesnt work correctly with nodes 6 and 5");

	printf("\nTesting compare() on nodes 5(root->left), and 7(root->right), should return -1");
	printf("\nbecause 5 < 7");
	if (compare(tree->root->left->val, tree->root->right->val) == -1)
		printf("\ncompare() works correctly on nodes 5 and 7");
	
	else
		printf("\ncompare() doesnt work correctly with nodes 5 and 7");

	printf("\nTesting compare() on nodes 7(root->right) and duplicate 7 (root->right->left), should return 0");
	printf("\nbecause 7 = 7");
	if (compare(tree->root->right->left->val, tree->root->right->val) == 0)
		printf("\ncompare() works correctly on nodes 7 and 7 duplicate");

	else
		printf("\ncompare() does not work correctly on nodes 7 and 7 duplicate"); */

	printf("\nTesting first struct using the already given functions\n");
    testAddNode();
	
	printf("\n");
    testContainsBSTree();
	
	printf("\n");
    testLeftMost();
	
	printf("\n");
    testRemoveLeftMost();
	
	printf("\n");
    testRemoveNode();
    
	
	return 0;
}