上一页 1 ··· 35 36 37 38 39 40 41 42 43 ··· 46 下一页

2014年11月10日

Remove Element

摘要: Remove ElementGiven an array and a value, remove all instances of that value in place and return the new length.The order of elements can be changed. ... 阅读全文

posted @ 2014-11-10 20:36 luckygxf 阅读(196) 评论(0) 推荐(0) 编辑

Remove Nth Node From End of List

摘要: Remove Nth Node From End of ListGiven a linked list, remove thenthnode from the end of list and return its head.For example, Given linked list: 1->2... 阅读全文

posted @ 2014-11-10 20:12 luckygxf 阅读(180) 评论(0) 推荐(0) 编辑

Longest Common Prefix

摘要: Longest Common PrefixWrite a function to find the longest common prefix string amongst an array of strings. 1 public class Solution { 2 public Str... 阅读全文

posted @ 2014-11-10 19:07 luckygxf 阅读(191) 评论(0) 推荐(0) 编辑

Roman to Integer

摘要: 这道题我是按定义来做的Roman to IntegerGiven a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999. 1 package com.gx... 阅读全文

posted @ 2014-11-10 18:40 luckygxf 阅读(207) 评论(0) 推荐(0) 编辑

Min Stack

摘要: Min StackDesign a stack that supports push, pop, top, and retrieving the minimum element in constant time.push(x) -- Push element x onto stack.pop() -... 阅读全文

posted @ 2014-11-10 14:59 luckygxf 阅读(167) 评论(0) 推荐(0) 编辑

2014年11月9日

Palindrome Number

摘要: Palindrome NumberDetermine whether an integer is a palindrome. Do this without extra space. 1 public class Solution { 2 public boolean isPalindrom... 阅读全文

posted @ 2014-11-09 22:57 luckygxf 阅读(145) 评论(0) 推荐(0) 编辑

String to Integer (atoi)

摘要: String to Integer (atoi)Implementatoito convert a string to an integer.Hint:Carefully consider all possible input cases. If you want a challenge, plea... 阅读全文

posted @ 2014-11-09 22:41 luckygxf 阅读(254) 评论(0) 推荐(0) 编辑

Reverse Integer

摘要: Reverse IntegerReverse digits of an integer.Example1:x = 123, return 321Example2:x = -123, return -321 1 public class Solution { 2 public int reve... 阅读全文

posted @ 2014-11-09 21:23 luckygxf 阅读(141) 评论(0) 推荐(0) 编辑

Count and Say

摘要: Count and SayThe count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...1is read off as"one 1"or11.11is r... 阅读全文

posted @ 2014-11-09 21:12 luckygxf 阅读(192) 评论(0) 推荐(0) 编辑

Merge Two Sorted Lists

摘要: 归并两个有序序列为一个有序序列Merge Two Sorted ListsMerge two sorted linked lists and return it as a new list. The new list should be made by splicing together the n... 阅读全文

posted @ 2014-11-09 16:09 luckygxf 阅读(128) 评论(0) 推荐(0) 编辑

上一页 1 ··· 35 36 37 38 39 40 41 42 43 ··· 46 下一页

导航