0
1.5kviews
State advantages of Linked List over arrays.Explain different applications of Linked List
1 Answer
0
3views
  1. Following are the points in favour of Linked Lists.

    1. The size of the arrays is fixed: So we must know the upper limit on the number of elements in advance. Also, generally, the allocated memory is equal to the upper limit irrespective of the usage, and in practical uses, upper limit is rarely reached.
    2. Inserting a new element in an array of elements is expensive, because room has to be created for the new elements and to create room existing elements have to shifted.
    3. For example, suppose we maintain a sorted list of IDs in an array id[]. id[] = [1000, 1010, 1050, 2000, 2040, …..]. And if we want to insert a new ID 1005, then to maintain the sorted order, we have to move all the elements after 1000 (excluding 1000).
    4. Deletion is also expensive with arrays until unless some special techniques are used. For example, to delete 1010 in id[], everything after 1010 has to be moved.
  2. Polynomial Algebra is one of the application of linked list as follows:-

    1. The biggest integer that we can store in a variable of the type int is 231 - 1 on 32-but CPU.If the value becomes too large, Java saves only the low order 32 (or 64 for longs) bits and throws the rest away.
    2. In real life applications we need to deal with integers that are larger than 64 bits (the size of a long). To manipulate with such big numbers, we will be using a linked list data structure
    3. The following numbers can also be expressed as below:- 937 = 910^2 + 310^1 + 710^0 and 2011 = 210^3 + 010^2 + 110^1 + 1*10^0
    4. Now, if we replace a decimal base 10 by a character, say 'x', we obtain a univariate polynomial, such as 0.45 - 1.89 x2 + 3.4 x5 + 9 x16. This can be saved using linked list as follows

    DIAGRAM 1

Please log in to add an answer.