自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

memcpy0的博客

自由软件给我自由!

  • 博客(42)
  • 资源 (8)
  • 收藏
  • 关注

原创 LeetCode C++ 面试题 01.02. Check Permutation LCCI

Given two strings,write a method to decide if one is a permutation of the other.Example 1:Input: s1 = "abc", s2 = "bca"Output: trueExample 2:Input: s1 = "abc", s2 = "bad"Output: falseNote:0 <= len(s1) <= 1000 <= len(s2) <= 100题目:判

2020-07-29 17:14:11 209

原创 LeetCode C++ 792. Number of Matching Subsequences【动态规划】中等

Given string S and a dictionary of words words , find the number of words[i] that is a subsequence of S .Example:Input: S = "abcde"words = ["a", "bb", "acd", "ace"]Output: 3Explanation: There are three words in words that are a subsequence of S: "a",

2020-07-29 00:48:35 209

原创 LeetCode C++ 392. Is Subsequence【动态规划】简单

Given a string s and a string t , check if s is subsequence of t .A subsequence of a string is a new string which is formed from the original string by deleting some (can be none) of the characters without disturbing the relative positions of the remainin

2020-07-29 00:37:24 286

原创 LeetCode C++ 面试题 01.01. Is Unique LCCI【Array】简单

Implement an algorithm to determine if a string has all unique characters. What if you cannot use additional data structures?Example 1:Input: s = "leetcode"Output: falseExample 2:Input: s = "abc"Output: trueNote: 如果你不使用额外的数据结构,会很加分。题意:实现一个算法,确认一个

2020-07-28 22:38:15 217

原创 LeetCode C++ 28. Implement strStr()【字符串】简单

Implement strStr() .Return the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.Example 1:Input: haystack = "hello", needle = "ll"Output: 2Example 2:Input: haystack = "aaaaa", needle = "bba"Output: -1C

2020-07-28 17:59:33 449

原创 LeetCode 709. To Lower Case【字符串】简单

Implement function ToLowerCase() that has a string parameter str, and returns the same string in lowercase.Example 1:Input: "Hello"Output: "hello"Example 2:Input: "here"Output: "here"Example 3:Input: "LOVELY"Output: "lovely"题意:将字符串中的大写字母转为小写。

2020-07-28 12:00:49 243

原创 LeetCode C++ 151. Reverse Words in a String 【字符串】中等·

Given an input string, reverse the string word by word.Example 1:Input: "the sky is blue"Output: "blue is sky the"Example 2:Input: " hello world! "Output: "world! hello"Explanation: Your reversed string should not contain leading or trailing spac

2020-07-28 11:42:33 265

原创 LeetCode C++ 559. Maximum Depth of N-ary Tree【Tree/DFS/BFS】简单

Given a n-ary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.Nary-Tree input serialization is represented in their level order traversal, each group of childr

2020-07-28 01:13:10 169

原创 LeetCode C++ 104. Maximum Depth of Binary Tree【Tree/DFS/BFS】简单

Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.Note: A leaf is a node with no children.Example:Given binary tree [3,9,20,null,null,15,7],

2020-07-28 00:52:00 229

原创 【Makefile】学习笔记1 Makefile文件、规则、工作流程、变量定义和自动化变量

文章目录1. `Makefile` 文件概述2. `Makefile` 文件中包含哪些规则?3. `Makefile` 的工作流程4. `Makefile` 通配符的使用5. `Makefile` 变量的定义和使用(1) 变量的定义(2) 变量的基本赋值① 简单赋值② 递归赋值③ 条件赋值④ 追加赋值6. `Makefile` 自动化变量`Makefile` 目标文件搜索(VPATH和vpath)`Makefile` 路径搜索使用案例9. `Makefile` 隐含规则10. `Makefile` ifeq

2020-07-27 21:45:45 453

原创 LeetCode C++ 1025. Divisor Game【数学/动态规划】简单

Alice and Bob take turns playing a game, with Alice starting first.Initially, there is a number N on the chalkboard. On each player’s turn, that player makes a move consisting of:Choosing any x with 0 < x < N and N % x == 0 .Replacing the number

2020-07-25 18:27:16 275

原创 【算法学习】图论1 图的概念和存储

文章目录1. 邻接矩阵2. 邻接表3. 链式前向星图 Graph 是图论中的基本研究对象,由顶点 Vertex 和边 Edge 组成。1. 邻接矩阵2. 邻接表3. 链式前向星用数组模拟链表,这种方法叫做

2020-07-25 16:07:52 321

原创 LintCode C++ 1740. Online Stock Span【单调栈/队列】中等

