自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(45)
  • 资源 (19)
  • 收藏
  • 关注

原创 [LeetCode] Sort List

Sort a linked list in O(n log n) time using constant space complexity.这题思路比较直接。按照题目要求,需要在O(N*logN)时间内完成排序,所以可以考虑的排序方法只有三个:快速排序、归并排序和堆排序。然而,快速排序要求能在常数时间内置换两个指定元素,所以需要支持O(1)时间内的随机访问,这个无法在链表上实现,所以可以排

2013-11-21 12:56:34 1508

原创 [LeetCode] LRU Cache

Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and set.get(key) - Get the value (will always be positive) of the key if

2013-11-12 04:35:23 8367

原创 [LeetCode] Word Ladder

Given two words (start and end), and a dictionary, find the length of shortest transformation sequence from start to end, such that:Only one letter can be changed at a timeEach intermediate word m

2013-11-10 15:09:11 1270

原创 [LeetCode] Substring with Concatenation of All Words

这题一开始做了很久,尝试了先将L里的每个词的开头字符都提取出来,相同开头字符的归为一类词群,然后把L转化为了一个multimap,这样的话每次看开头字符找到可能匹配的词群所需时间就是O(1)了。之后再以S中的每个字符作为起点,开始了使用DFS逐个匹配查找。当然,最后剩的少许字符可以不用考虑,因为光剩下的子字符串的长度可能就不够覆盖L里的所有词了。这个过程很复杂的,关键是回溯的过程中,删除和恢复

2013-11-09 05:15:33 6495 5

原创 [LeetCode] Candy

There are N children standing in a line. Each child is assigned a rating value.You are giving candies to these children subjected to the following requirements:Each child must have at least on

2013-11-09 00:51:19 2630 7

转载 HashMap、HashTable、LinkedHashMap和TreeMap用法和区别

Java为数据结构中的映射定义了一个接口java.util.Map,它有四个实现类,分别是HashMap、HashTable、LinkedHashMap和TreeMap。本节实例主要介绍这4中实例的用法和区别。关键技术剖析:Map用于存储键值对,根据键得到值,因此不允许键重复,值可以重复。l  (1)HashMap是一个最常用的Map,它根据键的hashCode值存储数据,根据键可以直

2013-11-09 00:14:27 2170

原创 [LeetCode] Minimum Window Substring

Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n).For example,S = "ADOBECODEBANC"T = "ABC"Minimum window is "BAN

2013-11-08 14:57:49 1350

原创 [LeetCode] Palindrome Partitioning II

Given a string s, partition s such that every substring of the partition is a palindrome.Return the minimum cuts needed for a palindrome partitioning of s.For example, given s = "aab",Return

2013-11-08 12:01:18 1062

原创 [LeetCode] Binary Tree Maximum Path Sum

Given a binary tree, find the maximum path sum.The path may start and end at any node in the tree.For example:Given the below binary tree, 1 / \ 2 3Return 6.这

2013-11-08 00:18:45 1302

原创 [LeetCode] Interleaving String

Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2.For example,Given:s1 = "aabcc",s2 = "dbbca",When s3 = "aadbbcbcac", return true.When s3 = "aadbbbaccc", ret

2013-11-07 10:31:12 1140

转载 关于二分查找的面试题归类

转自http://blog.csdn.net/walkinginthewind/article/details/8937978二分查找,最基本的算法之一,也是面试中常被考察的重点,因为基本的算法最能反映出一个人的基础是否扎实。本文对二分查找相关题目做一个总结。题目列表:1. 给定一个有序(非降序)数组A,求任意一个i使得A[i]等于target,不存在则返回-1

2013-11-06 13:09:14 2390

转载 轻松搞定面试中的链表题目

转自http://blog.csdn.net/walkinginthewind/article/details/7393134链表是最基本的数据结构,面试官也常常用链表来考察面试者的基本能力,而且链表相关的操作相对而言比较简单,也适合考察写代码的能力。链表的操作也离不开指针,指针又很容易导致出错。综合多方面的原因,链表题目在面试中占据着很重要的地位。本文对链表相关的面试题做了较

