- 博客(1)
- 资源 (12)
- 收藏
- 关注
原创 二分查找、快速排序对比和详解
**二分查找和快速排序(binarySearch)&&(quickSort)** 这两个都是用到分治的思想很容易搞混。而且即使binarySearch是用到分治到不一定意味着递归可以通过循环实现。而且是属于面试笔试的高频问题有必要总结一下。 由于循环相比递归少了很多内存分配和压栈的操作开销会少很多,所以binarySearch最好的实现方式是通过循环实现。没什么好解释的直接代码: int binar
2016-03-24 22:19:04 9299 2
2013-2014华南理工大学操作系统课程设计(完整源代码和详细文档)
Requirements
1. Simulate a Unix file system on your Windows Platform
2. Understand the file system on Unix system, and the usage of i-nodes
3. Implement the function of sub-directory
4. The task needs to be completed using C++ or C
5.
Tasks/Functionalities
The following functions are required in your file system:
1. Allocate 16MB space in memory as the storage for your file system. The space is divided as
blocks with block size 1KB
Assume block address length is 32-bit;
Design the information contained in i-node
The i-node should support up to 10 direct block addresses
The i-node should support at least one indirect block address
2. The fist block is used for storing the i-node for the root directory(/). While your program is
lunched, two directories (/dir1 and / dir1/dir2) should be created, and also two files need to be
written as /dir1/file1 and /dir1/dir2/file2 (5 marks)
3. File 1 and 2 contain the message of “This is file 1.” and “This is file2”.
4. Following commands should be supported in your system:
a) Create a file:createFile fileName fileSize (10 marks)
i.e.:createFile /dir1/myFile 1024 (in bytes)
if fileSiz > max file size, print out an error message.
The file content is filled up with filename + repeated digits from 0 - 9
i.e.: “myFile012345678901234567890123….”
b) Delete a file:deleteFile filename (10 marks)
i.e.:deleteFile /dir1/myFile
c) Create a directory:createDir (5 marks)
i.e.:createDir /dir1/sub1
d) Delete a directory:deleteDir (5 marks)
i.e.: deleteDir /dir1/sub1 (The current working directory is not allowed to be
deleted)
e) Change current working direcotry:changeDir (5 marks)
i.e.: changeDir /dir2
f) List all the files and sub-directories under current working directory:dir (5 marks)
You also need to list at least two file attributes. (i.e. file size, time created, etc.)
g) Copy a file : cp (5 marks)
i.e.: file1 file2
h) Display the usage of storage space:sum (10 marks)
Display the usage of the 16MB
2014-02-13
IPC读者写者和睡眠理发师问题
两个文件一个主要是读者写者,一个是睡眠理发师。读者写者问题有修改,当写者处于等待状况的时候,新来到的读者不能读入数据库。睡眠理发师问题中理发师有两个。基于windows平台实现。操作系统实验!
2014-01-08
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人