中国大学MOOC-陈越、何钦铭-数据结构
部分题目参考代码及思路
帅帅帅的阿豪
这个作者很懒,什么都没留下…
展开
-
中国大学MOOC-陈越、何钦铭-数据结构-03-树2 List Leaves (25分)
Given a tree, you are supposed to list all the leaves in the order of top down, and left to right.Input Specification:Each input file contains one test case. For each case, the first line gives a positive integer N (≤10) which is the total number of node原创 2020-08-28 15:38:06 · 174 阅读 · 0 评论 -
中国大学MOOC-陈越、何钦铭-数据结构-02-线性结构3 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=4, you must output 4→3→2→1→5→6.Input Specification:Each原创 2020-08-26 18:14:11 · 342 阅读 · 1 评论 -
中国大学MOOC-陈越、何钦铭-数据结构-01-复杂度2 Maximum Subsequence Sum (25分)
Given a sequence of K integers { N1 , N2 , …, NK }. A continuous subsequence is defined to be { Ni , Ni+1 , …, Nj } where 1≤i≤j≤K. The Maximum Subsequence is the continuous subsequence which has the largest sum of its elements. For example, g原创 2020-08-23 15:16:04 · 276 阅读 · 0 评论