Re: [Dev-C++] student needs a little help
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Jason H. <jas...@bt...> - 2002-02-16 19:58:53
|
MessageThe trick is to tailor your method of accessing the data to the = type and quantity of data and the access speeds needed. In the store = example a few thousand records wouldn't be unreasonable, and each record = would be on average no more than 30 bytes each (roughly). Say you did = have 10000 record at 50 bytes (adding space for list implementation = etc...), that's 500,000 bytes, in other words just less than 500kb (say = half a meg). On the scale of current memory usage that's pretty = miniscule. There are cases where it's impracticle to use memory and you = have to use disk stored systems, and there are a range of specialised = algorithms for dealing with them, but on the whole most developers would = just use a Database system for large scale data storage and retrieval. = Another factor to account for is the fact that most OS's have a virtual = memory ability, so in effect if you do load a large quantity of data = into memory it will be be automaticaly placed into a disk storage = system, and it saves you a lot of complex work on disk access = algorithms. Also by ordering a list of records into a predictable sequence you allow = for the use of special searching algorithms, as aposed to the basic = sequential search. What you use is yet again dependent upon scale and = speed requirement. However there are whole volumes dedicated to this one = subject alone so I won't go into detail here. At a guess anything up to a couple of hundred megabytes is good for = memory storage (dependent upon the OS and target system in use), and = above that a more advanced data access system should be considered. Also = of note is that memory has somewhere on a scale of 1000 times quicker = access speeds than current disk technology. After saying all that a linked list wouldn't be a perfect solution = because it's not the fasted model, a tree would be more suited, but they = all follow the same principal. Searching through 10000 records in a = linked list in memory wouldn't take more than a few seconds either (at a = guess). Maybe you didn't want to know all that, but I think it's an interesting = subject. Jason. ----- Original Message -----=20 From: Ioannis Vranos=20 To: Dev-C++=20 Sent: Saturday, February 16, 2002 4:22 PM Subject: RE: [Dev-C++] student needs a little help I am really with short programming experience (i have been programming = since 2000) and i can't understand how we can use linked lists on a = large scale program. E.g. imagine we have a datafile with 10000 records. = We load all of them in memory in a linked list so as to sort them on the = fly e.t.c.? In few words the question is how can we apply a linked list = in many records? Ioannis * Ioannis Vranos * Programming pages: http://www.noicys.d2g.com * Alternative URL: http://run.to/noicys -----Original Message----- From: dev...@li... = [mailto:dev...@li...] On Behalf Of Benjamin = Wheeless Sent: Saturday, February 16, 2002 3:40 PM To: dev...@li... Subject: RE: [Dev-C++] student needs a little help In my opinion, what he uses is really up to him, whether that be a = container, or forcing it through with brutish, inefficient code, or = using your suggestion and sticking with the data file as his container. The only reason that I suggested linked lists is due to the fact = that he (1) is a student and his professor probably gave him the = assignment in hopes that he would figure out basic data structure = techniques, while at the same time showing some initiative and = creativity in solving the problem and (2) because a question was posed = directly concerning linked lists and where to find more information on = them. There is nothing "wrong" with any of these approaches that have been = suggested. It is really up to him and his comfort level and knowledge = base that he currently has with the language. Wouldn't you agree? Benjamin Wheeless Network Systems - Delta Airlines, Inc. Atlanta, GA - USA 30320 |