Linked List is a fundamental method for using data structures in modern software development, which contains sequence of nodes which also provides reference for accessing subsequent nodes. Hence run time dynamic memory allocation can be achieved with relative ease and memory allocation and management can be flexible. But one of the major pitfall of dynamic memory allocation is the programmer has to take proper care while allocating and De-allocating memory in system heap. Linked list mostly employed during software development is single linked list and double linked list.
For designing and using linked list one has to understand the concept of Stack and Heap sections of user memory. Stack is used to allocate local variables of a function known by compiler at compile time, while heap is used to allocate during run time by performing memory allocation operation by the user. Hence compiler takes care of creation, utilization and deletion of stack memory which has a limited life span. But incase of Heap memory whose life span is till the termination of program - the user has to take proper care during creation, utilization and deletion of memory. If one fails to do so then behaviour and output of the program will go hayware and it becomes nightmare to set things inorder. Many strange problems like memory leak, pointer corruption and unexpected crash willbe faced due to improper use of dynamic memory.
About Me
- Murugan
- Chennai, TN, India
- Its my life
Saturday, June 21, 2008
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment