自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(51)
  • 收藏
  • 关注

原创 Java虚拟机运行时数据区

Note:本篇内容整理自《深入理解Java虚拟机:JVM高级特性与最佳实践(最新第二版)》 前言Java虚拟机在执行Java程序的过程中会把它所管理的内存划分为若干个不同的数据区域,这些区域都有各自的用途,以及创建和销毁的时间,有的区域随着虚拟机进程的启动而存在,有些区域则依赖用户线程的启动和结束而建立和销毁。根据《Java虚拟机规范(Java SE 7版)》的规定,Java虚拟机所管...

2018-04-23 19:55:43 192

原创 [计算机网络] 关于HTTP协议你需要了解的基础

本文内容主要参考自《计算机网络 自顶向下方法 原书第6版》前言HTTP(超文本传输协议)Web的应用层协议,它是Web的核心。HTTP由两个程序实现:一个客户程序和一个服务器程序。客户程序和服务器程序运行在不同的端系统中,通过交换HTTP报文进行会话。HTTP协议定义了这些报文的结构以及客户端和服务器进行报文的方式。  HTTP和TCPHTTP使用TCP作为它的支撑运输协议...

2018-04-08 21:51:09 685

原创 [计算机网络] TCP报文段中的序号和确认号

本篇内容参考自:《计算机网络 自顶向下方法》原书第六版前言序号字段和确认号字段是TCP报文段首部中两个最重要的字段,这两个字段是TCP可靠传输服务的关键部分。TCP把数据看成一个无结构的、有序的字节流。序号是建立在传送的字符流之上的,而不是建立在传送的报文段的序列之上序号一个报文段的序号是该报文段首字节的字节流编号,举个栗子~假设主机A的一个进程想通过一条TCP连接向主机B上的一个进程发送一个数据...

2018-03-30 19:53:11 26558

原创 [计算机网络] TCP/IP四层协议系统

前言:TCP/IP是一个四层协议系统,每层负责不同的功能。TCP/IP协议族是一组由不同协议组合在一起构成的协议族。TCP/IP协议族TCP/IP     主要协议                                  主要功能应用层HTTP、Telnet、FTP、SMTP等负责把数据传输到传输层或者接收从传输层返回的数据传输层TCP、UDPTCP为两台主机的应用程序提供可靠的端到端数...

2018-03-30 17:41:26 1178

原创 [计算机网络] TCP与UDP的对比

本文部分内容参考自:https://blog.csdn.net/li_ning_/article/details/52117463TCP与UDP的区别概括TCP面向连接,即客户端需要通过三次握手才能和服务端建立起连接,在这个连接的基础上才可以进行数据传输;而UDP是无连接的,发送数据之前不需要建立连接。因此,TCP需要在端系统中维护连接状态,而UDP则不需要维护连接状态TCP提供可靠的服务,即通过...

2018-03-28 13:36:10 1070

原创 [计算机网络] TCP连接——TCP三次握手

Note:本文内容参考自《计算机网络 自顶向下方法 原书第六版》前言:TCP是面向连接的协议,提供透明、可靠的数据流传输。传输连接有三个阶段,即连接建立、数据传送和连接释放。传输连接的管理就是是传输连接的建立和释放都能正常运行。在TCP连接的建立过程中要解决三个问题:首先要使每一方都能够感知对方的存在;其次要允许双方协商一些参数(如最大报文段长度、最大窗口大小、服务质量等);最后能对传输实体资源(...

2018-03-28 11:50:28 846

原创 [计算机网络] HTTP面试题大全(持续更新中)

1. 什么是HTTP协议?答:HTTP,即超文本传输协议,是TCP/IP协议族的应用层协议,它是Web的核心协议。谈论HTTP通常涉及两种程序:客户程序和服务器程序,客户程序和服务器程序运行在不同的端系统中,通过交换HTTP报文进行会话。HTTP协议定义了这些报文的结构以及客户端和服务器进行报文的方式。 2. 说说你理解的HTTP协议的特点?答:1)无状态:HTTP是一个无状态协议...

2018-07-27 23:57:04 639

原创 [计算机网络] TCP连接——TCP四次挥手

Note:本文内容参考自《计算机网络 自顶向下方法 原书第六版》前言:基于TCP的传输任务结束后,参与该条TCP的两个进程中的任何一个都能终止该连接,以释放资源,终止连接这个过程同样需要双方协商,意见达成一致后才能安全终止连接,此过程也被称作TCP四次挥手。TCP连接的关闭——TCP四次挥手过程举个例子说明这个过程:假设是客户端发起终止TCP连接的请求第一步:客户进程向服务器进程发送一个特殊的TC...

2018-04-23 13:52:25 481

原创 [操作系统] 内存管理策略:页式、段式、段页式

