数据结构与文件处理系统 [英] data structure and file processing system

查看:94
本文介绍了数据结构与文件处理系统的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我们必须实现文件处理系统,哪种数据结构是最佳的,为什么?
例如,如果我要存储学生的详细信息,例如ID,姓名和班级.
在此先感谢

if we have to implement a file processing system, which data structure is best and why?
for example, if i hv to store the details like, id,name, and class of students.
Thanks in advance

推荐答案

解析源文件并将其存储在数据库中.
在数据库表而不是源文件上执行所有处理操作.
Parse the source file and store it in a database.
Perform all processing operations on the database table rather than the source file.


s_aslam98写道:
s_aslam98 wrote:

如果我hv存储详细信息,例如学生的id,姓名和班级

if i hv to store the details like, id,name, and class of students


一个选项是对象序列化 [ ^ ]一种非常强大而优雅的机制.
您标记的所有编程语言均支持这种技术(通过C++通过外部"库,例如MFC:实际上,序列化是MFC的优点之一).
使用对象序列化,用于学生详细信息的正确数据结构将精确地是一个Student类,并且您选择的容器将拥有该类的尽可能多的实例(例如,使用C++,一个)在需要时,序列化机制将提供一种从文件加载(或存储到文件)容器内容的方式.


An option is Object Serialization[^] a very powerful and elegant mechanism.
All the programming languages you tagged support such technique (C++ via ''external'' libraries, like MFC: in fact serialization is one of the good things of MFC).
Using object serialization the proper data structure for the student details would be, precisely, a Student class and you would have as many instances of such class held by a container of your choice (for instance, using C++, a std::vector) whenever needed, the serialization mechanism would provide the way to load from file (or store to file) the container content.


这篇关于数据结构与文件处理系统的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