摘要:
题目要求: Design an algorithm for the 3-SUM problem that takes time proportional to n2 in the worst case. You may assume that you can sort the n integers 阅读全文
摘要:
作业原文:http://coursera.cs.princeton.edu/algs4/assignments/queues.html 这次作业与第一周作业相比,稍微简单一些。有三个编程练习:双端队列(Deque)设计、随机队列(Randomized Queue)设计,还有一个排列组合类Permut 阅读全文
摘要:
题目原文: Given a set of n integers S = {0,1,…,N-1}and a sequence of requests of the following form: Remove x from S Find the successor of x: the smallest 阅读全文
摘要:
题目原文: Add a method find() to the union-find data type so that find(i) returns the largest element in the connected component containing i. The operati 阅读全文
摘要:
题目原文描述: Given a social network containing. n members and a log file containing m timestamps at which times pairs of members formed friendships, design 阅读全文
摘要:
题目来源http://coursera.cs.princeton.edu/algs4/assignments/percolation.html 作业分为两部分:建立模型和仿真实验。 最关键的部分就是建立模型对象。模型对象要求如下: The model. We model a percolation 阅读全文