![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
leetcode
NvLand
这个作者很懒,什么都没留下…
展开
-
Leetcode 326. Power of Three
Given an integer, write a function to determine if it is a power of three. Follow up: Could you do it without using any loop / recursion? Credits: Special thanks to @dietpepsi for adding this probl原创 2016-01-21 17:26:40 · 486 阅读 · 0 评论 -
Leetcode 165. Compare Version Numbers
Compare two version numbers version1 and version2. If version1 > version2 return 1, if version1 < version2 return -1, otherwise return 0.You may assume that the version strings are non-empty and conta原创 2016-02-12 23:39:36 · 412 阅读 · 0 评论 -
leetcode 83. Remove Duplicates from Sorted List
Given a sorted linked list, delete all duplicates such that each element appear only once.For example, Given 1->1->2, return 1->2. Given 1->1->2->3->3, return 1->2->3./** * Definition for singly-lin原创 2016-02-14 00:38:38 · 356 阅读 · 0 评论 -
Binarysearch 二分查找
看似简单的二分查找,但是实际写起来的时候就不是那么回事了。也在校招的机器学习岗位面试上被问到了,没有无误的写出,被直接赶走。看编程珠玑,也是说,在Bell实验室,规定时间内,很多工程师写不全对。也曾看到有人感叹,做了6年的程序员,面试时被一道冒泡排序卡住。感觉算法和数据结构作为一个工程师的基本技能是必须要加强的。下面直接列代码,需注意的是,在计算middle的值的时候,我们需要更换上下界。但是如果直原创 2016-03-04 23:03:26 · 538 阅读 · 0 评论 -
QuickSort 快排算法 java
快排算法是一种简单而又快速的算法,由冒泡法改进而来,效率高,而且代码量不大,较有代表性,在面试中经常被问到。这里的自己看了几个帖子,手写完成了该算法。 可以通过打印,查看算法完成的过程。引用白话经典算法系列之六 快速排序 快速搞定package basic;import java.util.Arrays;public class QuickSort { public static void ma原创 2016-03-05 14:23:32 · 636 阅读 · 0 评论 -
Leetcode No. 136. 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 without using extra me原创 2016-09-18 23:40:11 · 405 阅读 · 0 评论