06 2020 档案

摘要:1105 Spiral Matrix (25分) This time your job is to fill a sequence of N positive integers into a spiral matrix in non-increasing order. A spiral matrix 阅读全文
posted @ 2020-06-30 00:18 Cruel_King 阅读(132) 评论(0) 推荐(0)
摘要:1104 Sum of Number Segments (20分) Given a sequence of positive numbers, a segment is defined to be a consecutive subsequence. For example, given the s 阅读全文
posted @ 2020-06-29 23:17 Cruel_King 阅读(93) 评论(0) 推荐(0)
摘要:1026 Table Tennis (30分) A table tennis club has N tables available to the public. The tables are numbered from 1 to N. For any pair of players, if the 阅读全文
posted @ 2020-06-26 23:23 Cruel_King 阅读(189) 评论(0) 推荐(0)
摘要:1091 Acute Stroke (30分) One important factor to identify acute stroke (急性脑卒中) is the volume of the stroke core. Given the results of image analysis in 阅读全文
posted @ 2020-06-24 23:54 Cruel_King 阅读(253) 评论(0) 推荐(0)
摘要:1095 Cars on Campus (30分) Zhejiang University has 8 campuses and a lot of gates. From each gate we can collect the in/out times and the plate numbers 阅读全文
posted @ 2020-06-23 23:29 Cruel_King 阅读(271) 评论(0) 推荐(0)
摘要:1098 Insertion or Heap Sort (25分) According to Wikipedia: Insertion sort iterates, consuming one input element each repetition, and growing a sorted o 阅读全文
posted @ 2020-06-22 21:39 Cruel_King 阅读(219) 评论(0) 推荐(0)
摘要:记录一下自己理解的堆和堆排序吧。 堆是一种类似于完全二叉树的树形结构,对于二叉树中所有非叶子节点,如果根节点的值严格大于其两个儿子的值,则称为 大顶堆,反之称为小顶堆。 堆排序的一般步骤: 首先利用已有的数据构造一个堆,大顶堆增序,小顶堆降序。 将堆顶的元素与堆末元素交换,接着重新调整剩下的元素为一 阅读全文
posted @ 2020-06-22 20:26 Cruel_King 阅读(255) 评论(0) 推荐(0)
摘要:1089 Insert or Merge (25分) According to Wikipedia: Insertion sort iterates, consuming one input element each repetition, and growing a sorted output l 阅读全文
posted @ 2020-06-21 19:10 Cruel_King 阅读(199) 评论(0) 推荐(0)
摘要:1088 Rational Arithmetic (20分) For two rational numbers, your task is to implement the basic arithmetics, that is, to calculate their sum, difference, 阅读全文
posted @ 2020-06-20 21:45 Cruel_King 阅读(255) 评论(0) 推荐(0)
摘要:1086 Tree Traversals Again (25分) An inorder binary tree traversal can be implemented in a non-recursive way with a stack. For example, suppose that wh 阅读全文
posted @ 2020-06-19 21:39 Cruel_King 阅读(324) 评论(0) 推荐(0)
摘要:1080 Graduate Admission (30分) It is said that in 2011, there are about 100 graduate schools ready to proceed over 40,000 applications in Zhejiang Prov 阅读全文
posted @ 2020-06-15 23:22 Cruel_King 阅读(191) 评论(0) 推荐(0)
摘要:1078 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 阅读全文
posted @ 2020-06-14 23:35 Cruel_King 阅读(177) 评论(0) 推荐(0)
摘要:1074 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 ex 阅读全文
posted @ 2020-06-12 23:28 Cruel_King 阅读(213) 评论(0) 推荐(0)
摘要:1099 Build A Binary Search Tree (30分) A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties: The left 阅读全文
posted @ 2020-06-11 22:50 Cruel_King 阅读(229) 评论(0) 推荐(0)
摘要:1068 Find More Coins (30分) Eva loves to collect coins from all over the universe, including some other planets like Mars. One day she visited a univer 阅读全文
posted @ 2020-06-07 23:54 Cruel_King 阅读(229) 评论(0) 推荐(0)
摘要:1064 Complete Binary Search Tree (30分) A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties: The left 阅读全文
posted @ 2020-06-06 23:41 Cruel_King 阅读(286) 评论(0) 推荐(0)
摘要:1066 Root of AVL Tree (25分) An AVL tree is a self-balancing binary search tree. In an AVL tree, the heights of the two child subtrees of any node diff 阅读全文
posted @ 2020-06-05 21:49 Cruel_King 阅读(204) 评论(1) 推荐(0)
摘要:1065 A+B and C (64bit) (20分) Given three integers A, B and C in [−], you are supposed to tell whether A+B>C. Input Specification: The first line of th 阅读全文
posted @ 2020-06-03 12:34 Cruel_King 阅读(214) 评论(0) 推荐(0)
摘要:1057 Stack (30分) Stack is one of the most fundamental data structures, which is based on the principle of Last In First Out (LIFO). The basic operatio 阅读全文
posted @ 2020-06-02 23:19 Cruel_King 阅读(189) 评论(0) 推荐(0)