Test Prep > EECS 3101 Winter 2018-19 – Test 1


York University EECS 3101 1. Loop Invariants: algorithm Sum(a,b) pre−cond: bisapositive integer. a can be any real. post−cond: a+b is returned begin x =a y =b r =2⌊log2y⌋ (the biggest power of 2 not bigger than y.) loop loop−invariant : ??? exit when y = 0 if( y ≥ r ) case 1 x =x+r y =y−r else case 2 r =r/2 end if end loop return(x ...[Show More]

Preview 1 out of 3 pages
Purchase this document to unlock the blurred part and the rest of the document

Unlock Now

Reviews( 0 )

Unlock this Document

Purchase the document to unlock it.

$5.00

Unlock Now

2
1

Category:
Number of pages: 3
Language: English
Last updated: 2 months ago
Downloads: 1
Views: 2

Can't Find what you want?

PLACE CUSTOM WRITING ORDER