上一页 1 ··· 21 22 23 24 25 26 27 28 29 ··· 34 下一页

2015年3月14日

Pow(x, n)

摘要: Pow(x, n)问题: Implement pow(x,n).思路: 分治法我的代码:public class Solution { public double pow(double x, int n) { return n >= 0 ? helper(x,n) : 1/h... 阅读全文

posted @ 2015-03-14 16:01 zhouzhou0615 阅读(140) 评论(0) 推荐(0) 编辑

Reverse Bits

摘要: Reverse Bits问题:Reverse bits of a given 32 bits unsigned integer.For example, given input 43261596 (represented in binary as000000101001010000011110100... 阅读全文

posted @ 2015-03-14 15:10 zhouzhou0615 阅读(102) 评论(0) 推荐(0) 编辑

Jump Game

摘要: Jump Game问题:Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents... 阅读全文

posted @ 2015-03-14 14:19 zhouzhou0615 阅读(147) 评论(0) 推荐(0) 编辑

Valid Palindrome

摘要: Valid Palindrome问题:Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.思路: 简单的数学推导我的代码:publi... 阅读全文

posted @ 2015-03-14 13:53 zhouzhou0615 阅读(123) 评论(0) 推荐(0) 编辑

Reverse Linked List II

摘要: Reverse Linked List II问题:Reverse a linked list from positionmton. Do it in-place and in one-pass.思路: 三行情书,用的飞起我的代码:public class Solution { public ... 阅读全文

posted @ 2015-03-14 13:27 zhouzhou0615 阅读(144) 评论(0) 推荐(0) 编辑

Insertion Sort List

摘要: Insertion Sort List问题:Sort a linked list using insertion sort.思路: 三行情书 旧旧 新 旧 旧 新我的代码:/** * Definition for singly-linked list. * public class ListNod... 阅读全文

posted @ 2015-03-14 13:13 zhouzhou0615 阅读(120) 评论(0) 推荐(0) 编辑

Palindrome Partitioning

摘要: Palindrome Partitioning问题:Given a strings, partitionssuch that every substring of the partition is a palindrome.Return all possible palindrome partiti... 阅读全文

posted @ 2015-03-14 12:59 zhouzhou0615 阅读(149) 评论(0) 推荐(0) 编辑

Construct Binary Tree from Preorder and Inorder Traversal

摘要: Construct Binary Tree from Preorder and Inorder Traversal问题:Given preorder and inorder traversal of a tree, construct the binary tree.Note:You may ass... 阅读全文

posted @ 2015-03-14 12:46 zhouzhou0615 阅读(126) 评论(0) 推荐(0) 编辑

2015年3月13日

Valid Parentheses

摘要: Valid Parentheses问题:Given a string containing just the characters'(',')','{','}','['and']', determine if the input string is valid.The brackets must c... 阅读全文

posted @ 2015-03-13 21:21 zhouzhou0615 阅读(148) 评论(0) 推荐(0) 编辑

Partition List

摘要: Partition List问题:Given a linked list and a valuex, partition it such that all nodes less thanxcome before nodes greater than or equal tox.You should p... 阅读全文

posted @ 2015-03-13 21:08 zhouzhou0615 阅读(140) 评论(0) 推荐(0) 编辑

上一页 1 ··· 21 22 23 24 25 26 27 28 29 ··· 34 下一页

导航