自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(4)
  • 收藏
  • 关注

原创 C++ 链表实现构造Huffman树

浙江大学的教材《数据结构》第146页上的用堆构建哈夫曼链表树的函数的实现 1. 函数结构与书中代码相同。堆中元素为指向哈夫曼树的节点的指针:struct HuffmanTree { int weight; HuffmanTree* left; HuffmanTree* right; }; struct MinHeap { HuffmanTree** da

2015-04-29 00:07:52 1021

原创 04-树5. Complete Binary Search Tree (30)

A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties: The left subtree of a node contains only nodes with keys less than the node's key. The righ

2015-04-11 23:48:23 442

原创 时间效率O(N)的排序

功能:给定一堆数,已知所有数都不是-1,用O(N)时间对它们进行排序。 int main(void) { int n = 0; int* tempInput = (int*) malloc(sizeof(int) * MAXSIZE); // 所有元素全部置-1 for (int i = 0; i < MAXSIZE; i++) {

2015-04-11 16:21:22 431

原创 02-线性结构2. Reversing Linked List (25)

Given a constant K and a singly linked list L, you are supposed to reverse the links of every K elements on L. For example, given L being 1→2→3→4→5→6, if K = 3, then you must output 3→2→1→6→5→4; if K

2015-04-07 23:25:15 1636

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除