上一页 1 ··· 11 12 13 14 15
摘要: Happy Number Write an algorithm to determine if a number is "happy". A happy number is a number defined by the following process: Starting with any po 阅读全文
posted @ 2016-04-24 23:10 Juntaran 阅读(130) 评论(0) 推荐(0) 编辑
摘要: Single Number Given an array of integers, every element appears twice except for one. Find that single one. Note:Your algorithm should have a linear r 阅读全文
posted @ 2016-04-24 23:09 Juntaran 阅读(103) 评论(0) 推荐(0) 编辑
摘要: Best Time to Buy and Sell Stock II 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 阅读全文
posted @ 2016-04-24 23:08 Juntaran 阅读(161) 评论(0) 推荐(0) 编辑
摘要: Best Time to Buy and Sell Stock Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to 阅读全文
posted @ 2016-04-24 23:07 Juntaran 阅读(177) 评论(0) 推荐(0) 编辑
摘要: Maximum Depth of Binary Tree Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the roo 阅读全文
posted @ 2016-04-24 23:03 Juntaran 阅读(84) 评论(0) 推荐(0) 编辑
摘要: Same Tree Given two binary trees, write a function to check if they are equal or not. Two binary trees are considered equal if they are structurally i 阅读全文
posted @ 2016-04-24 23:02 Juntaran 阅读(143) 评论(0) 推荐(0) 编辑
摘要: Remove Element Given an array and a value, remove all instances of that value in place and return the new length. Do not allocate extra space for anot 阅读全文
posted @ 2016-04-24 23:00 Juntaran 阅读(125) 评论(0) 推荐(0) 编辑
摘要: Reverse Integer Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return -321 阅读全文
posted @ 2016-04-24 22:58 Juntaran 阅读(174) 评论(0) 推荐(0) 编辑
摘要: String to Integer (atoi) Implement atoi to convert a string to an integer. 阅读全文
posted @ 2016-04-24 22:57 Juntaran 阅读(309) 评论(0) 推荐(0) 编辑
摘要: 现在有一个n个整数的序列,交换两个相邻的数的位置直到整个序列按照升序排列, 那么将整个序列排好需要交换多少次? 例如 1,2,3,5,4 只需要交换一次即可。 第一行输入一个正整数n(n<100),表述数字序列元素个数,占一行; 接下来一行输入从1到n的n个整数序列,中间用空格隔开 输入: 4 4 阅读全文
posted @ 2016-04-24 22:36 Juntaran 阅读(538) 评论(0) 推荐(0) 编辑
上一页 1 ··· 11 12 13 14 15