2013-11-06 13:02:33 1356

转载 轻松搞定面试中的二叉树题目

转自http://blog.csdn.net/walkinginthewind/article/details/7518888树是一种比较重要的数据结构,尤其是二叉树。二叉树是一种特殊的树,在二叉树中每个节点最多有两个子节点,一般称为左子节点和右子节点(或左孩子和右孩子),并且二叉树的子树有左右之分,其次序不能任意颠倒。二叉树是递归定义的,因此,与二叉树有关的题目基本都可以用递

2013-11-06 12:58:33 1913 1

转载 2014年计算机求职总结--准备篇 (顺便也带点自己在美国准备的总结吧)

找工作是一个长期准备的过程,突击是没什么效果的。准备时间越长,准备就越充分,就越容易拿到好的offer。我基本上从研究生一入学就一直在准备找工作的东西,看书、研究研究笔试面试题、在线编程训练、参加实习招聘等等。当然,其实主要还是研二开始准备的,也算不上多认真,反正一天一天的积累吧。这里我把我准备的内容向大家分享一下。一、推荐书籍计算机的好书挺多的,我买了也有四五十本,也花了不少钱,

2013-11-06 12:47:16 2507

原创 [LeetCode] Word Break II

Given a string s and a dictionary of words dict, add spaces in s to construct a sentence where each word is a valid dictionary word.Return all such possible sentences.For example, givens = "

2013-11-05 04:42:31 2487

转载 String, StringBuffer or StringBuilder?

