- 博客(20)
- 资源 (14)
- 收藏
- 关注
原创 LeetCode17 17. Letter Combinations of a Phone Number My Submissions QuestionEditorial Solution
Given a digit string, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the telephone buttons) is given below.Input:Digit st
2016-06-29 17:05:17 357
原创 Leetcode12. Integer to Roman
Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.这道题我是考虑10进制左移运算,求出各个位的值,然后用查表法来构造字符串,其中0用“”来代替。public class Solution { public
2016-06-29 11:11:10 232
原创 Leetcode 21. Merge Two Sorted Lists
Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.这道题其实就是MergeSort的升级版。思路就采用MergeSort。代码如下。/** * Def
2016-06-28 16:44:15 213
原创 leetcode 24. Swap Nodes in Pairs
Given a linked list, swap every two adjacent nodes and return its head.For example,Given 1->2->3->4, you should return the list as 2->1->4->3.Your algorithm should use only constant space. Y
2016-06-28 13:00:36 181
原创 leetcode 58. Length of Last Word
Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string.If the last word does not exist, return 0.Note: A word is
2016-06-27 13:02:37 176
原创 leetcode61 Rotate List
Given a list, rotate the list to the right by k places, where k is non-negative.For example:Given 1->2->3->4->5->NULL and k = 2,return 4->5->1->2->3->NULL.就是将头节点设置为k%n; 结尾为k%n -1;我的代码如下。
2016-06-27 10:18:45 197
原创 120. 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],
2016-06-24 19:09:25 229
原创 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 e
2016-06-24 14:23:38 182
原创 leetcode 78. Subsets
Given a set of distinct integers, nums, return all possible subsets.Note: The solution set must not contain duplicate subsets.For example,If nums = [1,2,3], a solution is:[ [3], [1],
2016-06-24 12:36:25 197
原创 leetcode 41 First Missing Positive
Given an unsorted integer array, find the first missing positive integer.For example,Given [1,2,0] return 3,and [3,4,-1,1] return 2.Your algorithm should run in O(n) time and uses constant
2016-06-24 12:24:03 227
原创 TrieTree的实现
TrieTree是字典树,在文本处理中非常好用。先建立节点/** * Created by kyle on 2016/6/23. */public class TrieNode { private final static int NUMBER = 26; private char _value ; private boolean isWorld;
2016-06-23 16:43:48 269
原创 leetcode 189. 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 yo
2016-06-22 12:23:49 199
原创 230. Kth Smallest Element in a BST
Given a binary search tree, write a function kthSmallest to find the kth smallest element in it.Note: You may assume k is always valid, 1 ≤ k ≤ BST's total elements.Follow up:What if the BST i
2016-06-15 10:15:23 193
原创 leetcode2 add two number
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a link
2016-06-13 15:27:16 270
原创 JamesMusic浅读--------9,播放界面初显及播放类完善
上一个章节已经实现了播放功能,这一章节主要实现播放界面的初步。先加载出NowPlayingActivity。/** * Created by kankan on 2016/6/4. */public class NowPlayingActivity extends FragmentActivity { //Common objects. private Contex
2016-06-05 21:50:57 243
原创 JamesMusic浅读--------8,音乐文件播放
设置ListView的onItemClick函数为这个函数调用initPlayback,这个函数根据界面情况,启动播放界面,或者后台音播放服务没开启的话,开启服务。这里先实现开启服务
2016-06-04 10:20:05 379
原创 JamesMusic浅读--------7,音乐列表界面显示
首先我们实现从WecomelActivity到MainActivity。实现方法就是在WelcomeActivity的最后一个界面监听,音乐库building事件 @Override public void onFinishBuildingLibrary(AsyncBuildLibraryTask task) { task.mBuildLibraryProgres
2016-06-02 21:58:12 310
原创 LeetCode 200. Number of Islands
Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically. You may assu
2016-06-02 09:50:34 254
原创 leetcode 198. House Robber
you are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent house
2016-06-01 15:26:28 243
原创 LeetCode162. Find Peak Element
A peak element is an element that is greater than its neighbors.Given an input array where num[i] ≠ num[i+1], find a peak element and return its index.The array may contain multiple peaks, in
2016-06-01 10:37:03 227
FrameLayout动态布局
2016-05-14
STM32F0系列参考例程
2012-08-30
c#串口配置窗体(可用于继承窗体)serialport类
2012-02-25
单片机钢琴protel+keil仿真程序 下下来即可运行
2011-05-05
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人