
Algortithm
文章平均质量分 78
eva-kiki
这个作者很懒,什么都没留下…
展开
-
Coursera Algorithms week1 Interview Questions: Search in a bitonic array
题目要求:An array is bitonic if it is comprised of an increasing sequence of integers followed immediately by a decreasing sequence of integers. Write a program that, given a bitonic array of n distin原创 2017-07-20 14:49:49 · 1229 阅读 · 0 评论 -
Coursera Algorithms week1 Interview Questions: 3Sum in quadratic time
题目要求: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 in time proportional to n2 or better.分析:原创 2017-07-20 14:46:04 · 944 阅读 · 0 评论 -
Coursera Algorithms week1 Interview Questions: Egg drop
Suppose that you have an n-story building (with floors 1 through n) and plenty of eggs. An egg breaks if it is dropped from floor T or higher and does not break otherwise.原创 2017-07-20 15:06:08 · 766 阅读 · 0 评论 -
Coursera Algorithms Programming Assignment 2: Deque and Randomized Queue
这次作业与第一周作业相比,稍微简单一些。有三个编程练习:双端队列(Deque)设计、随机队列(Randomized Queue)设计,还有一个排列组合类Permutation。一、双端队列Deque设计要求:A double-ended queue or deque (pronounced "deck") is a generalization of a stack and a q原创 2017-07-19 11:38:55 · 748 阅读 · 0 评论 -
Coursera Algorithms Programming Assignment 1: Percolation
题目来源http://coursera.cs.princeton.edu/algs4/assignments/percolation.html作业分为两部分:建立模型和仿真实验。最关键的部分就是建立模型对象。模型对象要求如下:The model. We model a percolation system using an n-by-n grid of sites. Each si原创 2017-07-17 22:08:22 · 988 阅读 · 1 评论 -
coursera Algorithms week1 练习测验2:Union-find with specific canonical element
题目原文: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 operations, union(), connected(), and find() sho原创 2017-07-17 22:57:26 · 1916 阅读 · 2 评论 -
Coursera Algorithms week1 练习测验3:Successor with delete
题目原文:Given a set of n integers S = {0,1,…,N-1}and a sequence of requests of the following form:Remove x from SFind the successor of x: the smallest y in S such thaty>=xdesign a原创 2017-07-18 09:47:53 · 1457 阅读 · 1 评论 -
Coursera Algorithms week1 练习测验1:Social network connectivity
题目原文描述:Given a social network containing n members and a log file containing m timestamps at which times pairs of members formed friendships, design an algorithm to determine the earliest time原创 2017-07-17 22:41:13 · 3777 阅读 · 1 评论