You are here:

C/Linked List

Advertisement


Question

How big can we use our linked list in any application?

For example, you have 30,000 records each record size is 200 bytes.
Can we use linked list to accommodate this?

if we can't what other options like data structures can we implement for this kind of operation.

I'll be happy to know this ......  

Answer
Dear Reiberio !

Answer for this question depends on the operating system and the compiler !

For our discussion let me assume that you are using DOS based TURBO C   3.0 Compiler , This  compiler supports 5 different types of memory model to hold both code and data that has been used by the program

A data segment is one of the sections of a program in an object file or in memory, which contains the global variables that are initialized by the programmer.
 
  The Data part contains constants used by the program that are not initialized to zero. For instance the string defined by char s[] = "hello world"; would exist in the Data.

 The Heap area begins at the end of the Data segment and grows to larger addresses from there. The Heap area is managed by malloc, realloc, and free, which use the brk and sbrk system calls to adjust its size. The Heap area is shared by all shared libraries and dynamic load modules in a process.

Let me summarize the memory models !
                       Segment          Pointers  
Memory model       Code  Data  stack    Code  data
Tiny                Total of 64k mem    near  near  
Small               64k  |    64K       near  near
Medium              1MB  |    65K       far   near
Compact             64K  |    1MB       near  far
Large               1MB  |    1MB       far   far
Huge                1MB  |64K |64K      far   far

So based on the memory model you are given various options  to use the main memory for your program depend on the requirements !

Note : This restriction is relaxed if its a window based compiler , i recommend you to refer the reference manual of the compiler vendor's

Thanks and regards !
Prince M. Premnath  

C

All Answers


Answers by Expert:


Ask Experts

Volunteer


Prince M. Premnath

Expertise


I'm sure that I can solve any doubts in Turbo C ,Graphics Programing ,Mouse, Hardware Programming ,File System ,Interrupts, BIOS handling , TSR Programming , General Concepts in C Language, handling inline Assembly statements

Experience

Research over 6+ Years

Organizations
CG-VAK Softwares and Exports Limited

Education/Credentials
Masters in Computer Applications

©2012 About.com, a part of The New York Times Company. All rights reserved.