上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 16 下一页

Swap Nodes in Pairs

摘要: Given a linked list, swap every two adjacent nodes and return its head.For example,Given1->2->3->4, you should return the list as2->1->4->3.Your algor... 阅读全文
posted @ 2014-11-16 14:52 Ryan-Xing 阅读(114) 评论(0) 推荐(0) 编辑

Add Two Numbers

摘要: You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single ... 阅读全文
posted @ 2014-11-16 14:17 Ryan-Xing 阅读(125) 评论(0) 推荐(0) 编辑

Remove Duplicates from Sorted List

摘要: Given a sorted linked list, delete all duplicates such that each element appear onlyonce.For example,Given1->1->2, return1->2.Given1->1->2->3->3, retu... 阅读全文
posted @ 2014-11-16 13:51 Ryan-Xing 阅读(125) 评论(0) 推荐(0) 编辑

Word Ladder II

摘要: Given two words (startandend), and a dictionary, find all shortest transformation sequence(s) fromstarttoend, such that:Only one letter can be changed... 阅读全文
posted @ 2014-10-29 17:45 Ryan-Xing 阅读(190) 评论(0) 推荐(0) 编辑

Find Minimum in Rotated Sorted Array II

摘要: Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e.,0 1 2 4 5 6 7might become4 5 6 7 0 1 2).Find the minimum element.The a... 阅读全文
posted @ 2014-10-29 16:04 Ryan-Xing 阅读(134) 评论(0) 推荐(0) 编辑

Find Minimum in Rotated Sorted Array

摘要: Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e.,0 1 2 4 5 6 7might become4 5 6 7 0 1 2).Find the minimum element.You m... 阅读全文
posted @ 2014-10-29 11:55 Ryan-Xing 阅读(125) 评论(0) 推荐(0) 编辑

Text Justification

摘要: Given an array of words and a lengthL, format the text such that each line has exactlyLcharacters and is fully (left and right) justified.You should p... 阅读全文
posted @ 2014-10-26 17:00 Ryan-Xing 阅读(136) 评论(0) 推荐(0) 编辑

Reverse Words in a String

摘要: Given an input string, reverse the string word by word.For example,Given s = "the sky is blue",return "blue is sky the".click to show clarification.Cl... 阅读全文
posted @ 2014-10-25 21:05 Ryan-Xing 阅读(112) 评论(0) 推荐(0) 编辑

LRU Cache

摘要: Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations:getandset.get(key)- Get the valu... 阅读全文
posted @ 2014-10-25 20:31 Ryan-Xing 阅读(172) 评论(0) 推荐(0) 编辑

Surrounded Regions

摘要: Given a 2D board containing'X'and'O', capture all regions surrounded by'X'.A region is captured by flipping all'O's into'X's in that surrounded region... 阅读全文
posted @ 2014-10-24 22:31 Ryan-Xing 阅读(160) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 16 下一页