Write a class StockSpanner which collects daily price quotes for some stock, and returns the span of that stock’s price for the current day.The span of the stock’s price today is defined as the maximum number of consecutive days (starting from today and g

2020-07-24 22:35:55 161

原创 【操作系统】Oranges学习笔记(二) 第三章2 保护模式进阶

文章目录3.2 保护模式进阶1. 体会超过1MB内存的访问2. 从保护模式到实模式3. LDT(Local Descriptor Table)d 学习调用门,无特权级转移4. 特权级概述4.1 CPL、DPL、RPL5. 特权级转移6. 关于“保护”的思考第三章:保护模式下的中断和异常第三章:小结第三章:a 为什么需要认识IA32架构IntelCPU保护模式高云朋 2018-07-29 16:18:09 86 收藏分类专栏: orang’s 于渊著版权第三章主要是讲IA32架构IntelCPU

2020-07-24 14:52:39 1042

原创 【操作系统】Oranges学习笔记(二) 第三章5 保护模式下的I/O和小结

文章目录3.5 保护模式下的I/O1. IOPL2. I/O许可位图(I/O Permission Bitmap)3.6 保护模式小结3.5 保护模式下的I/O对IO的控制权限很重要,保护模式对此也做了限制。如果用户进程不被许可,就无法进行IO操作。限制通过两方面进行——IOPL和I/O许可位图。1. IOPLIOPL是I/O保护机制的关键之一,位于 eflags 的 12,13 位:I/O敏感指令 I/O Sensitive Instructions 如 in, ins, out, outs

2020-07-24 14:48:15 682

原创 【操作系统】Oranges学习笔记(二) 第三章4 保护模式下的中断和异常

文章目录3.4 保护模式下的中断和异常1. 中断和异常机制2. 外部中断3. 设置和编程操作8259A4. 建立IDT5. 实现一个中断6. 时钟中断试验7. 几点额外说明(1) 特权级变换(2) 中断或异常发生时的堆栈变化(3) 中断门和陷阱门的区别3.4 保护模式下的中断和异常以前,我们使用中断都是在实模式下进行的,如 int 15h 得到内存信息后在保护模式下把它们显示出来。原因在于,在保护模式下,中断机制发生了很大变化。保护模式下,原来的中断向量表已经被IDT所代替,实模式下能用的BIOS中

2020-07-24 14:45:51 1380

原创 【操作系统】Oranges学习笔记(二) 第三章3 页式存储

文章目录3.3 页式存储1. 分页机制概述2. PDE和PTE3. CR34. 编写代码启动分页机制5. 克勤克俭用内存(1) 取得内存信息(2) 计算PDE和PTE数量6. 进一步体会分页机制3.3 页式存储常见的几个问题:什么是"段",什么是"页":段是信息的逻辑单位,它含有一组其意义相对完整的信息,分段的目的是为了更好地满足用户的需要;页是一块内存,是信息的物理单位,分页是出于系统管理的需要,提高内存的利用率。页的大小在不同的机器上都不同,这里只讨论页大小为 4KB 的情况;逻辑地址、线性

2020-07-24 14:39:25 1173

原创 【操作系统】Oranges学习笔记(三) 第四章 让操作系统走进保护模式

文章目录4.1 突破512字节的限制4.1.1 FAT12(1) 文件系统层次(2) 直观体会FAT12目录条目4.2 保护模式下的“操作系统”4.1 突破512字节的限制引导扇区大小有限,只有512字节。软盘1.44MB的容量则大得多。如果我们可以再建立一个文件,通过引导扇区加载该文件进入内存,然后将控制权交给它,就可以突破512字节的束缚了。该模块文件要做的事情有:加载内核;准备保护模式;跳入保护模式等一系列工作,因此被称为 Loader 。引导扇区负责将 Loader 加载入内存并交给它控制权

2020-07-24 14:16:12 1395

原创 【操作系统】Oranges学习笔记(六) 第七章 输入/输出系统

文章目录7.1 键盘7.1.1 从中断开始──键盘初体验7.1.2 AT、PS/2键盘7.1.3 键盘敲击的过程7.1.4 用数组表示扫描码7.1.5 键盘输入缓冲区7.1.6 用新加的任务处理键盘操作7.1.7 解析扫描码1. 让字符显示出来完美主义者常常因试图努力把一件事做好而放弃对新领域的尝试,从而使做事的机会成本增加。有时候回头一看才发现,自己在某件事情上已花费了太多时间。而实际上,暂时的妥协可能并不会影响到最终完美结果的呈现。因为不但知识需要沉淀,事情之间也总是有关联的。我们刚刚实现了简单的

2020-07-24 04:20:32 2413 6

原创 【操作系统】Oranges学习笔记(五) 第六章 进程

文章目录6.1 迟到的进程6.2 进程概述6.2.1 进程介绍6.2.2 未雨绸缪——形成进程的必要考虑进程是操作系统中最重要的概念之一。没有进程,就不能称作操作系统。这一章的概括:先实现一个简陋的进程,然后模仿它再写一个;让两个进程同时运行,并用我们的系统试着调度;最后,尝试扩展进程的功能。6.1 迟到的进程进程的切换、调度等内容和保护模式紧密相连。要深入了解操作系统和进程,至少要接触一种平台上的具体实现。只有拥有了基于具体平台的感性认识之后,才有可能对形而上的理论有更踏实的理解。

2020-07-24 01:54:17 2557 1

原创 【操作系统】Oranges学习笔记(四) 第五章 内核雏形

文章目录5.1 在Linux下用汇编写HelloWord5.2 再进一步,汇编和C同步使用5.3 ELF(Executable and Linkable Format)1. ELF Header2. Program header5.4 从Loader到内核5.1 在Linux下用汇编写HelloWordLoader需要完成从实模式向保护模式的跳转,还是应该把GDT、LDT、8259A等内容都准备完毕?在Linux下写汇编:(chapter5/a/hello.asm); 编译链接方法; (ld的'

2020-07-24 01:54:07 2110 1

原创 LeetCode C++ 120. Triangle【动态规划】中等

Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the following triangle[ [2], [3,4], [6,5,7], [4,1,8,3]]The minimum path sum from top to bottom

2020-07-14 01:22:41 209

原创 洛谷 P2261 [CQOI2007]余数求和【除法分块】

题意:求出 ∑i=1nk mod i\sum_{i=1}^n {k\ mod\ i}i=1∑n​k mod i 的结果。思路1 暴力枚举一开始直接暴力枚举,O(n)\text{O(n)}O(n) 的复杂度:#include <bits/stdc++.h>using namespace std;int main() { int n, k; scanf("%d%d", &n, &k); long long ans = 0;

2020-07-13 14:20:19 251

原创 LeetCode C++ 1002. Find Common Characters【Hash Table】简单

Given an array A of strings made only from lowercase letters, return a list of all characters that show up in all strings within the list (including duplicates). For example, if a character occurs 3 times in all strings but not 4 times, you need to includ

2020-07-13 01:21:23 238

原创 LeetCode C++ 174. Dungeon Game【动态规划】困难

The demons had captured the princess (P) and imprisoned her in the bottom-right corner of a dungeon. The dungeon consists of M x N rooms laid out in a 2D grid. Our valiant knight (K) was initially positioned in the top-left room and must fight his way thro

2020-07-12 15:38:25 258

原创 LeetCode C++ 315. Count of Smaller Numbers After Self【二叉搜索树/线段树/树状数组/分治】困难

You are given an integer array nums and you have to return a new counts array. The counts array has the property where counts[i] is the number of smaller elements to the right of nums[i] .Example:Input: [5,2,6,1]Output: [2,1,1,0] Explanation:To the ri

2020-07-11 13:40:35 289

原创 LeetCode C++ 714. Best Time to Buy and Sell Stock with Transaction Fee【动态规划】中等

Your are given an array of integers prices, for which the i-th element is the price of a given stock on day i; and a non-negative integer fee representing a transaction fee.You may complete as many transactions as you like, but you need to pay the transac

2020-07-11 00:57:09 233

原创 LeetCode C++ 122. Best Time to Buy and Sell Stock II【贪心/动态规划】简单

Say you have an array prices 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 (i.e., buy one and sell one share of the stock multiple times).

2020-07-10 21:01:57 402

原创 LeetCode C++ 121. Best Time to Buy and Sell Stock【Array/Dynamic Programming】简单

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 (i.e., buy one and sell one share of the stock), design an algorithm to find the maximum profit.Note th

2020-07-10 19:41:23 358

原创 LeetCode C++ 236. Lowest Common Ancestor of a Binary Tree【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 p and q as the lowest node in T that has both p and q as de

2020-07-09 17:03:16 238

原创 LeetCode C++ 面试题68 - II. 二叉树的最近公共祖先【Tree】简单

给定一个二叉树, 找到该树中两个指定节点的最近公共祖先。百度百科中最近公共祖先的定义为:“对于有根树 T 的两个结点 p 、q ,最近公共祖先表示为一个结点 x ,满足 x 是 p、q 的祖先且 x 的深度尽可能大(一个节点也可以是它自己的祖先)。”例如,给定如下二叉树: root = [3,5,1,6,2,0,8,null,null,7,4]示例 1:输入: root = [3,5,1,6,2,0,8,null,null,7,4], p = 5, q = 1输出: 3解释: 节点 5 和节点

2020-07-09 16:58:06 179

原创 LeetCode C++ 44. Wildcard Matching【动态规划/回溯】困难

Given an input string (s) and a pattern (p), 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 the entire i

2020-07-09 14:09:11 311

原创 LeetCode 1377. Frog Position After T Seconds【BFS,DFS】困难

Given an undirected tree consisting of n vertices numbered from 1 to n. A frog starts jumping from the vertex 1. In one second, the frog jumps from its current vertex to another unvisited vertex if they are directly connected. The frog can not jump back to

2020-07-08 17:52:21 343

原创 LeetCode C++ 235. Lowest Common Ancestor of a Binary Search Tree【Binary Search Tree】简单

Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST.According to the definition of LCA on Wikipedia: “The lowest common ancestor is defined between two nodes p and q as the lowest node in T that has both p

2020-07-08 17:15:43 222

原创 LeetCode C++ 面试题68 - I. 二叉搜索树的最近公共祖先【Binary Search Tree】简单

给定一个二叉搜索树, 找到该树中两个指定节点的最近公共祖先。百度百科中最近公共祖先的定义为:“对于有根树 T 的两个结点 p、q,最近公共祖先表示为一个结点 x,满足 x 是 p、q 的祖先且 x 的深度尽可能大(一个节点也可以是它自己的祖先)。”例如,给定如下二叉搜索树: root = [6,2,8,0,4,7,9,null,null,3,5]示例 1:输入: root = [6,2,8,0,4,7,9,null,null,3,5], p = 2, q = 8输出: 6 解释: 节点 2 和

2020-07-08 17:09:48 127

原创 LeetCode 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 must go downwards (traveling only from parent nodes to child

2020-07-08 16:01:18 368

原创 LeetCode C++ 113. Path Sum II【Tree/DFS】中等

Given a binary tree and a sum, find all root-to-leaf paths where each path’s sum equals the given sum.Note: A leaf is a node with no children.Example: Given the below binary tree and sum = 22 , 5 / \ 4 8 / / \ 11 13 4 / \ /

2020-07-08 14:36:06 186

原创 LeetCode C++ 112. Path Sum【Tree】简单

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.Note: A leaf is a node with no children.Example: Given the below binary tree and sum = 22 , 5 /

2020-07-08 14:20:01 272

原创 LeetCode C++ 面试题 16.11. Diving Board LCCI【Recursion】简单

You are building a diving board by placing a bunch of planks of wood end-to-end. There are two types of planks, one of length shorter and one of length longer . You must use exactly K planks of wood. Write a method to generate all possible lengths for the

2020-07-08 14:09:05 246

原创 【操作系统】Oranges学习笔记(二) 第三章1 认识保护模式

文章目录3.1 认识保护模式1. 实模式跳转到保护模式(1) 具体代码和实验(2) 详细分析2. 保护模式的运行环境3. GDT(Global Descriptor Table)(1) 32位PC机的工作模式(2) 从实模式到保护模式(3) 描述符、选择子结构和寻址方式(4) 描述符属性这是第三章 保护模式,也是之前我在微机原理与接口技术中学过的一部分知识,但是当时学得不透彻,这里下点功夫吧。3.1 认识保护模式1. 实模式跳转到保护模式(1) 具体代码和实验代码1 chapter3/a/pmte

2020-07-05 00:31:23 1265 2

西电软件工程概论考前复习题

西电软件工程概论考前复习题

2022-06-25

chapter1_7.zip

Orange's操作系统一书的相关资源,1-7章,个人在Ubuntu虚拟机上运行过

2021-07-15

rubyinstaller-devkit-3.0.1-1-x64.exe

官网下载太慢,这里是我分享的安装包

2021-06-30

编程小白的第一本Python入门书

一个实用主义的开发者,带你快速走进Python编程的大门。

2018-04-30

Coursera机器学习笔记

吴恩达教授的Coursera机器学习笔记整理一到一十八章全

2018-04-22

Python编程

很有趣的一本Python书,学完后可以做各种项目了,对入门的读者是很大的提升

2018-04-22

简明Python教程

简明Python教程,讲解了Python2编程的各个方面,虽然论述和代码实例都很简洁,但是讲解清晰,是不错的入门书籍

2018-04-22

空空如也

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

TA关注的人

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