从文件中读取大数据 [英] reading a large data from file

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

问题描述

我想编写一个从文本文件中读取数十亿个整数的C代码。每个整数长度为10位(例如-2311872000)。然后我建立一个链表来存储这些整数。我可以这样做吗?

I want to write a C code that reads billions of integers from a text file. Each integer is of length 10 digits (e.g. -2311872000). then I build a linked list to store these integers.how could I do that ?

推荐答案

除了疯狂的资源消耗要求(每十亿个整数翻译) ,至少4 GB的内存),将整数存储在链表中的目的是什么?

无论如何,你的大部分任务都相对简单,建立一个链表(例如,参见用示例C程序解释的C链接列表数据结构 [ ^ ]并存储读取整数。
Apart of the crazy resource-consuming requirements (every 'billion' of integers translates to, at least, 4 GB of memory), what is the purpose of storing the integers in a linked list?
In any case, the bulk of your task is relatively simple, build a linked list (see, for instance "C Linked List Data Structure Explained with an Example C Program"[^] and store the read integers in.


这篇关于从文件中读取大数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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