要喝温的

【Operating System】 基于Android为进程添加级别及调试

最近在学习 操作系统 看到每个进程都有 pid 等很多属性。 那我们可以做到修改或者添加进程的某个属性, 进而影响操作系统的运行吗? 本文 以 Android 系统为例,尝试为进程添加级别属性。 第一步 是要找到进程属性的定义的地方。在/include/linux/sched.h内的 tas...

2018-05-20 03:04:30

阅读数 60

评论数 0

LeetCode 刷题笔记 之 Lowest Common Ancestor of a Binary Tree

题目如下:Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree.According to the definition of LCA on Wikipedia: “The ...

2018-05-20 01:46:09

阅读数 37

评论数 0

LeetCode 刷题笔记 之 Sort List

题目如下:Sort a linked list in O(n log n) time using constant space complexity.Example 1:Input: 4->2->1->3 Output: 1-&am...

2018-05-19 02:14:49

阅读数 27

评论数 0

LeetCode 刷题笔记 之 Maximal Square

题目如下:Given a 2D binary matrix filled with 0's and 1's, find the largest square containing only 1's and return its area.Example:Input: 1 0 1 0 0 1 0...

2018-05-19 01:58:30

阅读数 28

评论数 0

LeetCode 刷题笔记 之 Word Break

题目如下:Given a non-empty string s and a dictionary wordDict containing a list of non-empty words, determine if s can be segmented into a space-separate...

2018-05-18 07:54:36

阅读数 53

评论数 0

LeetCode 刷题笔记 之 Course Schedule

题目如下:There are a total of n courses you have to take, labeled from 0 to n-1.Some courses may have prerequisites, for example to take course 0 you hav...

2018-05-18 07:14:49

阅读数 50

评论数 0

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.For examp...

2018-05-18 02:43:45

阅读数 39

评论数 0

LeetCode 刷题笔记 之 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 a...

2018-05-18 01:29:32

阅读数 30

评论数 0

LeetCode 刷题笔记 之 Flatten Binary Tree to Linked List

题目如下:Given a binary tree, flatten it to a linked list in-place.For example, given the following tree: 1 / \ 2 5 / \ \ 3 4 6 The flat...

2018-05-17 09:12:32

阅读数 26

评论数 0

LeetCode 刷题笔记 之 Perfect Squares

题目如下:Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, ...) which sum to n.Example 1:Input: n = ...

2018-05-17 08:50:51

阅读数 28

评论数 0

LeetCode 刷题笔记 之 Partition Equal Subset Sum

题目如下:Given a non-empty array containing only positive integers, find if the array can be partitioned into two subsets such that the sum of elements i...

2018-05-17 03:02:45

阅读数 31

评论数 0

LeetCode 刷题笔记 之 Combination Sum

题目如下:Given a set of candidate numbers (candidates) (without duplicates) and a target number (target), find all unique combinations in candidates wher...

2018-05-16 00:26:54

阅读数 30

评论数 0

LeetCode 刷题笔记 之 Unique Binary Search Trees

题目如下:Given n, how many structurally unique BST's (binary search trees) that store values 1 ... n?Example:Input: 3 Output: 5 Explanation: Given n = 3,...

2018-05-15 01:39:19

阅读数 28

评论数 0

LeetCode 刷题笔记 之 Best Time to Buy and Sell Stock with Cooldown

题目如下: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 c...

2018-05-15 01:31:16

阅读数 25

评论数 0

LeetCode 刷题笔记 之 Task Scheduler

题目如下:Given a char array representing tasks CPU need to do. It contains capital letters A to Z where different letters represent different tasks.Tasks...

2018-05-15 00:17:39

阅读数 30

评论数 0

LeetCode 刷题笔记 之 Convert BST to Greater Tree

题目如下:Given a Binary Search Tree (BST), convert it to a Greater Tree such that every key of the original BST is changed to the original key plus sum o...

2018-05-10 05:27:52

阅读数 28

评论数 0

LeetCode 刷题笔记 之 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 tr...

2018-05-10 00:47:51

阅读数 27

评论数 0

LeetCode 刷题笔记 之 target sum

题目描述如下:You are given a list of non-negative integers, a1, a2, ..., an, and a target, S. Now you have 2 symbols+ and-. For each integer, you should ch...

2018-05-10 00:13:06

阅读数 41

评论数 0

Leetcode 刷题笔记 之 Find the Duplicate Number

题目如下:Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one duplicate number must e...

2018-05-09 23:51:16

阅读数 21

评论数 0

LeetCode 刷题笔记 之 House Robber III

题目如下:The thief has found himself a new place for his thievery again. There is only one entrance to this area, called the "root." Be...

2018-05-09 23:39:35

阅读数 38

评论数 0

提示
确定要删除当前文章?
取消 删除
关闭
关闭