Skip to content

Introduction

Loop Variant

Insert Sort: Loop Variant

  • Initialization

  • Maintenance

  • Termination

Running Time

Insertion Sort: Running Time

Big-O Notation

  • O(g(n)) is a set of functions, all functions that do not grow faster than g(n).

  • O() gives an upper bound on a function.

  • n = O(n2)

  • 2n = O(n) c,n,n>n0:2n<=cn

  • n = O(2n4) n>4,n<=2n4

Prove n2O(nlogn)

Assume that n>=n0,n2<=nlogn

Big-ω Notation

  • Ω(g(n)) is a set of functions all functions that do not grow slower than g(n).

记录原理、连接知识、积累实践。