- 博客(243)
- 资源 (6)
- 收藏
- 关注
原创 LeetCode题解:Word Break
Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or more dictionary words.For example, given s = “leetcode”, dict = [“leet”, “co
2016-02-09 17:41:01 522
原创 LeetCode题解: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 the list.题意:给定一个链表包含一个随机的指针,指针可能指向链表中任意一个元素或者指向n
2016-02-09 17:36:31 322
原创 LeetCode题解:Single Number II
Given an array of integers, every element appears three times except for one. Find that single one.Note: Your algorithm should have a linear runtime complexity. Could you implement it without using ex
2016-02-09 17:30:43 422
原创 LeetCode题解: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-02-09 16:39:55 1236
原创 LeetCode题解:Candy
There are N children standing in a line. Each child is assigned a rating value.You are giving candies to these children subjected to the following requirements:Each child must have at least one candy.
2016-02-09 16:37:03 439
原创 LeetCode题解:Gas Station
There are N gas stations along a circular route, where the amount of gas at station i is gas[i].You have a car with an unlimited gas tank and it costs cost[i] of gas to travel from station i to its nex
2016-02-09 14:04:24 385
原创 LeetCode题解:Clone Graph
Clone an undirected graph. Each node in the graph contains a label and a list of its neighbors.OJ’s undirected graph serialization: Nodes are labeled uniquely.We use # as a separator for each node, an
2016-02-09 13:47:23 389
原创 LeetCode题解:Palindrome Partitioning
Given a string s, partition s such that every substring of the partition is a palindrome.Return all possible palindrome partitioning of s.For example, given s = “aab”, Return[ [“aa”,”b”], [“
2016-02-09 13:39:43 436
原创 LeetCode题解:Surrounded Regions
Given a 2D board containing ‘X’ and ‘O’, capture all regions surrounded by ‘X’.A region is captured by flipping all ‘O’s into ‘X’s in that surrounded region.For example, X X X X X O O X X X O X X O
2016-02-09 13:33:32 417
原创 LeetCode题解:Longest Consecutive Sequence
Given an unsorted array of integers, find the length of the longest consecutive elements sequence.For example, Given [100, 4, 200, 1, 3, 2], The longest consecutive elements sequence is [1, 2, 3, 4].
2016-02-09 13:29:45 326
原创 ShapableLoadingView 酷炫到爆炸的进度条
项目地址ShapableLoadingViewIntroShapableLoadingView 是高度可配置且可自定义的进度条控件,你可以设置任何可通过 Path 绘制的图形作为动画元素。English VersionPreview使用1. 添加依赖dependencies { ... compile 'com.github.chaossss:ShapableLoadingView:
2016-02-06 09:59:22 647
原创 MVP架构开发的鼠绘漫画客户端
IShuHui利用鼠绘的接口,参考 MVP 架构开发的鼠绘漫画 App。APK 下载Snapshots 参考/引用MousePaint 最初灵感来源于此项目,但项目本身代码质量不高,很多部分很混乱,于是重构大部分代码,用MVP架构重新开发,完成本项目。在此感谢cjj的分享GlideokhttpButterKnifeandroid-PullRefreshLayoutCircleIndi
2016-02-06 09:51:14 588
原创 PianoView-添加一行代码使用[最美应用]的酷炫控件!
PianoViewEnglish VersionPianoView 能提供一个有趣的类似钢琴键盘的 ViewPager Indicator,即目前最美应用使用的控件。效果图:UsageDependencyMin SDK:2.3.3Add Dependency在项目的 build.gradle 里添加:dependencies { ... compile 'com.github.cha
2016-01-22 12:11:04 695
原创 Android 开发生僻却实用的知识点 Part 3
Android 开发生僻却实用的知识点 Part 3 原文链接 : Android Development Tidbits // No. 3 原文作者 : Charlie 译文出自 : 开发技术前线 www.devtf.cn。未经允许,不得转载! 译者 : chaossss 校对者: chaossss 状态 : 完成 欢迎大家阅读“Android 开发生僻
2015-12-10 09:41:51 654
原创 Android 开发生僻却实用的知识点 Part 2
Android 开发生僻却实用的知识点 Part 2 原文链接 : Android Development Tidbits // No. 2 原文作者 : Charlie 译文出自 : 开发技术前线 www.devtf.cn。未经允许,不得转载! 译者 : chaossss 校对者: chaossss 状态 : 完成 欢迎大家来看“Android 开发生僻却
2015-12-10 09:41:35 525
原创 Android 开发生僻却实用的知识点 Part 1
Android 开发生僻却实用的知识点 Part 1 原文链接 : Android Development Tidbits // No. 1 原文作者 : Charlie 译文出自 : 开发技术前线 www.devtf.cn。未经允许,不得转载! 译者 : chaossss 校对者: chaossss 状态 : 完成 我所在的 WillowTree 的 A
2015-12-10 09:40:58 1099
原创 BadgedView - 一行代码为任意 View 添加标签
BadgedViewGithub 项目地址废话不多说,先看效果图:BadgedImageView 就是 Plaid 和 虎扑体育 用来给图片添加标签的控件。yesidlazaro 的实现里,只能为 ImageView 添加 Badge,我看了看他的代码发现这个控件其实蛮简单的,想法挺好,但是代码写的不是特别好。而且我觉得应该能将这个控件应用到任意一个 View 上边,所以我根据我的想法实现了 Bad
2015-12-01 09:19:11 2829
原创 Android 中的依赖注入框架
Android 中的依赖注入框架 原文链接 : Dependency Injection on Android 原文作者 : Just Eat 译文出自 : 开发技术前线 www.devtf.cn。未经允许,不得转载! 译者 : chaossss 校对者: chaossss 状态 : 完成 09年我刚开发 App 那会,情况和现在不太一样。App 作为新生
2015-11-20 09:06:03 705
原创 记 Integer 的一个小坑
最近用 Java 刷算法题的时候发现 Integer 有一个小坑,我把当时的代码简化如下:public class Learn { public static void main(String[] args) { System.out.println(Integer.valueOf("66") == Integer.valueOf("66")); System
2015-11-15 16:57:06 950
原创 通过硬件层提高Android动画的性能
通过硬件层提高Android动画的性能 原文链接 : Using hardware layers to improve Android animation performance 原文作者 : Dan Lew 译文出自 : 开发技术前线 www.devtf.cn。未经允许,不得转载! 译者 : chaossss 校对者: chaossss 状态 : 完成
2015-11-08 09:14:26 572
原创 用 Flux 架构 Android 应用
Flux and Android 原文链接 : Flux and Android 原文作者 : Austin Mueller 译文出自 : 开发技术前线 www.devtf.cn。未经允许,不得转载! 译者 : chaossss 校对者: chaossss 状态 : 完成 Motivation互联网的浪潮让许多IT从业者走上创业的路,我就是其中一员。我最近加
2015-11-05 10:16:03 1900
原创 兼容低版本的 Material Design ProgressBar
最近在开发的 App 需要严格遵循 Material Design,PM 天天来提各个控件要改这改那的,这几天我就在想办法把进度条改成 Material Design 的进度条。虽说我们现在用的进度条能在 Android Lolipop 之后的版本显示成符合规范的效果,但 PM 说之前的版本也要能显示这个效果,让我想办法弄好。最后当然是弄好了,所以今天写博客出来和大家分享一下:实际效果这个效果初看起
2015-11-02 09:31:55 2349
原创 LeetCode题解:Sum Root to Leaf Numbers
Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number.An example is the root-to-leaf path 1->2->3 which represents the number 123.Find the total sum of al
2015-10-02 21:14:31 792 1
原创 LeetCode题解:Word Ladder
Given two words (beginWord and endWord), and a dictionary’s word list, find the length of shortest transformation sequence from beginWord to endWord, such that:Only one letter can be changed at a time
2015-10-02 21:13:10 1037
原创 LeetCode题解: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 the maximum profit. You may complete as many transactions as you like (ie, buy one and
2015-10-02 21:07:59 901
原创 LeetCode题解: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 complete at most one transaction (ie, buy one and sell one share of the stock), desi
2015-10-02 21:06:16 1028
原创 LeetCode题解:Triangle
Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the following triangle [ [2], [3,4], [6,5,
2015-10-02 21:04:26 865
原创 LeetCode题解:Populating Next Right Pointers in Each Node
Given a binary treestruct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next;}Populate each next pointer to point to its next right node. If there is no next right node,
2015-10-02 21:01:47 903
原创 LeetCode题解:Flatten Binary Tree to Linked List
Given a binary tree, flatten it to a linked list in-place.For example, Given 1 / \ 2 5 / \ \ 3 4 6The flattened tree should look like: 1 \ 2 \ 3
2015-10-02 20:59:45 774
原创 LeetCode题解:Path Sum II
Given a binary tree and a sum, find all root-to-leaf paths where each path’s sum equals the given sum.For example: Given the below binary tree and sum = 22, 5 / \
2015-10-02 20:50:41 707
原创 LeetCode题解:Convert Sorted List to Binary Search Tree
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.题意:给定一个升序排列的单链表,转换为二叉搜索树解决思路:同样是二分……代码:public class Solution { private ListNode node;
2015-10-02 20:45:44 976
原创 LeetCode题解:Convert Sorted Array to Binary Search Tree
Given an array where elements are sorted in ascending order, convert it to a height balanced BST.题意:给定一个升序数组,将它转换为二叉搜索树解决思路:二分……代码:public class Solution { public TreeNode sortedArrayToBST(int[] num
2015-10-02 20:43:08 547
原创 LeetCode题解:Construct Binary Tree from Inorder and Postorder Traversal
Given inorder and postorder traversal of a tree, construct the binary tree.Note: You may assume that duplicates do not exist in the tree.题解:通过中序遍历和后序遍历还原二叉树解决思路:首先要明确一点,对于后序遍历的结果,如果一个元素所在的位置为i,若在中序遍历的
2015-10-02 20:35:46 756
原创 LeetCode题解:Construct Binary Tree from Preorder and Inorder Traversal
Given preorder and inorder traversal of a tree, construct the binary tree.Note: You may assume that duplicates do not exist in the tree.题意:给定一棵树的前序遍历和中序遍历,还原二叉树解决思路:我们可以知道的是,前序遍历的第一个结点就是根节点,而且对于中序遍历,每
2015-10-02 20:16:29 469
原创 LeetCode题解:Binary Tree Zigzag Level Order Traversal
Given a binary tree, return the zigzag level order traversal of its nodes’ values. (ie, from left to right, then right to left for the next level and alternate between).For example: Given binary tree
2015-10-02 20:10:01 781
原创 LeetCode题解:Validate Binary Search Tree
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 less than the node’s key. The right
2015-10-02 20:06:23 663
原创 LeetCode题解:Unique Binary Search Trees II
Given n, generate all structurally unique BST’s (binary search trees) that store values 1…n.For example, Given n = 3, your program should return all 5 unique BST’s shown below.1 3 3 2
2015-10-02 20:01:33 668
原创 LeetCode题解:Unique Binary Search Trees
Given n, how many structurally unique BST’s (binary search trees) that store values 1…n?For example, Given n = 3, there are a total of 5 unique BST’s.1 3 3 2 1 \ /
2015-10-02 19:57:15 501
原创 LeetCode题解:Binary Tree Inorder Traversal
Given a binary tree, return the inorder traversal of its nodes’ values.For example: Given binary tree {1,#,2,3}, 1 \ 2 / 3 return [1,3,2].题意:中序遍历二叉树解决思路:”左根右“的递归或者通过栈完成的迭代代码:p
2015-10-02 19:29:46 628
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人