本文整理汇总了C++中SortedList::print方法的典型用法代码示例。如果您正苦于以下问题:C++ SortedList::print方法的具体用法?C++ SortedList::print怎么用?C++ SortedList::print使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SortedList
的用法示例。
在下文中一共展示了SortedList::print方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: confirm
//
// Show user what the list contains then show what it ought to contain
// Let the user decide if it is correct
//
void confirm(string name, SortedList& l, string correct)
{
cout << name << " is now:" << endl;
l.print();
cout << "It should be" << endl;
cout << correct << endl << endl;
}
示例2: test_findmax
void test_findmax()
{
#if FINDMAX
printf("Running test_findmax\n");
SortedList l1, l2;
int m1, m2;
readFile(l1, file1);
readFile(l2, file2);
m1 = l1.findMax();
m2 = l2.findMax();
cout << "list is ";
l1.print();
printf("Your max is %d, should be 78\n", m1);
cout << "list is ";
l2.print();
printf("Your max is %d, should be 42\n", m2);
SortedList eric;
eric.insert(-100);
eric.insert(-101);
eric.insert(-102);
m1 = eric.findMax();
cout << "list is ";
eric.print();
printf("Your max is %d, should be -100\n", m1);
#endif
}
示例3: checkfreq
void checkfreq(SortedList& l, int num, int correct)
{
printf("Running checkfreq\n");
int f = l.freq(num);;
cout << "list is ";
l.print();
printf("Your freq(%d) rets %d, should be %d\n", num, f, correct);
#endif
}
示例4: checkwhereis
void checkwhereis(SortedList& l, int num, string correct)
{
SortedList result;
result = l.whereis(num);
cout << "whereis "<< num << " in " ;
l.print();
confirm("your result", result, correct);
#endif
}