Static and dynamic data structures
It is proposed that this article be deleted because of the following concern:
If you can address this concern by improving, copyediting, sourcing, renaming, or merging the page, please edit this page and do so. You may remove this message if you improve the article or otherwise object to deletion for any reason. Although not required, you are encouraged to explain why you object to the deletion, either in your edit summary or on the talk page. If this template is removed, do not replace it. This message has remained in place for seven days, so the article may be deleted without further notice. Find sources: "Static and dynamic data structures" – news · newspapers · books · scholar · JSTOR Nominator: Please consider notifying the author/project: {{subst:proposed deletion notify|Static and dynamic data structures|concern=student essay and fork of existing articles}} ~~~~ Timestamp: 20111008102522 10:25, 8 October 2011 (UTC) Administrators: delete |
Static and dynamic data structures are collection of data components that are constructed in a regular and characteristic way. There is a relationship between some kind of data item in data structure, which is manipulated with computer science technologies. The simplest data structure [1]is one dimensional array in which each element is stored with particular memory address, which is in form of number. Computer science has developed manipulatable & easily sortable data structures which are in large numbers.
Static data structure
In it,memory is allocated statically i.e. it is possible to change content but without increasing the memory space allocated to it. Static variables are created in the declaration of a program and exit that space till its conclusion. [2] So if memory requirement expands or shrinks at the time of executing the program, memory is insufficent for that data or wasted respectively.
Characterstics of static data structure
- Fast access of elements.
- Memory is allocated at the compile-time.
- Static allocation are memory inefficent
- e.g. array data type,records,etc
- No re-usability of allocated memory.
- Difficult to guess the exact size at the time of writing program
Dynamic data structure
In it,memory is allocated dynamically i.e. it is possible to add elements, delete existing elements as well as modifying it without caring about it's initial value. The allocation of memory during the running of a program and under the control of the program is said to be dynamic memory allocation. Dynamic memory is managed in 'C' language through a set of library functions.
Allocating a block memory in C.
ptr= ( cast- type) malloc(byte- size); the "malloc()" returns a pointer ( of cast type) to an area of memory with size. EX.x= (int*)malloc(100*size of(int));
A linked list is an example of dynamic data structure. It can grow or shrink at time of execution. The ADT known as a Linked List is the simplest example of a data structure providing the capability of dynamically adapting to accommodate changes in the quantity of information stored.
Characterstics of dynamic data structure
- Slower access of elements.
- Required memory is allocated at run time, so memory is not wasted here.
- e.g. stack,ques,etc
- Unwanted space can be reased at run time.
- ALL linked structure are preferably implemented through dynamic data structure.
- Re-usability of memory space. 0
See also
External links
Books
- Title=Give Me back My Data structure|year=2010|author=A. Slowinska, T. Stancescu, and H. Bos.
References
- ^ A. Slowinska, T. Stancescu, and H. Bos. (2010). Give Me back My Data structure. Amsterdam. ISBN 0 340 74152 X.
{{cite book}}
: CS1 maint: location missing publisher (link) CS1 maint: multiple names: authors list (link) - ^ "Ayoma Online".