Algorithms

The definition of an algorithm :

      An algorithm is an ordered set of unambiguous, executable steps

that defines a terminating process.

 

Pseudocode : 不能被編譯與執行的簡化程式碼.

Pivot : 基準點.

 

Iterative Structructure : 

      A collection of instructions is repeated in a looping manner.

 

Sorting Algorithm :

 1. Selection sort

 2. Bubble sort

 3. Insertion sort

 

Big theta notation : Used to represent efficiency classes.

 

 

# An iterative algorithm involves only the parameters and not 

  the algorithm itself.

# An recursive algorithm involves the algorithm itself.

 

Software Verification :

   ~Proof of correctness 

      - Assertions

          ~Preconditions.

          ~Loop invariants.

   ~Testing

 

Dynamic programming VS.  Divide - and - conquer

 -Similarity

   > The instance of problem is divided smaller  instrances. 

 -Differences

     ~Divide - and - conquer

      > Top - down

      > solves the divided instances by recursion.

        > inefficient.

    ~Dynamic programming

       > Bottom - Up

       > Programming.