State the complex reallocation procedure, Data Structure & Algorithms

Assignment Help:

State the complex reallocation procedure

Some languages provide arrays whose sizes are established at run-time and can change during execution. These dynamic arrays have an initial size used as basis for allocating a segment of memory for element storage. Afterwards array may shrink or grow. If array shrinks during execution, then only an initial portion of allocated memory is used. Though if array grows beyond the space allocated for it, a more complex reallocation procedure must occur, as follows:

1.  A new segment of memory large enough to store the elements of expanded array is allocated.

2.  All elements of the original (unexpanded) array are copied into new memory segment.

3.  The memory used initially to store array values is freed and newly allocated memory is associated with the array variable or reference.

 


Related Discussions:- State the complex reallocation procedure

Boar corloring, Board coloring , C/C++ Programming

Board coloring , C/C++ Programming

Find the optimal control, 1. Use the Weierstrass condition, find the (Stron...

1. Use the Weierstrass condition, find the (Strongly) minimizing curve and the value of J min for the cases where x(1) = 0, x(2) = 3. 2. The system = x 1 + 2u; where

Explain threaded binary tree, Threaded Binary Tree : If a node in a bin...

Threaded Binary Tree : If a node in a binary tree is not having left or right child or it is a leaf node then that absence of child node is shown by the null pointers. The spac

Types of triangular matrices, Triangular Matrices Tiangular Matrices is...

Triangular Matrices Tiangular Matrices is of 2 types: a)  Lower triangular b)  Upper triangular

Lilz, I need to know about data structure and algorithms. can you help me?

I need to know about data structure and algorithms. can you help me?

Write functions for both addition and subtraction, You will write functions...

You will write functions for both addition and subtraction of two numbers encoded in your data structure. These functions should not be hard to write. Remember how you add and subt

Explain decision tree, Decision Tree A decision tree is a diagram that ...

Decision Tree A decision tree is a diagram that shows conditions and actions sequentially and therefore shows which condition is to be considered first, second and so on. It is

Several operations on a aa-tree, The following are several operations on a ...

The following are several operations on a AA-tree: 1. Searching: Searching is done using an algorithm which is similar to the search algorithm of a binary search tree. 2. Ins

Illustrate trivariate colour models, Illustrate Trivariate Colour Models ...

Illustrate Trivariate Colour Models Conventional colour models based on the tristimulus theory all contain three variables and so are called trivariate models. Let us now consi

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd