![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法
文章平均质量分 73
kingpengzhen
这个作者很懒,什么都没留下…
展开
-
LeetCode --Single Number
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 runtime complexity. Could you implement it原创 2015-01-09 16:23:21 · 476 阅读 · 0 评论 -
LeetCode算法练习Majority Element
Majority Element的原题目大概是这样的:Given an array of size n, find the majority element. The majority element is the element that appears more than n/2 times.You may assume that the array is non-empty an原创 2014-12-22 19:50:51 · 476 阅读 · 0 评论 -
Leetcode算法练习 bottom-up level order traversal of Binary Tree
本题主要是考察二叉树的遍历,要求从最底层到最顶层分层输出二叉树的节点。解决思路:从树根开始遍历二叉树,分层存储各层的节点,然后逆序。原创 2014-12-23 22:11:53 · 615 阅读 · 20 评论 -
LeetCode 算法练习 Compare Version Numbers
Compare Version Numbers 原题如下:Compare two version numbers version1 and version1. If version1 > version2 return 1, if version1 version2 return -1, otherwise return 0.You may assume that the versi原创 2014-12-28 15:48:48 · 617 阅读 · 2 评论 -
Leetcode--Rotate Array
Rotate an array of n elements to the right by k steps.For example, with n = 7 and k = 3, the array[1,2,3,4,5,6,7] is rotated to [5,6,7,1,2,3,4]. Note:Try to come up as many solutions as you ca原创 2015-03-01 23:11:40 · 380 阅读 · 0 评论