上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 20 下一页
摘要: Given an array of sizen, find the majority element. The majority element is the element that appears more than⌊ n/2 ⌋times.You may assume that the arr... 阅读全文
posted @ 2015-10-06 01:42 茜茜的技术空间 阅读(286) 评论(0) 推荐(0)
摘要: You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality c 阅读全文
posted @ 2015-09-30 13:23 茜茜的技术空间 阅读(292) 评论(0) 推荐(0)
摘要: Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a plan, a canal: Pana... 阅读全文
posted @ 2015-09-30 12:58 茜茜的技术空间 阅读(300) 评论(0) 推荐(0)
摘要: Given two sorted integer arraysnums1andnums2, mergenums2intonums1as one sorted array.Note:You may assume thatnums1has enough space (size that is great... 阅读全文
posted @ 2015-09-30 09:58 茜茜的技术空间 阅读(1283) 评论(0) 推荐(0)
摘要: Given a sorted array, remove the duplicates in place such that each element appear onlyonceand return the new length.Do not allocate extra space for a... 阅读全文
posted @ 2015-09-30 01:04 茜茜的技术空间 阅读(241) 评论(0) 推荐(0)
摘要: Given a positive integer, return its corresponding column title as appear in an Excel sheet.For example: 1 -> A 2 -> B 3 -> C ... 26 ->... 阅读全文
posted @ 2015-09-30 00:33 茜茜的技术空间 阅读(259) 评论(0) 推荐(0)
摘要: Related to questionExcel Sheet Column TitleGiven a column title as appear in an Excel sheet, return its corresponding column number.For example: A ... 阅读全文
posted @ 2015-09-30 00:02 茜茜的技术空间 阅读(129) 评论(0) 推荐(0)
摘要: 本题的bonus是因此方法是queue的size 达到了K, 就停止增加元素,保证queue.size() 最大时只有k.Java code:import edu.princeton.cs.algs4.StdIn; import edu.princeton.cs.algs4.StdOut; publ... 阅读全文
posted @ 2015-09-28 07:04 茜茜的技术空间 阅读(332) 评论(0) 推荐(0)
摘要: RandomizedQueue 有几个关键点:1. 选择合适的数据结构,因为需要任意位置删除元素,Linked list 做不到,必须使用resizing arrays.2. resizing 的技巧。 Q. How to grow array? A. If array is full, cre... 阅读全文
posted @ 2015-09-28 06:56 茜茜的技术空间 阅读(554) 评论(0) 推荐(0)
摘要: 本次作业考察利用array 或者linked list 实现规定时间复杂度的queue 和stack, 不能使用java 自带的stack 和queue. 目的是让我们掌握自己设计的函数的复杂度。Deque成功的关键是1. 选择合适的数据结构,本题选择doubly LinkedList.2. 自己写... 阅读全文
posted @ 2015-09-28 06:47 茜茜的技术空间 阅读(610) 评论(0) 推荐(0)
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 20 下一页