当前位置: 首页>>代码示例>>C++>>正文


C++ BTREE::inorder方法代码示例

本文整理汇总了C++中BTREE::inorder方法的典型用法代码示例。如果您正苦于以下问题:C++ BTREE::inorder方法的具体用法?C++ BTREE::inorder怎么用?C++ BTREE::inorder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BTREE的用法示例。


在下文中一共展示了BTREE::inorder方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: repCost

		/*
		  The repCost function should display a report that lists the following 
		  information on all books in the inventory: title, ISBN number, 
		  quantity on hand, and wholesale cost.  The list should be sorted by 
		  wholesale cost in descending order (the books of the greatest unit 
		  cost listed first). The report should display an appropriate title. 
		  The function should fill the screen with information and then ask 
		  the user to press a key to continue to the next screen.

		  checked
		*/
		void BookCollection::repCost()
		{
			// To hold the position of the found book
			std::list<BookData>::iterator pos = bookList.begin();

			// display title
			std::cout << std::endl;
			std::cout << "\tWholeSale Cost Report" << std::endl;
			std::cout << "----------------------------------" << std::endl;
			std::cout << std::endl;

			//// Sort the array
			//sortByWholeSale();

			// create a new tree
			BTREE treeWS;


			for (unsigned int index = 0; index <  bookList.size(); index++)
			{
			//	std::cout << std::left << std::setw(WIDTH) << "Title: " 
			//		<< pos->getTitle() << std::endl;
			//	std::cout << std::left << std::setw(WIDTH) << "Isbn: " 
			//		<< pos->getIsbn() << std::endl;
			//	std::cout << std::left << std::setw(WIDTH) << "Quantity: "
			//		<< pos->getQuantity() << std::endl;
			//	std::cout << std::fixed << std::showpoint 
			//		<< std::setprecision(2);
			//	std::cout << std::left << std::setw(WIDTH) 
			//		<< "Wholesale Cost: " << "$" 
			//		<< pos->getWholesaleCost() << std::endl;
			//	std::cout << std::endl;

				// add elements to it
				treeWS.insert(pos);

				pos++;

			//	// Use for not windows
			//	std::cout << "Press ENTER twice to continue";
			//	std::cout << std::flush;
			//	std::cin.get();
			//	std::cin.clear();
			//	std::cin.ignore(80, '\n');

			//		//// use for windows
			//		//system("PAUSE");
			} // end for

			// display the tree
			treeWS.inorder();

			std::cout << "----------------------------------" << std::endl;
			std::cout << std::endl;

		} // end function repCost
开发者ID:jtdarkly,项目名称:Serenity-Now,代码行数:67,代码来源:BookCollection.cpp


注:本文中的BTREE::inorder方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。