摘要: 题目: There are N children standing in a line. Each child is assigned a rating value. You are giving candies to these children subjected to the followin 阅读全文
posted @ 2016-02-22 19:07 wxquare 阅读(227) 评论(0) 推荐(0) 编辑
摘要: http://blog.chinaunix.net/uid-24227137-id-3723898.html 页是信息的物理单位,分页是为了实现离散分配方式,以消减内存的外零头,提高内存的利用率从;或者说,分页是由于系统管理的需要,而不是用户的需求。短是信息的逻辑单位,它含有一组其意义相对完整的信息。分段的目的是为了能更好的满足用户的需求。 进程是如何使用内存的 对于任意一个普通的进程都会涉... 阅读全文
posted @ 2016-01-29 14:11 wxquare 阅读(896) 评论(0) 推荐(0) 编辑
摘要: 1.C++程序内存布局 在C++中,内存分成4个区,从低地址到高地址分别是常量区、全局数据区、堆区、栈区。栈,在执行函数时,函数内局部变量的存储单元都可以在栈上创建,函数执行结束时这些存储单元自动被释放。栈内存分配运算内置于处理器的指令集中,效率很高,但是分配的内存容量有限。堆,就是那些由new分配 阅读全文
posted @ 2016-01-29 14:05 wxquare 阅读(640) 评论(0) 推荐(0) 编辑
摘要: 1.进程五状态及状态转换图 五状态:新建、就绪、运行、阻塞、退出 五状态进程存在的问题以及解决的办法: 当多个进程竞争资源时,可能导致内存不足,就绪队列满了。Cpu速度比IO速度快很多,可能许多进程都处在阻塞状态,cpu很空闲,利用率低。解决办法,将部分不运行的进程(阻塞进程)的程序和数据(不包括P 阅读全文
posted @ 2016-01-29 13:35 wxquare 阅读(1451) 评论(0) 推荐(0) 编辑
摘要: GRASP (职责分配原则) 要学习设计模式,有些基础知识是我们必须要先知道的,设计模式是关于类和对象的一种高效、灵活的使用方式,也就是说,必须先有类和对象,才能有设计模式的用武之地,否则一切都是空谈,那么类和对象是从那冒出来的呢?这时就需要比23种设计模式更重要更经典的GRASP模式登场了,嘿嘿,原来这才是老大! GRASP(General Responsibility Assignment... 阅读全文
posted @ 2016-01-07 21:16 wxquare 阅读(231) 评论(0) 推荐(0) 编辑
摘要: Given a string that contains only digits 0-9 and a target value, return all possibilities to add binary operators (not unary) +, -, or * between the d 阅读全文
posted @ 2015-12-24 17:17 wxquare 阅读(280) 评论(0) 推荐(0) 编辑
摘要: Givennnon-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining.Fo... 阅读全文
posted @ 2015-12-21 22:31 wxquare 阅读(178) 评论(0) 推荐(0) 编辑
摘要: Implement a basic calculator to evaluate a simple expression string.The expression string contains onlynon-negativeintegers,+,-,*,/operators and empty... 阅读全文
posted @ 2015-12-21 21:37 wxquare 阅读(194) 评论(0) 推荐(0) 编辑
摘要: Implement a basic calculator to evaluate a simple expression string.The expression string may contain open(and closing parentheses), the plus+or minus... 阅读全文
posted @ 2015-12-19 17:12 wxquare 阅读(193) 评论(0) 推荐(0) 编辑
摘要: Given a matrix ofmxnelements (mrows,ncolumns), return all elements of the matrix in spiral order.For example,Given the following matrix:[ [ 1, 2, 3 ],... 阅读全文
posted @ 2015-12-09 23:57 wxquare 阅读(178) 评论(0) 推荐(0) 编辑