
ACM 数据结构 树与二叉树
xwc_hdu
HDU
展开
-
HDU 1710-Binary Tree Traversals
好久没好好AC了, 这学期的数据结构也没好好学。恶补ing... 题目大意:告诉二叉树的先序序列和中序序列,求后序序列。思路:先序建立二叉链表,再后续遍历二叉树。 #include using namespace std;typedef struct Binary{ int data; Binary *lchild, *rchild;原创 2010-05-29 15:07:00 · 781 阅读 · 0 评论 -
HDU 1053 && PKU 1521 Entropy (PKU 3253, HDU 2527同解)
Huffman编码, 题意:给你一个序列,output the length in bits of the 8-bit ASCII encoding, the length in bits of an optimal prefix-free variable-length encoding, and the compression ratio accurate to one decimal poi原创 2010-05-29 16:06:00 · 1516 阅读 · 0 评论