:. Links
-Home
-History of C++
-Data Types in C++
-Arrays
-Basics
-Classes & Objects
-Files
-Inheritance
-Strings
-Structures
-Operator Overloading

:. Xtraas

-Programming Links
-Sign Guestbook



:: Arrays ::

Arrays are linear data structures,they can be made of any kind of data types(both fundamental and user defined).An Array is a series of successive memory locations.
Example:
float arr[5];
Specifies an array of type float it can hold five numbers of type float(i.e.number that have a decimal part).
Arrays can be used to implement many other complex data structures like Stacks and Queues.Some programs based on arrays are given below.Click on the program title to see source code.

Arrays are used to stored lists of integers(or any other data type),we can perform searching and sorting operarions on these lists


  1. Program to perform binary search,
  2. Program to perform a Bubble Sort,
  3. Program to change an expression in Infix notation to Postfix notation,
  4. A program to perform an inserion sort.

    Another main application of arrays is to represent matrices,


  5. A program to perform matrix addition,
  6. A program to perform matrix multiplication,
  7. A program to display the transpose of a given matrix,

    A sparse matrix is a matrix that contains mainly 0s,for instance,
    1 0 0 0 0
    0 0 0 0 1
    0 0 1 0 0
    0 0 0 0 0
    0 0 0 0 0
    is a sparse matrix.Representing all the elements of this matrix in memory is a waste of memory as almost all the elements are 0s.Therefore we just store the position of the non-zero elements as a matrix.A few programs for sparse matrices are shown below:

  8. A program to store the non-zero elements of the sparse matrix as an array,
  9. A program to obain the transpose of the array of non-zero elements and therefore obtain the transpose of the sparse matrix,

    Arrays are also used to implement stacks and queues,heres how

  10. A program to implement Queue using arrays,
  11. A program to implement a Stack using arrays.

    Click >> Here << for a detailed tutorial on arrays.

     

© 2006 Austinium Webworx