String, StringBuffer Or StringBuilder?       相信大家对 String 和 StringBuffer 的区别也已经很了解了,但是估计还是会有很多同志对这两个类的工作原理有些不清楚的地方,今天我在这里重新把这个概念给大家复习一下,顺便牵出 J2SE 5.0 里面带来的一个新的字符操作的类—— StringBuilder (先别忙着扔我砖头,我还算清醒,

2013-11-05 02:16:35 1306

转载 CSDN的博客搜索功能太弱,教你怎么搜索自己博客的文章

原文地址:http://blog.csdn.net/pendle/article/details/6980120不得不说,CSDN博客的搜索功能是在太弱了。而且一直都很弱,以至于我每次想在自己博客上找自己发的文章都变得那么难。做一个搜索博客内文章的功能没有那么难吧? 还是说CSDN已经放弃了博客这一块了? 我发现我的博客排名好像靠前了,难道是CSDN的博客没落了?        既

2013-11-05 01:48:28 1735 1

原创 [LeetCode] String to Integer (atoi)

Implement atoi to convert a string to an integer.Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible input ca

2013-11-05 00:35:07 1145

原创 [LeetCode] Word Break

Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or more dictionary words.For example, givens = "leetcode",dict = ["leet"

2013-11-04 22:53:17 1648

原创 [LeetCode] Reorder List

Given a singly linked list L: L0→L1→…→Ln-1→Ln,reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→…You must do this in-place without altering the nodes' values.For example,Given {1,2,3,4}, reorder it to

2013-11-04 22:26:50 7769

转载 MySQL常用命令

第一招、mysql服务的启动和停止net stopmysqlnetstart mysql第二招、登陆mysql语法如下:mysql -u用户名 -p用户密码键入命令mysql -uroot -p,回车后提示你输入密码,输入12345,然后回车即可进入到mysql中了,mysql的提示符是:mysql>注意,如果是连接到另外的机器上,则需要加入一个参数-h机器IP第三

2013-11-04 21:03:51 915

转载 Eclispse Out Of Memory Error Solution

eclipse 有启动参数里设置jvm大小,因为eclipse运行时自己也需要jvm,所以eclipse.ini里设置的jvm大小不是具体某个程序运行时所用jvm的大小,这和具体程序运行的jvm大小无关。那么怎么才能设置某个程序的jvm大小呢(当然控制台运行的话不会存在这个问题,如:java -Xms256m -Xmx1024m classname,这样就可以把当前程序的jvm大小给设定)?

2013-11-04 21:02:06 1351

原创 OpenMP学习笔记

编译命令:gcc –O XXX.c -fopenmp1.      Multi-thread Programming1.      首先要import相应的API,因此必须在首行写上#include “omp.h”。2.      对于要并行执行的部分,用#pragma omp parallel{…} 标记并行块范围。3.      在并行块里面,用int ID = omp_get

2013-11-04 20:59:14 4114 2

原创 MPI学习笔记

MPI Notes开头要注明 #include 以引入MPI函数库。 MPI_Comm_size: 进程个数MPI_Comm_rank: 进程ID,从0到size-1。 HelloWorld(MPI)#include “mpi.h”#include  int main(int argc, char *argv[]){         intrank

2013-11-04 20:58:40 3253

转载 玩转MapReduce的10条建议

转自This piece is based on the talk “Practical MapReduce” that I gave at Hadoop User Group UK on April 14.1. Use an appropriate MapReduce languageThere are many languages and frameworks that

2013-11-04 20:58:06 1120

原创 SQL Syntax - how to group by interval

发现原来用SQL也可以group by interval,实现了类似SciQL里的grid grouping,虽然粒度只是1维上的grid,即interval。In postgres (where || is the string concatenation operator):select (score/10)*10 || '-' || (score/10)*10+9 a

2013-11-03 16:43:08 1088

转载 SSH Without a Password(SSH无密码登录)

主要用于建立自己使用的cluster和个人PC之间的登录。此外根据个人经验,SSH无密码登录在配置分布式系统(例如Hadoop和parallel databases)时往往都是第一个步骤。(除非配置的是单机盘,用IP地址处用localhost就可以搞定)。网上搜了集中方法,觉得这种方法是最好用的。The following steps can be used to ssh from

2013-11-03 16:34:00 1268

转载 VIM使用笔记

全部删除:按esc后,然后dG全部复制:按esc后,然后ggyG全选高亮显示:按esc后,然后ggvG或者ggVG Vi IMproved (VIM) 是 Bram Moolenaar 开发的与 UNIX 下的通用文本编辑器 vi 兼容并且更加强大的文本编辑器。它支持语法变色、正规表达式匹配与替换、插入补全、自定义键等等功能,为编辑文本尤其是编写程序提供了极大方便。VIM 可以运行

2013-11-03 16:21:00 1346

转载 leetcode难度及面试频率

转载自:LeetCode Question Difficulty Distribution(原132道)       1Two Sum25arraysort    set

2013-11-03 16:08:13 7544

原创 [LeetCode] Gas Station

There are N gas stations along a circular route, where the amount of gas at station i is gas[i].You have a car with an unlimited gas tank and it costs cost[i] of gas to travel from station i to

2013-11-03 15:44:37 909

原创 [LeetCode] ZigZag Conversion

The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)P A H NA P L S I

2013-11-03 15:32:56 939

原创 [LeetCode] First Missing Positive

Given an unsorted integer array, find the first missing positive integer.For example,Given [1,2,0] return 3,and [3,4,-1,1] return 2.Your algorithm should run in O(n) time and uses constant

2013-11-03 15:27:27 807

原创 [LeetCode] Scramble String (非常规DP求解)

Implement regular expression matching with support for '.' and '*'.'.' Matches any single character.'*' Matches zero or more of the preceding element.The matching should cover the entire inpu

2013-11-03 15:09:27 1390

原创 [LeetCode] Regular Expression Matching

'.' Matches any single character.'*' Matches zero or more of the preceding element.The matching should cover the entire input string (not partial).The function prototype should be:bool isMatch(c

2013-11-03 14:54:23 1203

原创 [LeetCode] Maximal Rectangle

这道题太难想了,比较全的总结在这里。http://hi.baidu.com/mzry1992/item/030f9740e0475ef7dc0f6cba核心是使用极大化思想,全局最大值肯定是局部最大值中的一个。这个题目让我瞬间联想到了高考数学里做的题目,类似于要求一个函数(全局)最大值,先用把该函数求导,然后等于0的时候就是取极值的时候,然后这些极大值里面必定会有一个是全局最大值。

2013-11-03 14:50:17 1189

原创 [LeetCode] Word Search

对于这种要找出所以可能解的问题,思路就两个字——回溯。1) 一开始匹配第一个字符,找到所有可能的起始点位置。2)对于每个位置,分别可以向上下左右四个方向进行深度遍历搜索。 private boolean dfs(char[][] board, String word, int i, int j, boolean[][] visited) { // check board[i

2013-11-03 14:37:44 1063

原创 [LeetCode] Simplify Path

核心思想很简单,使用一个栈在内容为“..”的时候弹出前一个元素即可。这题可以偷懒,使用一个StringTokenizer类,这样的话可以很快的形成一个过滤掉所有斜杠后的内容栈。 public String simplifyPath(String path) { Stack stack = new Stack(); StringBuffer strBuffer = new Strin

2013-11-03 14:29:36 1122

原创 [LeetCode] Clone Graph

这题和之前Copy List with Random Pointer的思路类似,都是要使用一个hash map建立原始节点和新建节点之间的映射。一开始写的算法遍历了graph两次:1) clone all the labels;2) clone all the edges.因为hash map是不能够遍历的,我就再加了个set。 // initial implementatio

