存储1,000,000条记录 [英] storing 1,000,000 records

查看:73
本文介绍了存储1,000,000条记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你认为在这里使用文件而不是

链接列表或数组会更好吗?该文件可以组织成一个数组,以便一个

可以索引它吗?

do you think it will be better to use a file over here instead of a
link list or array ? Can the file be organized as an array so that one
can index into it ?

推荐答案

lector写道:
lector wrote:

你认为在这里使用文件而不是

链接列表或数组会更好吗?
do you think it will be better to use a file over here instead of a
link list or array ?



如果你有足够的RAM使用它,因为它比磁盘快数千倍b / b $

该文件可以组织为一个数组,以便一个

If you have enough RAM use it since it is thousands of times faster
than a disk.
Can the file be organized as an array so that one


可以索引它吗?
can index into it ?



是。


如果记录大小(在磁盘上)是X,则第5876条记录是偏移的

X * 5875字节。

-

jacob navia

jacob at jacob point remcomp point fr

logiciels / informatique
http://www.cs。 virginia.edu/~lcc-win32


4月7日上午12:32,jacob navia< ja ... @ nospam.comwrote:
On Apr 7, 12:32 am, jacob navia <ja...@nospam.comwrote:

>

是。


如果记录大小(在磁盘上)是X,第5876条记录是偏移的

X * 5875字节。
>
Yes.

If record size (on disk) is X, the 5876th record is at offset
X*5875 bytes.



你能告诉我具体的文件功能吗?

Can you please tell me what file function specifically does this ?


是这个函数


int fseek(FILE * stream,long int offset,int origin);


我不知道是否足以将偏移作为长整数。
Is it this function

int fseek ( FILE * stream, long int offset, int origin );

I don''t know if it sufficient to have offset as a long int.


这篇关于存储1,000,000条记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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