本文内容参考自《操作系统概念第七版》、《操作系统精髓与设计原理 原书第六版》前言为了解决外部碎片问题,一种可行的方案是允许物理地址空间为非连续的,具体的实现技术包括:分页、分段以及两者的合并段页式管理页式实现分页的基本方法涉及将物理内存分为固定大小的块,成为帧;而将逻辑内存也分为同样大小的块,称为页。当需要执行进程时,该进程的页会被调入到可用的内存帧中。分页的硬件支持CPU生成的每个地址分为两个部...

2018-04-16 19:44:11 10673

转载 [操作系统] 逻辑地址、物理地址、线性地址、虚拟地址

声明:本文转载自https://blog.csdn.net/prike/article/details/52722934转载本文目的在学习,如涉及侵权,请留言博主删除本文前言    许多年以前,当人们还在使用DOS或是更古老的操作系统的时候,计算机的内存还非常小,一般都是以K为单位进行计算,相应的,当时的程序规模也不大,所以内存容量虽然小,但还是可以容纳当时的程序。    但随着图形界面的兴起还有...

2018-04-16 18:43:46 4628

原创 [操作系统] 进程的基本概念

前言:本篇内容基于《操作系统概念第七版》及《操作系统精髓与设计原理原书第六版》整理生成什么是进程?进程常常被理解为执行中的程序,这是一种非正式的说法。进程不只是程序代码(程序代码有时被称作文本段或者代码段)。进程还包括当前活动,通过程序计数器的值和处理器寄存器的内容来表示。此外,进程通常还包括:栈段:包括临时数据如函数参数、返回地址和局部变量数据段:包括全局变量堆段:在进程运行期间动态分配的内存内...

2018-04-16 11:46:10 238

原创 [LeetCode] 696. 计数二进制子串

题目描述:给定一个字符串 s,计算具有相同数量0和1的非空(连续)子字符串的数量,并且这些子字符串中的所有0和所有1都是组合在一起的。重复出现的子串要计算它们出现的次数。示例 1 :输入: "00110011"输出: 6解释: 有6个子串具有相同数量的连续1和0:“0011”,“01”,“1100”,“10”,“0011” 和 “01”。请注意,一些重复出现的子串要计算它们出现的次数。...

2018-04-13 14:07:25 644

原创 [LeetCode] 811. 子域名访问计数

题目描述:一个网站域名,如"discuss.leetcode.com",包含了多个子域名。作为顶级域名,常用的有"com",下一级则有"leetcode.com",最低的一级为"discuss.leetcode.com"。当我们访问域名"discuss.leetcode.com"时,也同时访问了其父域名"leetcode.com"以及顶级域名 "com"。给定一个带访问

2018-04-12 19:36:37 1441

原创 [LeetCode] 463. Island Perimeter

Description:You are given a map in form of a two-dimensional integer grid where 1 represents land and 0 represents water. Grid cells are connected horizontally/vertically (not diagonally). The grid is...

2018-04-11 23:02:10 113

原创 [剑指offer] 字符串的排序

