上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 20 下一页
摘要: import edu.princeton.cs.algs4.StdOut; import edu.princeton.cs.algs4.StdRandom;import edu.princeton.cs.algs4.StdStats; /* *How do I generate a si... 阅读全文
posted @ 2015-09-27 14:53 茜茜的技术空间 阅读(1159) 评论(0) 推荐(0) 编辑
摘要: 3种版本的答案,第一种使用virtual top and bottom site, 但有backwash的问题,解决这个问题有两种方法:1. 使用2个WQUUF, 但会增加memory.One for checking if the system percolates(include virtual... 阅读全文
posted @ 2015-09-27 01:33 茜茜的技术空间 阅读(5933) 评论(0) 推荐(0) 编辑
摘要: Question 1Suppose that you time a program as a function of N and producethe following table. N seconds------------------- 1024 0.000 ... 阅读全文
posted @ 2015-09-25 01:40 茜茜的技术空间 阅读(419) 评论(0) 推荐(0) 编辑
摘要: Question1Give the id[] array that results from the following sequence of 6 unionoperations on a set of 10 items using the quick-find algorithm. 6-3 2-... 阅读全文
posted @ 2015-09-25 00:55 茜茜的技术空间 阅读(471) 评论(0) 推荐(0) 编辑
摘要: You are climbing a stair case. It takesnsteps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb... 阅读全文
posted @ 2015-09-23 13:38 茜茜的技术空间 阅读(217) 评论(0) 推荐(0) 编辑
摘要: There areNgas stations along a circular route, where the amount of gas at stationiisgas[i].You have a car with an unlimited gas tank and it costscost[... 阅读全文
posted @ 2015-09-23 13:25 茜茜的技术空间 阅读(239) 评论(0) 推荐(0) 编辑
摘要: Say you have an array for which theithelement is the price of a given stock on dayi.If you were only permitted to complete at most one transaction (ie... 阅读全文
posted @ 2015-09-23 12:46 茜茜的技术空间 阅读(166) 评论(0) 推荐(0) 编辑
摘要: Say you have an array for which theithelement is the price of a given stock on dayi.Design an algorithm to find the maximum profit. You may complete a... 阅读全文
posted @ 2015-09-23 12:13 茜茜的技术空间 阅读(158) 评论(0) 推荐(0) 编辑
摘要: This is afollow upofShortest Word Distance. The only difference is nowword1could be the same asword2.Given a list of words and two wordsword1andword2,... 阅读全文
posted @ 2015-09-23 02:34 茜茜的技术空间 阅读(1338) 评论(0) 推荐(0) 编辑
摘要: This is afollow upofShortest Word Distance. The only difference is now you are given the list of words and your method will be calledrepeatedlymany ti... 阅读全文
posted @ 2015-09-23 01:42 茜茜的技术空间 阅读(625) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 20 下一页