Skip to content

Latest commit

 

History

History

Arrays

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Arrays

Linear Data Structure

Implementation

  • Check this to look at a few basic array operations.

Errors

  • When reading in an array, it is possible to overwrite memory that does not belong to the array.
  • Accessing elements outside the array.

Complexity

  • Time:
    • Access Element:
      • Worst Case: formula
      • Average Case: formula
    • Search Element:
      • Worst Case: formula
      • Average Case: formula
    • Delete Element:
      • Worst Case: formula
      • Average Case: formula
  • Space:
    • Worst Case: formula

Applications

  • Used in the implementation of other data structures like linked lists, etc.
  • Used in mathematical problems such as matrices, etc.
  • Used in lookup tables by computer
  • It effectively executes memory addressing logic wherein indices act as addresses to the one-dimensional array of memory

Double Dimensional Arrays

Linear Data Structure

Implementation

  • Check this to look at a few basic array operations.

Complexity

  • Time:
    • Input Elements:
      • Worst Case: formula
    • Display Elements:
      • Worst Case: formula
    • Display Boundary Elements:
      • Worst Case: formula
    • Display Lower Right Elements:
      • Worst Case: formula
    • Display Upper Left Elements:
      • Worst Case: formula
    • Sum of Boundary Elements:
      • Worst Case: formula
    • Sum of Lower Right Elements:
      • Worst Case: formula
    • Sum of Upper Left Elements:
      • Worst Case: formula
    • Sorting Array:
      • Worst Case: formula
  • Space:
    • Worst Case: formula

Applications

  • Many games use two dimensional arrays to plot the visual environment of a game.
  • Used in mathematical problems such as matrices, etc.
  • To visualize this data, we need a multi-dimensional data structure,i.e 2-D arrays.