next next up down toc toc mail

12.3.  A few Algorithms To Analyse

[picture]

Complexity (compare): O( [equation] )

Complexity in worst case (compare): O( [equation] )

Complexity in average case (compare): O( [equation] )

Complexity in best case (swap): O(1)

[picture]

Complexity: O( [equation] )

Procedure Look_up(node n_r, label x):

[picture]

Complexity: O( [equation] )

Procedure 8_queen(int nqueen, boolean board[8][8] )

[picture]

Procedure move(int n_rings, peg from, peg to, peg over):

[picture]

Complexity: O( [equation] )

Procedure void quicksort(array numbers, int lo, int hi )

[picture]

Complexity (average): O( [equation] )

Pr

[picture]

Main pr

[picture]

Y[equation] ind a C pr

1.   /users/faculty/hpbischo/221/Src/perm.c
2.   /users/faculty/hpbischo/221/Src/knapsack.c

A difficult alg

Newtons algorithmn: find x such that f(x) = 0.

The algorithmn as a Nassi Shneidermann diagram:

[picture]

find(x) as a Nassi Shneidermann diagram:

Procedure find(real x)

[picture]

Beware of f'(x) == 0.


back next up down toc toc mail


Created by unroff & hp-tools. © by Hans-Peter Bischof. All Rights Reserved (1998).

Last modified: 27/July/98 (12:14)