自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

要喝温的

  • 博客(38)
  • 资源 (2)
  • 收藏
  • 关注

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

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

2018-05-20 03:04:30 209

原创 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 lowest common ancestor is defined between two nodes...

2018-05-20 01:46:09 209

原创 LeetCode 刷题笔记 之 Sort List

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

2018-05-19 02:14:49 133

原创 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 01 0 1 1 11 1 1 1 11 0 0 1 0Output: 4解答如下:方法还是用动态规划...

2018-05-19 01:58:30 129

原创 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-separated sequence of one or more dictionary words.Note:The...

2018-05-18 07:54:36 212

原创 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 have to first take course 1, which is expressed as a p...

2018-05-18 07:14:49 162

原创 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 example, givenpreorder = [3,9,20,15,7]inorder = [9,3,15...

2018-05-18 02:43:45 163

原创 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 adjacent lands horizontally or vertically. You may a...

2018-05-18 01:29:32 107

原创 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 6The flattened tree should look like:1 \ 2 \ 3 ...

2018-05-17 09:12:32 89

原创 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 = 12Output: 3 Explanation: 12 = 4 + 4 + 4.Example 2...

2018-05-17 08:50:51 125

原创 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 in both subsets is equal.Note:Each of the array elem...

2018-05-17 03:02:45 107

原创 LeetCode 刷题笔记 之 Combination Sum

题目如下:Given a set of candidate numbers (candidates) (without duplicates) and a target number (target), find all unique combinations in candidates where the candidate numbers sums to target.The same rep...

2018-05-16 00:26:54 105

原创 LeetCode 刷题笔记 之 Unique Binary Search Trees

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

2018-05-15 01:39:19 100

原创 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 complete as many transactions as you like (ie, buy o...

2018-05-15 01:31:16 111

原创 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 could be done without original order. Each task co...

2018-05-15 00:17:39 236

原创 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 of all keys greater than the original key in BST.Exa...

2018-05-10 05:27:52 119

原创 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 tree [3,9,20,null,null,15,7], 3 / \ 9 20 ...

2018-05-10 00:47:51 119

原创 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 choose one from + and - as its new symbol.Find out ho...

2018-05-10 00:13:06 149

原创 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 exist. Assume that there is only one duplicate numbe...

2018-05-09 23:51:16 125

原创 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." Besides the root, each house has one and only one parent house. After a...

2018-05-09 23:39:35 125

原创 LeetCode 刷题笔记 之 频率最高的k个数(Top K Frequent Elements)

题目如下:Given a non-empty array of integers, return the k most frequent elements.For example,Given [1,1,1,2,2,3] and k = 2, return [1,2].Note: You may assume k is always valid, 1 ≤ k ≤ number of unique e...

2018-05-09 00:35:00 1410

原创 LeetCode 刷题笔记 之 数组自乘

题目如下:Given an array of n integers where n > 1, nums, return an array output such that output[i] is equal to the product of all the elements of nums except nums[i].Solve it without division and in O...

2018-05-09 00:02:46 159

原创 LeetCode 刷题笔记 之 回文子串

题目如下:Given a string, your task is to count how many palindromic substrings in this string.The substrings with different start indexes or end indexes are counted as different substrings even they consi...

2018-05-08 23:36:01 128

原创 LeetCode 刷题笔记之 排高度

题目如下:Suppose you have a random list of people standing in a queue. Each person is described by a pair of integers (h, k), where h is the height of the person and k is the number of people in front of ...

2018-05-08 07:29:18 107

原创 LeetCode 刷题笔记之 全排列 in Java

题目如下:Given a collection of distinct integers, return all possible permutations.Example:Input: [1,2,3]Output:[ [1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], [3,2,1]]解法如下:class Solution {...

2018-05-08 07:11:31 925 1

原创 不知不觉,写了一个编译器(二)

不知不觉,写了一个编译器(二)-----语法分析,主要针对LL文法,建立first,follow以及predict集合

2017-12-24 07:39:36 423

原创 不知不觉,写了一个编译器(一)

写一个编译器系列,第一步-----词法分析

2017-12-24 07:06:19 4677

原创 C++实现优先队列——最小堆,d路堆及配对堆

C++实现三种优先队列

2017-04-25 06:52:10 2600

原创 C++实现Huffman的编解码

Huffman用C++进行编解码的实现

2017-04-25 06:00:52 3253

原创 Java,Socket&TCP编程 实现多线程端对端通信与文件传输

因为要用Java,Socket&TCP编程实现多线程端对端通信与文件传输,现学的Java

2017-03-12 12:22:24 2390 1

原创 OpenGL.Project.3 Bezier in 3d Space

OpenGL project

2016-10-03 09:26:56 514

原创 OpenGL.Project2.Bezier Curve

这次的OpenGL的project是完成了Bezeir曲线的生成。

2016-09-27 02:45:26 580 1

原创 LeetCode.Problem 5 Longest Palindromic Substring

LeetCode.Problem 5 Longest Palindromic Substring

2016-09-17 02:45:18 208

原创 LeetCode.Problem 4 Median of Two Sorted Arrays

LeetCode Problem 4

2016-09-17 01:25:26 169

原创 OpenGL.Project 1.Changing color and Dragging Points

用OpenGL实现鼠标点击变色以及移动。语法是和C++一样的,适合新手练级。

2016-09-08 23:41:32 685 1

原创 LeetCode.Problem3 Longest Substring Without Repeating Characters

LeetCode.Problem3 Longest Substring Without Repeating Characters

2016-07-20 16:26:24 201

原创 LeetCode.Problem 1 Two Sum

LeetCode.Problem 1 Two Sum代码记录

2016-07-20 15:17:16 226

原创 LeetCode.Problem2 Add two numbers

LeetCode.Problem2 Add two numbers的代码记录

2016-07-20 15:02:19 179

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

操作系统 进程的属性添加操作 添加级别 并进行测试

2018-10-16

应用密码学课件

中国科学技术大学密码学课件,介绍密码学的基本分类以及相关数学知识。

2014-11-06

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

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