6 漆黑烈焰使

尚未进行身份认证

A student in Computer Science

等级
TA的排名 15w+

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

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

2018-05-20 03:04:30

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

题目如下:Givenabinarytree,findthelowestcommonancestor(LCA)oftwogivennodesinthetree.Accordingtothe definitionofLCAonWikipedia:“Thelowestcommonancestorisdefinedbetweentwonodes...

2018-05-20 01:46:09

LeetCode 刷题笔记 之 Sort List

题目如下:Sortalinkedlistin O(n log n)timeusingconstantspacecomplexity.Example1:Input:4->2->1->3Output:1->2->3->4Example2:Input:-1->5->3->4->0Output:-1->0...

2018-05-19 02:14:49

LeetCode 刷题笔记 之 Maximal Square

题目如下:Givena2Dbinarymatrixfilledwith0'sand1's,findthelargestsquarecontainingonly1'sandreturnitsarea.Example:Input:10100101111111110010Output:4解答如下:方法还是用动态规划...

2018-05-19 01:58:30

LeetCode 刷题笔记 之 Word Break

题目如下:Givena non-empty string s andadictionary wordDict containingalistof non-empty words,determineif s canbesegmentedintoaspace-separatedsequenceofoneormoredictionarywords.Note:The...

2018-05-18 07:54:36

LeetCode 刷题笔记 之 Course Schedule

题目如下:Thereareatotalof n coursesyouhavetotake,labeledfrom 0 to n-1.Somecoursesmayhaveprerequisites,forexampletotakecourse0youhavetofirsttakecourse1,whichisexpressedasap...

2018-05-18 07:14:49

LeetCode 刷题笔记 之 Construct Binary Tree from Preorder and Inorder Traversal

题目如下:Givenpreorderandinordertraversalofatree,constructthebinarytree.Note:Youmayassumethatduplicatesdonotexistinthetree.Forexample,givenpreorder= [3,9,20,15,7]inorder=[9,3,15...

2018-05-18 02:43:45

LeetCode 刷题笔记 之 Number of Islands

题目如下:Givena2dgridmapof '1's(land)and '0's(water),countthenumberofislands.Anislandissurroundedbywaterandisformedbyconnectingadjacentlandshorizontallyorvertically.Youmaya...

2018-05-18 01:29:32

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

题目如下:Givenabinarytree,flattenittoalinkedlistin-place.Forexample,giventhefollowingtree:1/\25/\\346Theflattenedtreeshouldlooklike:1\2\3...

2018-05-17 09:12:32

LeetCode 刷题笔记 之 Perfect Squares

题目如下:Givenapositiveinteger n,findtheleastnumberofperfectsquarenumbers(forexample, 1,4,9,16,...)whichsumto n.Example1:Input:n=12Output:3Explanation:12=4+4+4.Example2...

2018-05-17 08:50:51

LeetCode 刷题笔记 之 Partition Equal Subset Sum

题目如下:Givena non-empty arraycontaining onlypositiveintegers,findifthearraycanbepartitionedintotwosubsetssuchthatthesumofelementsinbothsubsetsisequal.Note:Eachofthearrayelem...

2018-05-17 03:02:45

LeetCode 刷题笔记 之 Combination Sum

题目如下:Givena set ofcandidatenumbers(candidates) (withoutduplicates) andatargetnumber(target),findalluniquecombinationsin candidates wherethecandidatenumberssumsto target.The same rep...

2018-05-16 00:26:54

LeetCode 刷题笔记 之 Unique Binary Search Trees

题目如下:Given n,howmanystructurallyunique BST's (binarysearchtrees)thatstorevalues1... n?Example:Input:3Output:5Explanation:Givenn=3,thereareatotalof5uniqueBST's:1...

2018-05-15 01:39:19

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

题目如下:Sayyouhaveanarrayforwhichthe ith elementisthepriceofagivenstockonday i.Designanalgorithmtofindthemaximumprofit.Youmaycompleteasmanytransactionsasyoulike(ie,buyo...

2018-05-15 01:31:16

LeetCode 刷题笔记 之 Task Scheduler

题目如下:GivenachararrayrepresentingtasksCPUneedtodo.ItcontainscapitallettersAtoZwheredifferentlettersrepresentdifferenttasks.Taskscouldbedonewithoutoriginalorder.Eachtaskco...

2018-05-15 00:17:39

LeetCode 刷题笔记 之 Convert BST to Greater Tree

题目如下:GivenaBinarySearchTree(BST),convertittoaGreaterTreesuchthateverykeyoftheoriginalBSTischangedtotheoriginalkeyplussumofallkeysgreaterthantheoriginalkeyinBST.Exa...

2018-05-10 05:27:52

LeetCode 刷题笔记 之 Binary Tree Level Order Traversal

题目如下:Givenabinarytree,returnthe levelorder traversalofitsnodes'values.(ie,fromlefttoright,levelbylevel).Forexample:Givenbinarytree [3,9,20,null,null,15,7],3/\920...

2018-05-10 00:47:51

LeetCode 刷题笔记 之 target sum

题目描述如下:Youaregivenalistofnon-negativeintegers,a1,a2,...,an,andatarget,S.Nowyouhave2symbols+ and-.Foreachinteger,youshouldchooseonefrom + and - asitsnewsymbol.Findoutho...

2018-05-10 00:13:06

Leetcode 刷题笔记 之 Find the Duplicate Number

题目如下:Givenanarray nums containing n +1integerswhereeachintegerisbetween1and n (inclusive),provethatatleastoneduplicatenumbermustexist.Assumethatthereisonlyoneduplicatenumbe...

2018-05-09 23:51:16

LeetCode 刷题笔记 之 House Robber III

题目如下:Thethiefhasfoundhimselfanewplaceforhisthieveryagain.Thereisonlyoneentrancetothisarea,calledthe"root."Besidestheroot,eachhousehasoneandonlyoneparenthouse.Aftera...

2018-05-09 23:39:35

查看更多

勋章 我的勋章
    暂无奖章