Welcome!!! This blog comprises stuff which everybody intends to merge with: News, Technology, Things and more...It needs no further description as the world knows quite a lot about this infamous blog!

Second Step: Array as Linear Structure

February 9, 2010 Biswapratap Leave a comment

What is Array?

  • An array is finite, ordered and collection of homogeneous data elements.
  • Array is finite because it contains only limited number of elements.
  • Array is ordered because all the elements are stored one by one in contiguous locations of computer memory in a linear ordered fashion.
  • Array is homogeneous because all the elements of an array are of the same type.
  • Array is linear because all the elements of an array form a sequence.

There are two basic way of representing such linear structure in memory.

  • One way is to have the linear relationship between the elements represented by means of sequential memory locations. These linear structures are called arrays.
  • The other way is to have the linear relationship between the elements represented by means of pointers or links. These linear structures are called linked lists.

Operations on Linear Data Structures (Array, Linked Lists)

The operations one normally perform on any linear structures, whether it be an array or linked list, include the following

  • Traversal: Processing each element in the list exactly once.
  • Search: Finding the location of the element with a given value.
  • Insertion: Adding a new element to the list.
  • Deletion: Removing an element from the list.
  • Sorting: Arranging the elements in some type of order.
  • Merging: Combining two lists into a single list.