自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

yanhangy的博客

计算机

  • 博客(46)
  • 收藏
  • 关注

原创 ucore lab2 实验报告

ucore lab2 实验报告练习0:填写已有实验 本实验依赖实验1.请把你做的实验1的代码填入本实验中代码中有“LAB1”的注释相应部分。提示:可采用diff和patch工具进行半自动的合并(merge),也可用一些图形化的比较/merge工具来手动合并,比如meld,eclipse中的diff/merge工具,understand中的diff/merge工具等。​ 这...

2018-02-12 22:57:57 3881

原创 ucore lab1实验报告

ucore lab1实验报告练习1理解通过 make 生成执行文件的过程。(要求在报告中写出对下述问题的回答) 在此练习中,大家需要通过阅读代码来了解:1)操作系统镜像文件 ucore.img 是如何一步一步生成的?(需要比较详细地解释 Makefile 中每一条相关命令和命令参数的含义,以及说明命令导致的结果) 2)一个被系统认为是符合规范的硬盘主引导扇区的特征是什么?

2018-01-23 16:59:48 1746

原创 启动、中断、异常和系统调用

3.1 计算机的启动流程下图表示了计算机启动时所执行的四个步骤。下面将按照四个步骤更详细的描述。3.1.1 系统加电,BIOS初始化硬件1.从系统加电到CPU执行第一条指令FFFFH:0000H指向的指令是一条跳转指令,跳到系统BIOS中真正的启动处。(段地址*16 + 偏移地址 = 物理地址BIOS是英文"Basic Input Output System"的缩略

2018-01-14 16:35:32 485

转载 SSDT Hook实现内核级的进程保护

目录SSDT Hook效果图SSDT简介SSDT结构SSDT HOOK原理Hook前准备如何获得SSDT中函数的地址呢SSDT Hook流程SSDT Hook实现进程保护Ring3与Ring0的通信如何安装启动停止卸载服务参考文献源码附件版权SSDT Hook效果图加载驱动并成功Hook  NtTerminateProcess函数:当对 指定的进程进行保护后,尝

2017-10-19 22:07:47 421

原创 windows内核驱动之环境搭建-双机调试 wdk7600+win7/xp+windbg

一、环境介绍主机环境:win10虚拟机环境:win7或者xpsp3(都是ghost,安装得时候注意将下图中CD/DVD高级设置中虚拟设备节点选为IDE,见图1)。图1 CD/DVD高级设置中虚拟设备节点选择装虚拟机得过程就不赘述了,网上有很多资料。二、win10(主机) + xpsp3(虚拟机) + windbg环境配置1、配

2017-10-17 19:49:55 4133 1

转载 c++ 内联函数

1.  内联函数在C++中我们通常定义以下函数来求两个整数的最大值:复制代码 代码如下:int max(int a, int b){ return a > b ? a : b;}为这么一个小的操作定义一个函数的好处有:① 阅读和理解函数 max 的调用,要比读一条等价的条件表达式并解释它的含义要容易得多② 如果需要做任何修改,修改

2017-10-04 07:27:20 152

原创 199. Binary Tree Right Side View

Given a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom.For example:Given the following binary tree, 1

2017-09-23 20:27:01 131

原创 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

2017-09-20 09:24:13 209

原创 111. Minimum Depth of Binary Tree

Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node.本来以为bfs速度会很快,结果实际运行不是这样。

2017-09-19 17:55:49 304

原创 112. Path Sum

Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.For example:Given the below binary tree and sum

2017-09-19 10:59:07 282

原创 257. Binary Tree Paths

Given a binary tree, return all root-to-leaf paths.For example, given the following binary tree: 1 / \2 3 \ 5All root-to-leaf paths are:["1->2->5", "1->3"]Credits:Speci

2017-09-19 09:46:03 267

原创 101. Symmetric Tree

Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree [1,2,2,3,4,4,3] is symmetric: 1 / \ 2 2 / \ / \3 4 4 3

2017-09-16 12:12:39 135

原创 437. Path Sum III

You are given a binary tree in which each node contains an integer value.Find the number of paths that sum to a given value.The path does not need to start or end at the root or a leaf, but it mus

2017-09-16 09:19:45 145

原创 645. Set Mismatch

The set S originally contains numbers from 1 to n. But unfortunately, due to the data error, one of the numbers in the set got duplicated to another number in the set, which results in repetition

2017-09-16 09:06:13 181

原创 594. Longest Harmonious Subsequence

We define a harmonious array is an array where the difference between its maximum value and its minimum value is exactly 1.Now, given an integer array, you need to find the length of its longest har

2017-09-16 01:24:34 160

原创 108. Convert Sorted Array to Binary Search Tree

Given an array where elements are sorted in ascending order, convert it to a height balanced BST.我的解答:/** * Definition for a binary tree node. * struct TreeNode { * int val;

2017-09-16 01:06:40 138

原创 121. Best Time to Buy and Sell Stock

Say you have an array for which the ith element is the price of a given stock on day i.If you were only permitted to complete at most one transaction (ie, buy one and sell one share of the stock), d

2017-09-14 22:13:45 145

原创 C++相关问题

1.int const* p, int * const p, const int* p分别有什么区别转自http://blog.csdn.net/luokh327/article/details/51774572一、指针和const        总体来说:如果关键字const出现在星号(*)左边,表示被指物是常量;如果出现在星号右边,表示指针自身是常量;如果出现在星号

2017-09-14 21:59:13 180

原创 572. Subtree of Another Tree

Given two non-empty binary trees s and t, check whether tree t has exactly the same structure and node values with a subtree of s. A subtree of s is a tree consists of a node in s and all of this no

2017-09-13 08:53:08 135

原创 671. Second Minimum Node In a Binary Tree

Given a non-empty special binary tree consisting of nodes with the non-negative value, where each node in this tree has exactly twoor zero sub-node. If the node has two sub-nodes, then this node's v

2017-09-12 21:56:12 151

原创 543. Diameter of Binary Tree

Given a binary tree, you need to compute the length of the diameter of the tree. The diameter of a binary tree is the length of thelongest path between any two nodes in a tree. This path may or may

2017-09-12 21:28:59 151

原创 504. Base 7

Given an integer, return its base 7 string representation.Example 1:Input: 100Output: "202"Example 2:Input: -7Output: "-10"Note: The input will be in range of [-1e7, 1e7].

2017-09-12 21:26:44 98

原创 268. Missing Number

Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array.For example,Given nums = [0, 1, 3] return 2.Note:Your algorithm should ru

2017-09-11 10:31:17 127

原创 100. Same Tree

Given two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally identical and the nodes have the same value./** * Definit

2017-09-06 23:10:37 121

原创 653. Two Sum IV - Input is a BST

Given a Binary Search Tree and a target number, return true if there exist two elements in the BST such that their sum is equal to the given target.Example 1:Input: 5 / \ 3 6 / \

2017-09-06 21:51:15 118

原创 STL vector源码分析

vector1.vector概述vector和array非常类似,区别在于array是静态空间,一旦配置就不能改变了。空间不够之后需要换个更大的空间,这个工作需要有客户端自己打理。vector是动态空间,内部机制会自行扩充空间来容纳新元素。vector技术中关键部分在于,对大小的配置以及重新配置时数据移动的效率。2.vector定义template class vecto

2017-09-06 15:58:46 304

原创 404. Sum of Left Leaves

Find the sum of all left leaves in a given binary tree.Example: 3 / \ 9 20 / \ 15 7There are two left leaves in the binary tree, with values 9 and 15 respectively. Return 24.

2017-09-04 10:56:12 112

原创 530. Minimum Absolute Difference in BST

Given a binary search tree with non-negative values, find the minimum absolute difference between values of any two nodes.Example:Input: 1 \ 3 / 2Output:1Explanation:Th

2017-09-03 21:23:53 130

原创 538. 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.Exampl

2017-09-03 13:36:35 109

原创 389. Find the Difference

Given two strings s and t which consist of only lowercase letters.String t is generated by random shuffling string s and then add one more letter at a random position.Find the letter that was ad

2017-09-03 12:57:29 127

原创 557. Reverse Words in a String III

Given a string, you need to reverse the order of characters in each word within a sentence while still preserving whitespace and initial word order.Example 1:Input: "Let's take LeetCode contest"

2017-09-02 16:44:13 194

原创 617. Merge Two Binary Trees

Given two binary trees and imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others are not.You need to merge them into a new binary tr

2017-09-02 07:10:54 112

原创 226. Invert Binary Tree

Invert a binary tree. 4 / \ 2 7 / \ / \1 3 6 9to 4 / \ 7 2 / \ / \9 6 3 1我的解法:/** * Definition for a binary tree node. * struct TreeNode { *

2017-09-01 22:34:52 108

原创 485. Max Consecutive Ones

Given a binary array, find the maximum number of consecutive 1s in this array.Example 1:Input: [1,1,0,1,1,1]Output: 3Explanation: The first two digits or the last three digits are consecutive

2017-09-01 17:20:01 126

原创 637. Average of Levels in Binary Tree 104. Maximum Depth of Binary Tree

Given a non-empty binary tree, return the average value of the nodes on each level in the form of an array.Example 1:Input: 3 / \ 9 20 / \ 15 7Output: [3, 14.5, 11]Explanat

2017-09-01 15:58:17 113

原创 575. Distribute Candies

Given an integer array with even length, where different numbers in this array represent different kinds of candies. Each number means one candy of the corresponding kind. You need to distribute the

2017-09-01 12:08:39 157

原创 500. Keyboard Row

Given a List of words, return the words that can be typed using letters of alphabet on only one row's of American keyboard like the image below.Example 1:Input: ["Hello", "Alaska", "Dad",

2017-09-01 09:21:09 171

原创 476. Number Complement

Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation.Note:The given integer is guaranteed to fit within the range of

2017-09-01 08:42:13 120

原创 561. Array Partition I

Given an array of 2n integers, your task is to group these integers into n pairs of integer, say (a1, b1), (a2, b2), ..., (an, bn) which makes sum of min(ai, bi) for all i from 1 to n as large a

2017-08-31 22:34:16 125

原创 657. Judge Route Circle

Initially, there is a Robot at position (0, 0). Given a sequence of its moves, judge if this robot makes a circle, which means it moves back tothe original place. The move sequence is represented

2017-08-31 21:02:15 231

空空如也

空空如也

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

TA关注的人

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