码迷,mamicode.com
首页 >  
搜索关键字:given n integers    ( 24278个结果
Divide Two Integers
Divide two integers without using multiplication, division and mod operator. public class Solution { public int divide(int dividend, int divisor) { int sign = 1; if (dividend < 0) { ...
分类:其他好文   时间:2014-05-15 14:40:50    阅读次数:285
LeetCode-003 Longest Substring Without Repeating Characters
【题目】 Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for "abcabcbb" is "abc", which the length is 3. For "bbbbb" the longest substring is "b", with the len...
分类:其他好文   时间:2014-05-15 14:40:14    阅读次数:320
Leetcode--Validate Binary Search Tree
Problem Description: Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defined as follows: The left subtree of a node contains only nodes with keys l...
分类:其他好文   时间:2014-05-15 11:22:21    阅读次数:317
leetcode -day14 Populating Next Right Pointers in Each Node I II
1、 ?? Populating Next Right Pointers in Each Node Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; } Populate...
分类:其他好文   时间:2014-05-15 04:57:36    阅读次数:221
[LeetCode]ZigZag Conversion
Write the code that will take a string and make this conversion given a number of rows: P A H N A P L S I I G Y I R convert("PAYPALISHIRING", 3) should return "PAHNAPLSIIGYIR"....
分类:其他好文   时间:2014-05-15 04:49:04    阅读次数:311
LeetCode-001 Two Sum
LeetCode-001 Two Sum Given an array of integers, find two numbers such that they add up to a specific target number. The function twoSum should return indices of the two numbers such that they add up to the target, where index1 must be less than index2...
分类:其他好文   时间:2014-05-15 04:34:50    阅读次数:293
LeetCode--Same Tree
Same Tree  Total Accepted: 16072 Total Submissions: 38790My Submissions Given two binary trees, write a function to check if they are equal or not. Two binary trees are considered equal i...
分类:其他好文   时间:2014-05-15 04:00:39    阅读次数:319
LeetCode之Unique Binary Search Trees
Unique Binary Search Trees, Given n, how many structurally unique BST's (binary search trees) that store values 1...n?...
分类:其他好文   时间:2014-05-15 02:32:11    阅读次数:245
LeetCode--Binary Tree Preorder Traversal
Binary Tree Preorder Traversal  Total Accepted: 18022 Total Submissions: 51784My Submissions Given a binary tree, return the preorder traversal of its nodes' values. For example: Given b...
分类:其他好文   时间:2014-05-14 20:43:22    阅读次数:242
Best Time to Buy and Sell Stock III
Total Accepted: 8400 Total Submissions: 38235 My Submissions Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profi...
分类:其他好文   时间:2014-05-14 19:39:53    阅读次数:275
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!