
算法-Algorithm
文章平均质量分 58
澄澈夕阳
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Course Schedule && Course Schedule ||
Course Schedule && Course Schedule || For Course Schedule Problem description: There are a total of n courses you have to take, labeled from 0 to n - 1. Some courses may have prerequisites,...原创 2018-02-08 02:09:23 · 542 阅读 · 0 评论 -
LintCode String, Function & Class 第一部分
LintCode String, Function & Class 第一部分原创 2017-09-11 08:48:47 · 310 阅读 · 0 评论 -
有效回文串
有效回文串原创 2017-09-25 10:54:00 · 337 阅读 · 0 评论 -
Maximum product of consecutive subsequence(最大连续子序列乘积)
最大连续子序列乘积原创 2017-10-09 10:53:13 · 520 阅读 · 0 评论 -
Java 归并排序(MergeSort)
java 归并排序原创 2017-10-15 09:27:33 · 2475 阅读 · 0 评论 -
Longest Palindrome
Longest Palindrome Given a string which consists of lowercase or uppercase letters, find the length of the longest palindromes that can be built with those letters. This is case sensitive, for examp原创 2018-01-07 08:57:44 · 236 阅读 · 0 评论 -
Copy List with Random Pointer(复制有随机指针的链表)
Copy List with Random Pointer (复制有随机指针的链表) A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null. Return a deep copy of t原创 2018-01-08 09:36:31 · 271 阅读 · 0 评论 -
Binary Tree and Recursion Ⅰ
Binary Tree and Recursion Ⅰ 这篇帖子简单讨论下二叉树这种数据结构以及一道二叉树算法题。 首先复习下二叉树的基本知识 二叉树特点 1、每个结点最多有两颗子树,结点的度最大为 2 2、左子树和右子树是有顺序的,次序不能颠倒 3、即使某结点只有一个子树,也要区分左右子树。 满二叉树和完全二叉树的定义 在一棵二叉树中,如果所有分支结点都存在左子树和右子树,并且叶子原创 2018-01-12 10:48:53 · 246 阅读 · 0 评论 -
Sort Algorithms
Sort Algorithms 常见排序算法总结 本文将总结3种常见的排序算法,分别是冒泡排序法,选择排序法和快速排序法。 Bubble Sort:比较两个相邻的元素,将值大的元素交换至右端,持续此操作直至数组末端。经过这一趟比较,我们已经将数组中最大的元素放在了整个数组的最右端。然后需要对前面N-1个元素也利用同样的过程操作。由此可见:N个数字要排序完成,总共进行N-1趟排序,第i趟的排序次...原创 2018-02-08 02:02:14 · 309 阅读 · 0 评论 -
Reverse Integer
LeetCode Reverse Integer 先贴题目: Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return -321 The input is assumed to be a 32-bit signed integer. Your function should...原创 2018-02-08 02:06:08 · 268 阅读 · 0 评论 -
LintCode Introduce Java & Coding Interview
LintCode Introduce Java 必做部分 9.4号美国劳动节放假一天,换个平台刷点算法题,先从基础的开始,由于这部分题目比较简单,我准备一个单元分两次写博客,一次必做题部分,一次选做题部分。今天带来的是第一单元必做题部分: 第一题 反转一个只有3位数的整数。 注意事项 你可以假设输入一定是一个只有三位数的整数,这个整数大于等于100,小于1000。 样例 123 反转...原创 2018-02-08 02:06:30 · 313 阅读 · 0 评论 -
Merge Two Binary Trees
LeetCode Merge Two Binary Trees 先看题目: Given two binary trees and imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others are not. You n...原创 2018-02-08 02:06:43 · 300 阅读 · 0 评论 -
Judge Route Circle
LeetCode Judge Route Circle 先贴上题目: Initially, there is a Robot at position (0, 0). Given a sequence of its moves, judge if this robot makes a circle, which means it moves back to the original place....原创 2018-02-08 02:06:52 · 326 阅读 · 0 评论 -
Encode and Decode TinyURL
LeetCode Encode and Decode TinyURL 先贴上题目: TinyURL is a URL shortening service where you enter a URL such as https://leetcode.com/problems/design-tinyurl and it returns a short URL such as http://tin...原创 2018-02-08 02:07:02 · 375 阅读 · 0 评论 -
Hamming Distance
LeetCode Hamming Distance 先贴题目 The Hamming distance between two integers is the number of positions at which the corresponding bits are different. Given two integers x and y, calculate the Hamming ...原创 2018-02-08 02:07:10 · 391 阅读 · 0 评论 -
LeetCode Two Sum
LeetCode Two Sum 先贴上LeetCode第一题题目: Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have exactly one so...原创 2018-02-08 02:07:18 · 284 阅读 · 0 评论 -
LintCode Java Basic, Integer and Array 第一部分
LintCode Java Basic, Integer and Array原创 2017-09-08 09:49:22 · 243 阅读 · 0 评论