- 博客(6)
- 收藏
- 关注
原创 二叉树的基本运算+三种遍历(递归)
首先说二叉树的遍历(非空):先序遍历:(1)访问根结点;(2)先序遍历左子树;(3)先序遍历右子树。递归实现代码void PreOrderTraversal(BinTree BT){ if( BT ) { printf(“%d\n”, BT->Data); //对节点做些访问比如打印 ...
2018-12-09 17:19:53 986
原创 Calendar Game(博弈)
Problem DescriptionAdam and Eve enter this year’s ACM International Collegiate Programming Contest. Last night, they played the Calendar Game, in celebration of this contest. This game consists of th...
2018-12-09 11:12:43 239
原创 sort函数(C++)
遇到排序问题,一直都是用C里面的排序方法,但今天要说一个C++里面的sort排序。用于C++中,对给定区间所有元素进行排序。头文件是#include <algorithm>Sort()函数是c++一种排序方法之一,学会了这种方法可以解决冒泡排序和选择排序所带来的执行效率不高的问题!因为它使用的排序方法是类似于快排的方法,时间复杂度为n*log2(n),执行效率较高!Sort...
2018-12-06 18:47:43 525
原创 Wooden Sticks(贪心)-HDU
Problem DescriptionThere is a pile of n wooden sticks. The length and weight of each stick are known in advance. The sticks are to be processed by a woodworking machine in one by one fashion. It ne...
2018-12-06 18:35:05 268
原创 Moving Tables(贪心)- HDU
Problem DescriptionThe famous ACM (Advanced Computer Maker) Company has rented a floor of a building whose shape is in the following figure. The floor has 200 rooms each on the north side and ...
2018-12-05 13:04:34 126
原创 FatMouse' Trade(贪心)-HDU
Problem DescriptionFatMouse prepared M pounds of cat food, ready to trade with the cats guarding the warehouse containing his favorite food, JavaBean.The warehouse has N rooms. The i-th room contain...
2018-12-05 12:53:23 168
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人