Algorithms

An algorithm is a detailed, step-by-step set of instructions that solves a problem or completes a defined task. One use of algorithms is to process information contained in data structures (e.g. ArrayLists).

Exmples of algorithms you might need to process the contents of an ArrayList are:

     Find the average value in a list of numbers
     Count how many names begin with the letter 'A'
     Sort a list of numbers into numeric order
     Sort a list of names into alphabetic order

There are a number of "standard" algorithms that are used to sort lists. An example of one of these is the bubble sort. Ask your teacher about bubble sorts, or do some research to find out about them on the Internet.

Things to find out before you finish this module:

  • What is an algorithm?

  • How to code a basic sort program (i.e. bubble sort)
  • Sample Program

    IntroToJUnitTest
    MoreAndMoreTests

    Student Recipes

    Algorithms
    SearchingAndSortingAlgorithms