
DataStruct
文章平均质量分 80
开拓的博客
这个作者很懒,什么都没留下…
展开
-
DS | Tree | PAT | Tree Traversals Again
03-树3 Tree Traversals Again (25分)An inorder binary tree traversal can be implemented in a non-recursive way with a stack. For example, suppose that when a 6-node binary tree (with the keys n原创 2015-09-09 11:05:58 · 534 阅读 · 0 评论 -
[DS][Sort][PAT][PAT Judge]
1075. PAT Judge (25)The ranklist of PAT is generated from the status list, which shows the scores of the submittions. This time you are supposed to generate the ranklist for PAT.Input Specif原创 2015-09-03 20:39:37 · 469 阅读 · 0 评论 -
[DS][Hash][PAT][电话聊天狂人]
11-散列1 电话聊天狂人 (25分)给定大量手机用户通话记录,找出其中通话次数最多的聊天狂人。输入格式:输入首先给出正整数N(≤105),为通话记录条数。随后N行,每行给出一条通话记录。简单起见,这里只列出拨出方和接收方的11位数字构成的手机号码,其中以空格分隔。输出格式:在一行中给出聊天狂人的手机号码及其通话次数,其间以空格分隔。如果这原创 2015-09-06 16:37:18 · 2014 阅读 · 0 评论 -
[DS][Hash][PAT][Hashing]
11-散列2 Hashing (25分)The task of this problem is simple: insert a sequence of distinct positive integers into a hash table, and output the positions of the input numbers. The hash function is原创 2015-09-06 17:17:08 · 740 阅读 · 0 评论 -
PAT-A | 1091 | Acute Stroke
PAT-A 1091 Acute Stroke 解题报告。原创 2015-09-11 14:08:13 · 914 阅读 · 0 评论 -
[DS][Tree][PAT][List Leaves]
网易云课堂浙大数据结构课第三周 树(上)PAT: List Leaves解答原题在这里关键问题 如何根据输入创建树?如何根据建好的二叉树找出叶子节点?且顺序为从上到下,从左到右?如何根据输入创建树? 题目先输入N (N<=10),表示有个结点,节点数字从0到N-1编号;然后从编号为0的结点到N-1,依次输入每个结点的左孩子编号和右孩子编号,没有某孩子则输入-, 将孩子信息记录到两个数组原创 2015-08-26 09:01:46 · 442 阅读 · 0 评论 -
PAT-A | 1004 | Counting Leaves
1004. Counting Leaves (30)时间限制400 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueA family hierarchy is usually presented by a原创 2015-09-10 12:51:05 · 753 阅读 · 0 评论 -
PAT-A | 1094 | The Largest Generation
PAT-A 1094 The Largest Generation 解题报告原创 2015-09-10 11:45:13 · 479 阅读 · 0 评论 -
PAT-A | 1003 | Emergency
PAT-A 1003 Emergency 解答原创 2015-09-08 17:09:07 · 1137 阅读 · 1 评论 -
DS | Hash | Summary
Hash核心思想:以常数时间完成查找基本问题:如何把关键字Key映射到它存放的位置?(Hash函数)两个关键字位置相同时怎么处理?(冲突解决)Hash函数整数的Hash函数直接定址法 H(key) = a x key + b除留余数法H(key) = key % pp最好是素数数字分析法适用于手机号、身份证号等可以先存成字符串,用atoi()将某些位变成整数,或者key[i]-原创 2015-09-09 13:29:42 · 461 阅读 · 0 评论 -
[DS][Hash][PAT][Hashing Hard Version]
11-散列4 Hashing - Hard Version (30分)Given a hash table of size N, we can define a hash function . Suppose that the linear probing is used to solve collisions, we can easily obtain the statu原创 2015-09-07 12:44:28 · 2576 阅读 · 0 评论