摘要: 1。给个sorted array, 只包含不重复整数,数值范围在 [0,99]中间, 按格式打印其余数值:输入: [0,1,3,50,75]输出: [2,4-49,51-74,76-99]请写出程序,及 testing cases。 1 string findConsecutive(vector n... 阅读全文
posted @ 2014-09-14 20:57 linyx 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 一个决定性问题C 若是为NPC,则代表它对NP是完备的,这表示:它是一个NP问题,且其他属于NP的问题都可归约成它。满足条件2(无论是否满足条件1)的问题集合被称为NP-hard。一个NP-hard问题至少跟NPC问题一样难。 有一类问题已经被证明属于NP-hard但不属于NP,即,这类问题至少与N... 阅读全文
posted @ 2014-09-14 17:10 linyx 阅读(436) 评论(0) 推荐(0) 编辑
摘要: 7.4Write methods to implement the multiply, subtract, and divide operations for integers. Use only the add operator.比较简单。但是要封装得好。7.5 Given two squares... 阅读全文
posted @ 2014-09-14 10:06 linyx 阅读(175) 评论(0) 推荐(0) 编辑