For All Human Beings.......

Showing posts with label Binary Search. Show all posts
Showing posts with label Binary Search. Show all posts

Tuesday, April 15, 2008

Data Structures (1 D & 2 D Arrays)

Array

It is a static data structure. It is a homogeneous collection of data. The elements in the array are stored on consecutive memory locations. Array is also known as a subscripted variable, e.g., A[i] is ith element of the array A (i.e., i is the subscript with variable A). As we know that the elements of the array are stored on consecutive memory locations, it becomes convenient to find out the address of memory location of ith element, for given base address (address of first element) and W (i.e. the number of memory locations required by one element).

Different Operations on 1 D ARRAYS

  • Creation
  • Traversal
  • Insertion
  • Deletion
  • Searching
    • Linear
    • Binary Search
  • Sorting
    • Bubble Sorting
    • Selection Sorting
    • Insertion Sorting
  • Merging

Different Operations on 2 D ARRAYS

  • Creation
  • Printing (Traversal)
  • Addition of two Matrix
  • Difference Matrix
  • Multiplication of Matrix
  • Row / Col Sum
  • Diagonal Sum
  • Transpose Matrix
For Functions on ARRAYS Click Here ..........

Sunday, March 30, 2008

Binary Search Function (Presorted Array)

Function to Search for an element from ARR[10] by Binary Search Method. Binary search method can be applied on array only if it is sorted. This function assumes that array is arranged in ascending (increasing) order.