Description:输入一个字符串,按字典序打印出该字符串中字符的所有排列。例如输入字符串abc,则打印出由字符a,b,c所能排列出来的所有字符串abc, acb, bac, bca, cab和cba。输入一个字符串,长度不超过9(可能有字符重复),字符只包括大小写字母。Solution:public class Solution { public ArrayList<Strin...

2018-04-10 11:39:07 169

原创 [剑指offer] 矩阵中的路径

Description:请设计一个函数,用来判断在一个矩阵中是否存在一条包含某字符串所有字符的路径。路径可以从矩阵中的任意一个格子开始,每一步可以在矩阵中向左,向右,向上,向下移动一个格子。如果一条路径经过了矩阵中的某一个格子,则该路径不能再进入该格子。 例如 :  a      b      t         g  c      f       c        s   j  ...

2018-04-07 22:12:42 116

原创 [剑指offer] 合并两个有序

Description:输入两个单调递增的链表,输出两个链表合成后的链表,需要合成后的链表满足单调不减规则Solution:/*public class ListNode { int val; ListNode next = null; ListNode(int val) { this.val = val; }}*/public class ...

2018-04-07 15:13:04 133

原创 [剑指offer] 重建二叉树

Description:输入某二叉树的前序遍历和中序遍历的结果,请重建出该二叉树。假设输入的前序遍历和中序遍历的结果中都不含重复的数字。例如输入前序遍历序列{1,2,4,7,3,5,6,8}和中序遍历序列{4,7,2,1,5,3,8,6},则重建二叉树并返回。Solution:/** * Definition for binary tree * public class TreeNode {...

2018-03-31 16:53:11 119

原创 [剑指offer] 二维数组中的查找

Description:在一个二维数组中,每一行都按照从左到右递增的顺序排序,每一列都按照从上到下递增的顺序排序。请完成一个函数,输入这样的一个二维数组和一个整数,判断数组中是否含有该整数。Solution:class Solution {public: bool Find(int target, vector<vector<int> > array) { ...

2018-03-31 01:17:02 146

原创 [LeetCode] 5. Longest Palindromic Substring

Description:Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.Example:Input: "babad"Output: "bab"Note: "aba" is also a valid answer...

2018-03-24 23:48:25 117

原创 构造回文--最长回文子序列

Description:时间限制:1秒空间限制:32768K给定一个字符串s,你可以从中删除一些字符,使得剩下的串是一个回文串。如何删除才能使得回文串最长呢?输出需要删除的字符个数。输入描述:输入数据有多组,每组包含一个字符串s,且保证:1<=s.length<=1000. 输出描述:对于每组数据,输出一个整数,代表最少需要删除的字符个数。输入例子1:abcdagoogle输出例...

2018-03-24 23:02:27 172

原创 [LeetCode] 747. Min Cost Climbing Stairs

Problem:On a staircase, the i-th step has some non-negative cost cost[i] assigned (0 indexed).Once you pay the cost, you can either climb one or two steps. You need to find minimum cost to

2018-01-03 21:03:40 180

原创 [LeetCode] 394. Decode String

Problem:Given an encoded string, return it's decoded string.The encoding rule is: k[encoded_string], where the encoded_string inside the square brackets is being repeated exactly k times.

2018-01-02 12:31:57 177

原创 [证明] NP-完全问题

算法概论(注释版)第八章 Exercise 8.3题目描述:STINGY SAT is the following problem: given a set of clauses(each a disjunction of literals) and aninteger k, find a satisfying assignment in which at most k var

2018-01-01 11:09:28 1515

原创 [LeetCode] 728. Self Dividing Numbers

Problem:A self-dividing number is a number that is divisible by every digit it contains.For example, 128 is a self-dividing number because 128 % 1 == 0, 128 % 2 == 0, and 128 % 8 == 0.

2017-12-26 11:27:32 182

原创 [LeetCode] 136. Single Number

Problem:Given an array of integers, every element appears twice except for one. Find that single one.Note:Your algorithm should have a linear runtime complexity. Could you implement it wit

2017-12-25 22:46:03 117

原创 [LeetCode] 557. Reverse Words in a String III

Problem: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 L

2017-12-25 22:04:53 127

原创 [LeetCode] 199. Binary Tree Right Side View

Problem: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

2017-12-23 13:40:19 135

原创 [LeetCode] 494. Target Sum

Problem: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 symbo

2017-12-21 20:36:16 136

原创 [LeetCode] 416. Partition Equal Subset Sum

Problem: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:Eac

2017-12-21 19:28:48 141

原创 [LeetCode] 337. House Robber III

Problem: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

2017-12-17 21:55:41 152

原创 [LeetCode] Convert Sorted Array to Binary Search Tree

Problem:Given an array where elements are sorted in ascending order, convert it to a height balanced BST.For this problem, a height-balanced binary tree is defined as a binary tree in which

2017-12-16 13:13:54 144

原创 [LeetCode] 100. Same Tree

Problem:Given two binary trees, write a function to check if they are the same or not.Two binary trees are considered the same if they are structurally identical and the nodes have the same

2017-12-16 11:45:29 139

原创 [LeetCode] 547. Friend Circles

Problem:There are N students in a class. Some of them are friends, while some are not. Their friendship is transitive in nature. For example, if A is a direct friend of B, and B is a direct frie

2017-12-15 23:38:47 186

原创 [LeetCode] 650. 2 Keys Keyboard

Problem:Initially on a notepad only one character 'A' is present. You can perform two operations on this notepad for each step:Copy All: You can copy all the characters present on the notepa

2017-12-13 22:34:08 188

原创 [LeetCode] 357. Count Numbers with Unique Digits

Problem:Given a non-negative integer n, count all numbers with unique digits, x, where 0 ≤ x n.Example:Given n = 2, return 91. (The answer should be the total numbers in the range of 0 ≤ x

2017-12-13 00:19:55 152

原创 [LeetCode] 646. Maximum Length of Pair Chain

Problem:You are given n pairs of numbers. In every pair, the first number is always smaller than the second number.Now, we define a pair (c, d) can follow another pair (a, b) if and only

2017-11-30 11:50:54 135

原创 [LeetCode] 695. Max Area of Island

Problem:Given a non-empty 2D array grid of 0's and 1's, an island is a group of 1's (representing land) connected 4-directionally (horizontal or vertical.) You may assume all four edges of t

2017-11-28 19:19:11 245

原创 [LeetCode] 515. Find Largest Value in Each Tree Row

Problem:You need to find the largest value in each row of a binary tree.Example:Input: 1 / \ 3 2 / \ \ 5 3 9 Output: [1, 3, 9]解法

2017-11-18 14:32:33 163

原创 [LeetCode] 647. Palindromic Substrings

Problem :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 e

2017-11-12 13:34:42 179

空空如也

空空如也

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

TA关注的人

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