2013-11-03 14:21:01 1671

转载 [leetcode] 求和问题总结(2Sum, 3Sum, 4Sum, K Sum)

前言:做过leetcode的人都知道, 里面有2sum, 3sum(closest), 4sum等问题, 这些也是面试里面经典的问题, 考察是否能够合理利用排序这个性质, 一步一步得到高效的算法. 经过总结, 本人觉得这些问题都可以使用一个通用的K sum求和问题加以概括消化, 这里我们先直接给出K Sum的问题描述和算法(递归解法), 然后将这个一般性的方法套用到具体的K, 比如leet

2013-11-03 14:07:03 16377 1

原创 Array DB 摘记

1.      Array DB needs to support traditional DBMS operations, along with powerful user-defined operations, including linear algebra (presented in BLAS or LApack).BLAS:The BLAS (Basic Linear Algeb

2013-11-03 13:28:46 1218

Cracking The Coding Interview 5th Ed (高清版下卷)

修正了第四版中的一些代码的bug,并且增加了一些新题。由于是高清版,文件大小超过上传限制,需要和上卷一起解压。 Book Description Publication Date: August 22, 2011 Now in the 5th edition, Cracking the Coding Interview gives you the interview preparation you need to get the top software developer jobs. This is a deeply technical book and focuses on the

2013-12-31

Cracking The Coding Interview 5th Ed (高清版上卷)

修正了第四版中的一些代码的bug,并且增加了一些新题。由于是高清版,文件大小超过上传限制,需要和下卷一起解压。 Book Description Publication Date: August 22, 2011 Now in the 5th edition, Cracking the Coding Interview gives you the interview preparation you need to get the top software developer jobs. This is a deeply technical book and focuses on the software engineering skills to ace your interview. The book is over 500 pages and includes 150 programming interview questions and answers, as well as other advice. The full list of topics are as follows: The Interview Process This section offers an overview on questions are selected and how you will be evaluated. What happens when you get a question wrong? When should you start preparing, and how? What language should you use? All these questions and more are answered. Behind the Scenes Learn what happens behind the scenes during your interview, how decisions really get made, who you interview with, and what they ask you. Companies covered include Google, Amazon, Yahoo, Microsoft, Apple and Facebook. Special Situations This section explains the process for experience candidates, Program Managers, Dev Managers, Testers / SDETs, and more. Learn what your interviewers are looking for and how much code you need to know. Show More Before the Interview In order to ace the interview, you first need to get an interview. This section describes what a software engineer's resume should look like and what you should be doing well before your interview. Behavioral Preparation Although most of a software engineering interview will be technical, behavioral questions matter too. This section covers how to prepare for behavioral questions and how to give strong, structured responses. Technical Questions (+ 5 Algorithm Approaches) This section covers how to prepare for technical questions (without wasting your time) and teaches actionable ways to solve the trickiest algorithm problems. It also teaches you what exactly "good coding" is when it comes to an interview. 150 Programming Questions and Answers This section forms the bulk of the book. Each section opens with a discussion of the core knowledge and strategies to tackle this type of question, diving into exactly how you break down and solve it. Topics covered include Arrays and Strings Linked Lists Stacks and Queues Trees and Graphs Bit Manipulation Brain Teasers Mathematics and Probability Object-Oriented Design Recursion and Dynamic Programming Sorting and Searching Scalability and Memory Limits Testing C and C++ Java Databases Threads and Locks For the widest degree of readability, the solutions are almost entirely written with Java (with the exception of C / C++ questions). A link is provided with the book so that you can download, compile, and play with the solutions yourself. Changes from the Fourth Edition: The fifth edition includes over 200 pages of new content, bringing the book from 300 pages to over 500 pages. Major revisions were done to almost every solution, including a number of alternate solutions added. The introductory chapters were massively expanded, as were the opening of each of the chapters under Technical Questions. In addition, 24 new questions were added. Cracking the Coding Interview, Fifth Edition is the most expansive, detailed guide on how to ace your software development / programming interviews.

2013-12-31

elements of programming interviews

相比于面试类经典书籍crack the interview等,涵盖了相对较新但仍然很经典的面试题,非常值得一看!自己虽然有了本电子版,但是还是忍不住买了原版书。

2013-12-14

编译原理教材(清华大学版)答案

编译原理教材(清华大学版)的课后答案,配合我上传的另一资源"编译原理习题",效果更佳。

2013-11-07

SSD5复习资料汇总

SSD6复习资料汇总,含04级和05级的试卷答案,SSD6认证考试题目,个人对知识重点的整理资料。

2013-11-06

SSD6复习资料汇总

资料涵盖了04和05级当年的试卷,自己整理的要点,值得注意的代码示例,以及SSD的认证考试题目。

2013-11-05

编译原理习题

很经典的编译原理习题集,对期末考试复习很有帮助。当年出现过类似原题,本人期末编译原理96分。

2013-11-05

Lisp编译器的实现(Eclipse Project)

Lisp的编译器实现,含有多个test case可以参考。该资源可以直接导入到Eclipse中。

2013-11-04

ssd9的所有Exercise

囊括ssd9的所有练习题,本人ssd9期末95分。

2009-10-18

武汉大学国际软件学院解释器构造作业四——CMM解释器

国软06级解释器构造课程96分的作品,绝对原创!

2009-10-18

武汉大学国际软件学院解释器构造作业三——语法分析

国软06级解释器构造课程96分的作品,绝对原创!

2009-10-18

武汉大学国际软件学院解释器构造作业一——词法分析

国软06级解释器构造课程96分的作品,绝对原创!

2009-10-18

武汉大学国际软件学院解释器构造作业二——JAVACC 的研究和应用

国软06级解释器构造课程96分的作品,绝对原创! 在基本的功能上做了延伸,包含函数功能等等附加功能。

2009-10-18

武汉大学 薛超英《数据结构与算法》的八个实习作业题目

里面不仅有题目和程序源代码,还有解题思路。非常详细,绝对正确!

2009-10-18

陈火旺:程序设计语言编译原理

程序设计语言编译原理(陈火旺主编 国防工业出版社)

2008-09-05

概率论与数理统计答案

概率论与数理统计答案(武汉大学数学与统计学院 齐名友主编 高等教育出版社)

2008-09-05

ssd3 practical 6

ssd3 practical6答案

2008-05-23

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除