自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

翻译 数据库查询语句优化

我们要做到不但会写SQL,还要做到写出性能优良的SQL语句。(1)选择最有效率的表名顺序(只在基于规则的优化器中有效):Oracle的解析器按照从右到左的顺序处理FROM子句中的表名,FROM子句中写在最后的表(基础表 driving table)将被最先处理,在FROM子句中包含多个表的情况下,你必须选择记录条数最少的表作为基础表。如果有3个以上的表连接查询, 那就需要选择交叉表(inte...

2019-03-20 22:30:50 362

翻译 进程切换、线程切换

线程上下文切换和进程上下文切换的区别进程切换分两步1.切换页目录以使用新的地址空间2.切换内核栈和硬件上下文。对于linux来说,线程和进程的最大区别就在于地址空间。对于线程切换,第1步是不需要做的,第2是进程和线程切换都要做的。所以明显是进程切换代价大线程上下文切换和进程上下问切换一个最主要的区别是线程的切换虚拟内存空间依然是相同的,但是进程切换是不同的。这两种上下文切换的...

2019-03-20 22:11:20 876

翻译 JVM

JVMJVM是Java Virtual Machine(Java虚拟机)的缩写,JVM是一种用于计算设备的规范,它是一个虚构出来的计算机,是通过在实际的计算机上仿真模拟各种计算机功能来实现的。Java语言的一个非常重要的特点就是与平台的无关性。而使用Java虚拟机是实现这一特点的关键。一般的高级语言如果要在不同的平台上运行,至少需要编译成不同的目标代码。而引入Java语言虚拟机后,Java...

2019-03-20 21:57:23 333

转载 点击一个链接时的网络过程

从点击一个链接到浏览器显示页面,这个过程中发生了什么?这个过程可以分为六步浏览器通过域名找出其IP地址(DNS解析) 浏览器和服务器建立连接(TCP/TP三次握手) 浏览器向服务器发送HTTP请求 服务器接受到请求并返回HTTP响应 浏览器解析渲染页面 断开连接(四次挥手)(HTML/CSS/JS/JSON都是HTTP中的第四部分,都是基于HTTP协议来传输的,而HTTP协议基...

2019-03-20 21:42:16 2397

原创 冯诺依曼体系结构

冯·诺依曼结构也称普林斯顿结构,是一种将程序指令存储器和数据存储器合并在一起的存储器结构。程序指令存储地址和数据存储地址指向同一个存储器的不同物理位置,因此程序指令和数据的宽度相同,如英特尔公司的8086中央处理器的程序指令和数据都是16位宽。美籍匈牙利数学家冯·诺依曼于1946年提出存储程序原理,把程序本身当作数据来对待,程序和该程序处理的数据用同样的方式储存。 冯·诺依曼体系结构冯...

2019-03-20 21:32:59 1760

转载 DNS原理

DNS原理及其解析过程为什么需要DNS解析域名为IP地址?网络通讯大部分是基于TCP/IP的,而TCP/IP是基于IP地址的,所以计算机在网络上进行通讯时只能识别如“202.96.134.133”之类的IP地址,而不能认识域名。我们无法记住10个以上IP地址的网站,所以我们访问网站时,更多的是在浏览器地址栏中输入域名,就能看到所需要的页面,这是因为有一个叫“DNS服务器”的计算机自动把我们...

2019-03-20 21:26:23 261

转载 进程调度算法

操作系统常见的进程调度算法调度算法是指:根据系统的资源分配策略所规定的资源分配算法。常见的进程调度算法有:  1.先来先去服务  2.时间片轮转法  3.多级反馈队列算法  4.最短进程优先  5.最短剩余时间优先  6.最高响应比优先  7.多级反馈队列调度算法一、先来先去服务  先来先去服务调度算法是一种最简单的调度算法,也称为先进先出或严格排队方案。当...

2019-03-20 19:58:15 50154 2

转载 JAVA和Python的区别

Python和Java的区别这里是我的一些总结,有些是参考别人的(在这里谢谢!!!)区别:1.Python比Java简单,学习成本低,开发效率高2.Java运行效率高于Python,尤其是纯Python开发的程序,效率极低3.Java相关资料多,尤其是中文资料4.Java版本比较稳定,Python2和3不兼容导致大量类库失效5.Java开发偏向于软件工程,团队协同,Python...

2019-03-20 19:43:34 6877

原创 PAT甲级 1135

1135 Is It A Red-Black Tree (30 分)There is a kind of balanced binary search tree named red-black tree in the data structure. It has the following 5 properties:(1) Every node is either red or black...

2019-01-23 20:21:22 290

原创 PAT甲级 1134

1134 Vertex Cover (25 分)A vertex cover of a graph is a set of vertices such that each edge of the graph is incident to at least one vertex of the set. Now given a graph with several vertex sets, you...

2019-01-23 11:26:07 255

原创 PAT甲级 1133

1133 Splitting A Linked List (25 分)Given a singly linked list, you are supposed to rearrange its elements so that all the negative values appear before all of the non-negatives, and all the values i...

2019-01-22 21:36:14 304

原创 PAT甲级 1136

1136 A Delayed Palindrome (20 分)Consider a positive integer N written in standard notation with k+1 digits a​i​​ as a​k​​⋯a​1​​a​0​​ with 0≤a​i​​<10 for all i and a​k​​>0. Then N is palindromi...

2019-01-22 16:09:12 242

原创 PAT甲级 1137

1137 Final Grading (25 分)For a student taking the online course "Data Structures" on China University MOOC (http://www.icourse163.org/), to be qualified for a certificate, he/she must first obtain n...

2019-01-22 16:00:23 189

原创 PAT甲级 1138

1138 Postorder Traversal (25 分)Suppose that all the keys in a binary tree are distinct positive integers. Given the preorder and inorder traversal sequences, you are supposed to output the first num...

2019-01-22 15:58:06 242

原创 PAT甲级 1139

1139 First Contact (30 分)Unlike in nowadays, the way that boys and girls expressing their feelings of love was quite subtle in the early years. When a boy A had a crush on a girl B, he would usually...

2019-01-22 15:54:15 257

原创 PAT甲级 1132

1132 Cut Integer (20 分)Cutting an integer means to cut a K digits lone integer Z into two integers of (K/2) digits long integers A and B. For example, after cutting Z = 167334, we have A = 167 and B...

2019-01-22 15:40:22 215

原创 PAT甲级 1143

1143 Lowest Common Ancestor (30 分)The lowest common ancestor (LCA) of two nodes U and V in a tree is the deepest node that has both U and V as descendants.A binary search tree (BST) is recursively...

2019-01-21 10:18:50 386

原创 PAT甲级 1142

1142 Maximal Clique (25 分)A clique is a subset of vertices of an undirected graph such that every two distinct vertices in the clique are adjacent. A maximal clique is a clique that cannot be extend...

2019-01-21 10:13:31 170

原创 PAT甲级 1141

1141 PAT Ranking of Institutions (25 分)After each PAT, the PAT Center will announce the ranking of institutions based on their students' performances. Now you are asked to generate the ranklist.In...

2019-01-21 10:00:45 359

原创 PAT甲级 1140

1140 Look-and-say Sequence (20 分)Look-and-say sequence is a sequence of integers as the following:D, D1, D111, D113, D11231, D112213111, ...where D is in [0, 9] except 1. The (n+1)st number is...

2019-01-21 09:43:32 233

原创 PAT甲级 1151

1151 LCA in a Binary Tree (30 分)The lowest common ancestor (LCA) of two nodes U and V in a tree is the deepest node that has both U and V as descendants.Given any two nodes in a binary tree, you a...

2019-01-21 09:28:08 401

原创 PAT甲级 1149

1149 Dangerous Goods Packaging (25 分)When shipping goods with containers, we have to be careful not to pack some incompatible goods into the same container, or we might get ourselves in serious trou...

2019-01-21 09:18:37 202

原创 PAT 甲级 1147

1147 Heaps (30 分)In computer science, a heap is a specialized tree-based data structure that satisfies the heap property: if P is a parent node of C, then the key (the value) of P is either greater ...

2019-01-20 21:41:13 183

原创 PAT甲级 1039

1039 Course List for Student (25 分)Zhejiang University has 40000 students and provides 2500 courses. Now given the student name lists of all the courses, you are supposed to output the registered co...

2019-01-20 21:02:56 123

原创 PAT甲级 1038

1038 Recover the Smallest Number (30 分)Given a collection of number segments, you are supposed to recover the smallest number from them. For example, given { 32, 321, 3214, 0229, 87 }, we can recove...

2019-01-20 20:44:33 173

原创 PAT甲级 1037

1037 Magic Coupon (25 分)The magic shop in Mars is offering some magic coupons. Each coupon has an integer N printed on it, meaning that when you use this coupon with a product, you may get N times t...

2019-01-20 20:31:52 226

原创 PAT甲级 1036

1036 Boys vs Girls (25 分)This time you are asked to tell the difference between the lowest grade of all the male students and the highest grade of all the female students.Input Specification:Eac...

2019-01-20 17:20:00 126

原创 1004+1022+1038 PAT乙级

1004 成绩排名 (20 分)读入 n(>0)名学生的姓名、学号、成绩,分别输出成绩最高和成绩最低学生的姓名和学号。输入格式:每个测试输入包含 1 个测试用例,格式为第 1 行:正整数 n第 2 行:第 1 个学生的姓名 学号 成绩第 3 行:第 2 个学生的姓名 学号 成绩 ... ... ...第 n+1 行:第 n 个学生的姓名 学号 成绩其中姓名和...

2019-01-19 10:54:04 126

转载 atoi() and stoi()

stoi函数默认要求输入的参数字符串是符合int范围的[-2147483648, 2147483647],否则会runtime error。atoi函数则不做范围检查,若超过int范围,则显示-2147483648(溢出下界)或者2147483647(溢出上界)。stoi头文件:<string>,c++函数atoi头文件:<cstdlib>,c函数atoi()的参数...

2019-01-17 16:05:40 322

原创 PAT 1145 Hashing - Average Search Time (25 分)

1145 Hashing - Average Search Time (25 分)The task of this problem is simple: insert a sequence of distinct positive integers into a hash table first. Then try to find another sequence of integer key...

2019-01-16 21:57:15 176

原创 PAT 1146 Topological Order (25 分)

1146 Topological Order (25 分)This is a problem given in the Graduate Entrance Exam in 2018: Which of the following is NOT a topological order obtained from the given directed graph? Now you are supp...

2019-01-16 21:46:01 199

原创 PAT 1144 The Missing Number (20 分)

1144 The Missing Number (20 分)Given N integers, you are supposed to find the smallest positive integer that is NOT in the given list.Input Specification:Each input file contains one test case. F...

2019-01-16 21:32:58 97

转载 C++中vector使用说明(转)

转自:http://blog.chinaunix.net/uid-26000296-id-3785610.htmlhttp://www.cnblogs.com/mr-wid/archive/2013/01/22/2871105.htmlhttps://www.cnblogs.com/aminxu/p/4686332.html一、向量的介绍    向量 vector 是一种对象实体, ...

2019-01-16 17:15:36 151

空空如也

空空如也

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

TA关注的人

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