摘要: 题目原文: Implement a queue with two stacks so that each queue operations takes a constant amortized number of stack operations. 题目要求用栈实现队列的所有操作。 阅读全文
posted @ 2017-07-21 23:44 evasean 阅读(740) 评论(2) 推荐(0) 编辑
摘要: 题目原文: Given two integer arrays of size n , design a subquadratic algorithm to determine whether one is a permutation of the other. That is, do they co 阅读全文
posted @ 2017-07-21 23:28 evasean 阅读(689) 评论(0) 推荐(0) 编辑
摘要: 题目原文: Given two arrays a[] and b[], each containing n distinct 2D points in the plane, design a subquadratic algorithm to count the number of points t 阅读全文
posted @ 2017-07-21 23:22 evasean 阅读(1000) 评论(0) 推荐(0) 编辑
摘要: 第二周课程的Elementray Sorts部分练习测验Interview Questions的第3题荷兰国旗问题很有意思。题目的原文描述如下: Dutch national flag. Given an array of n buckets, each containing a red, whit 阅读全文
posted @ 2017-07-21 14:48 evasean 阅读(1539) 评论(0) 推荐(0) 编辑