摘要:
操作系统最重要的一点就是具有多道程序设计。通常来说,单个用户并不能使CPU或者I/O设备都繁忙。多道程序设计通过组织作业(编码或数据)的形式,使得CPU总有作业可执行,从而大大提高了CPU的利用率。多道程序设计的思想如下: 操作系统同时将多个任务保存在内存中。该作业集可以是作业池中作业集的子集(因为 阅读全文
摘要:
计算机系统可以采用不同的方式进行组织,大致可按照其采用的通用处理器数量来进行分类。 1. 单处理器系统 目前绝大多数的系统都是采用单处理器系统。在单处理系统中,有一个主CPU可以执行通用指令集,包括来自用户进程的指令。 2. 多处理器系统 尽管多数的现代操作系统都是属于单处理器系统,但多处理器系统( 阅读全文
摘要:
Given an array of n positive integers and a positive integer s, find the minimal length of a contiguous subarray of which the sum ≥ s. If there isn't 阅读全文
摘要:
Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one duplicate number must exist. 阅读全文
摘要:
Count the number of prime numbers less than a non-negative number, n. Example: Input: 10Output: 4Explanation: There are 4 prime numbers less than 10, 阅读全文
摘要:
Write an algorithm to determine if a number is "happy". A happy number is a number defined by the following process: Starting with any positive intege 阅读全文
摘要:
Given n non-negative integers a1, a2, ..., an , where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endp 阅读全文
摘要:
Given a sorted array nums, remove the duplicates in-place such that duplicates appeared at most twice and return the new length. Do not allocate extra 阅读全文
摘要:
Given a positive integer n, generate a square matrix filled with elements from 1 to n2 in spiral order. Example: Input: 3Output:[ [ 1, 2, 3 ], [ 8, 9, 阅读全文