- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
辅助存储器中的算法_47530
辅助存储器中的算法
外部存储器的归并算法不同的条件下检测性能。使用不同的方法从辅助存储器中读取文件,并向辅助存储器中文件。
In this assignment you are asked to implement an external-memory merge-sort algorithm
, and examine its performance under different parameters. As a warm-up exercise you will need to explore several different ways to read data from, and write data to secondary memory. The overall goal of the assignment is to get real-world experience with the performance of external-memory algorithms.
读和写:streams题包括小题,每个包括一个input和一个output,是否可以建class?再一个main class一个用random创建文件的class?
归并排序的实现需要先将由32位int型数据构成的磁盘上的文件进行排序。这就需要能够对磁盘进行读写操作。第一步,编写stream classes来顺序读写一个32bit,int型的文件。需要两种流:输入流input streams和输出流output streams。输入流要支持以下操作:open(打开一个文件来读取),read_next(读取下一个),end_of_stream(当一个判断return true时,说明到达流的末尾)。输出流要支持以下操作:create(创建一个新文件),write(在流中写入一个元素),close(关闭一个流)。
用以下4种不同的I/O机制来获得4种不同的实现方式。
Your merge sort implementation will need to be able to sort disk files consisting of 32-bit integers. It will hence need to read data from, and write data to disk. A first step, therefore, is to develop stream classes that can sequentially read and write a file consisting of 32-bit integers. You will need two types of streams: input streams and output streams. The input stream should support the following operations: open (open an existing le for reading), read next, (read the next element from the stream), and end of stream (a boolean operation that returns true if the end of stream has been reached). The output stream should support the following operations: create (create a new file), write (write an element to the stream), and close (close the stream).
Use the following four distinct I/O mechanisms to obtain four different implementations of the input and output streams.
使用read和write,一次读和写一个元素。java中在java.io.DataInputStream,调用 readInt():
Read and write one element at a time using the read and write system calls. You can read by calling readInt() on a java.io.DataInputStream that is wrapped directly around a java.io.FileInputStream, as i
您可能关注的文档
最近下载
- 农业合作社全套报表(已设公式)--资产负债表-盈余及盈余分配表-成员权益变动表-现金流量表.xls VIP
- C语言程序设计PPT电子课件教案-04_循环语句嵌套及应用.ppt VIP
- 财务新纪元:现状与展望-探索财务工作的挑战与未来.pptx
- GB50496-2018 大体积混凝土施工标准.pdf VIP
- ZW8100喷水织机使用说明书2.pdf
- 冬季极端天气安全知识培训课件.pptx
- 整理bpmfdtnl单韵母拼读.doc VIP
- 南京市总工会2025年公开招聘笔试题(含答案)(DOC).doc VIP
- 中国国家标准 GB/T 42588-2023系统与软件工程 功能规模测量 NESMA方法.pdf
- 人教版初中必背古诗文.doc VIP
原创力文档


文档评论(0)