- 博客(39)
- 资源 (1)
- 收藏
- 关注
原创 Ubuntu for Arm根文件系统制作与SPICE安装
参考:https://wiki.ubuntu.com/ARM/RootfsFromScratch
2014-08-28 15:28:17 2450
原创 LeetCode OJ - Valid Number
Validate if a given string is numeric.Some examples:"0" => true" 0.1 " => true"abc" => false"1 a" => false"2e10" => trueNote: It is intended for the problem statement to be ambiguo
2014-08-28 14:26:02 720
原创 LeetCode OJ - Insert Interval
Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary).You may assume that the intervals were initially sorted according to their start times.E
2014-08-28 14:05:25 517
原创 LeetCode OJ - Merge Intervals
Given a collection of intervals, merge all overlapping intervals.For example,Given [1,3],[2,6],[8,10],[15,18],return [1,6],[8,10],[15,18].
2014-08-27 10:55:23 451
原创 LeetCode OJ - N-Queens II
class Solution { int ret;public: int totalNQueens(int n) { vector item(n); DFS(item, 0); return ret; } bool isValid(vector &item, int end, int x) {
2014-08-26 18:55:34 487
原创 LeetCode OJ - N-Queens
The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other.Given an integer n, return all distinct solutions to the n-queens puzzle.
2014-08-26 18:39:49 535
原创 LeetCode OJ - Wildcard Matching
Implement wildcard pattern matching with support for '?' and '*'.'?' Matches any single character.'*' Matches any sequence of characters (including the empty sequence).The matching should cover t
2014-08-26 16:03:49 486
原创 LeetCode OJ - Trapping Rain Water
Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining.For example, Given [0,1,0,2,1,0,1,3,2,1,2,1]
2014-08-25 22:42:04 469
原创 LeetCode OJ - Combination Sum II
Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.Each number in C may only be used once in the combina
2014-08-24 20:58:33 524
原创 LeetCode OJ - Combination Sum
Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.The same repeated number may be chosen from C unlimited numb
2014-08-23 16:27:33 583
原创 LeetCode OJ - Count and Say
The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...1 is read off as "one 1" or 11.11 is read off as "two 1s" or 21.21 is read off as
2014-08-22 11:58:18 568
原创 LeetCode OJ - Sudoku Solver
Write a program to solve a Sudoku puzzle by filling the empty cells.Empty cells are indicated by the character '.'.You may assume that there will be only one unique solution.A sudoku
2014-08-21 16:59:45 548
原创 LeetCode OJ - Valid Sudoku
Valid SudokuDetermine if a Sudoku is valid, according to: Sudoku Puzzles - The Rules.The Sudoku board could be partially filled, where empty cells are filled with the character'.'.
2014-08-21 16:20:28 517
转载 详解Linux内核红黑树算法的实现
关于二叉查找树的概念请参考博文《详解二叉查找树算法的实现》。 平衡二叉树(BalancedBinary Tree或Height-Balanced Tree)又称AVL树。它或者是一棵空树,或者是具有下列性质的二叉树:它的左子树和右子树都是平衡二叉树,且左子树和右子树的深度之差的绝对值不超过1。若将二叉树上结点的平衡因子BF(BalanceFactor)定义为该结点的左子树的深度减去它
2014-08-21 14:55:42 553
原创 LeetCode OJ - Search for a Range
Given a sorted array of integers, find the starting and ending position of a given target value.Your algorithm's runtime complexity must be in the order of O(log n).If the target is not found
2014-08-21 12:56:35 482
原创 LeetCode OJ - Next Permutation
Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not possible, it must rearrange it as the lowest possible
2014-08-21 11:16:17 569
转载 Android系统横竖屏修改
方法一:android4.0/frameworks/base/services/java/com/android/server/wm/WindowManagerService.java[cpp] view plaincopyint computeForcedAppOrientationLocked() { int req
2014-08-20 14:52:43 860
原创 Android SurfaceFlinger介绍
功能:SurfaceFlinger用来绘制应用程序的UI,应用程序与SurfaceFlinger处在不同的进程中,采用Binder机制通信。从C/S模式的角度来看,应用程序是客户端,SurfaceFlinger是服务端,SurfaceFlinger是绘制UI的服务中心。实现: 每个Android应用程序都与SurfaceFlinger有一个连接,通过类型为Client的Bin
2014-08-18 15:40:40 1097
原创 LeetCode OJ - Substring with Concatenation of All Words
You are given a string, S, and a list of words, L, that are all of the same length. Find all starting indices of substring(s) in S that is a concatenation of each word in L exactly once and without an
2014-08-17 20:51:00 600
原创 Android系统匿名共享内存Ashmem
在Android系统中,提供了独特的匿名共享内存子系统Ashmem(Anonymous Shared Memory),它以驱动程序的形式实现在内核空间中。它有两个特点,一是能够辅助内存管理系统来有效地管理不再使用的内存块,二是它通过Binder进程间通信机制来实现进程间的内存共享。本文中,我们将通过实例来简要介绍Android系统的匿名共享内存的使用方法,使得我们对Android系统的匿名共享内存
2014-08-15 14:17:55 810
原创 LeetCode OJ - 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
2014-08-15 12:27:43 480
转载 线程池的研究及实现
什么是线程池?诸如web服务器、数据库服务器、文件服务器和邮件服务器等许多服务器应用都面向处理来自某些远程来源的大量短小的任务。构建服务器应用程序的一个过于简单的模型是:每当一个请求到达就创建一个新的服务对象,然后在新的服务对象中为请求服务。但当有大量请求并发访问时,服务器不断的创建和销毁对象的开销很大。所以提高服务器效率的一个手段就是尽可能减少创建和销毁对象的次数,特别是一些很耗资源的对
2014-08-13 19:26:23 348
原创 LeetCode OJ - Populating Next Right Pointers in Each Node II
Populating Next Right Pointers in Each Node II
2014-08-11 23:23:37 621
原创 LeetCode OJ - Reverse Nodes in k-Group
Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.If the number of nodes is not a multiple of k then left-out nodes in the end should remain as it is
2014-08-11 22:31:09 491
转载 《Linux设备节点创建》用户空间ueventd创建设备节点规则
说明:本文基于Android2.3和Linux2.6,其余版本仅供参考。一、devfs、udev和sysfs是什么关系?linux2.6之前使用devfs设备文件系统,它存在与内核空间;linux2.6之后使用udev设备文件系统,它存在与用户空间、但严重依赖与sysfs文件系统。二、Android(使用linux2.6以后的设备节点创建策略)设备节点的创建
2014-08-11 10:31:26 788
原创 LeetCode OJ - Binary Tree Level Order Traversal
Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level).For example:Given binary tree {3,9,20,#,#,15,7}, 3 / \ 9 20
2014-08-09 15:20:03 535
原创 LeetCode OJ - Anagrams
Given an array of strings, return all groups of strings that are anagrams.Note: All inputs will be in lower-case.分析:是用hash表记录。对于一组的,
2014-08-09 00:10:53 444
原创 LeetCode OJ - Spiral Matrix II
Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order.For example,Given the following matrix:[ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ]]
2014-08-08 23:24:54 467
原创 LeetCode OJ - Spiral Matrix
Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order.For example,Given the following matrix:[ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ]]
2014-08-08 23:07:51 467
原创 LeetCode OJ - 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.fe
2014-08-07 19:52:47 471
原创 LeetCode OJ - Climbing Stairs
You are climbing a stair case. It takes n steps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?
2014-08-06 13:34:56 560
原创 LeetCode OJ - 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.Th
2014-08-05 11:09:01 445
原创 LeetCode OJ - Convert Sorted Array to Binary Search Tree
Given an array where elements are sorted in ascending order, convert it to a height balanced BST.分析:根据排序shu
2014-08-01 23:20:38 608
原创 LeetCode OJ - Permutations
Given a collection of numbers that might contain duplicates, return all possible unique permutations.For example,[1,1,2] have the following unique permutations:[1,1,2], [1,2,1], and [2,1,1].
2014-08-01 10:29:28 404
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人