CommonFunctions - CMPS 201 Algorithms and Abstract Data...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
1 CMPS 201 Algorithms and Abstract Data Types Some Common Functions We present several common functions and estimates which occur frequently in the analysis of algorithms. Floors and Ceilings Given R x , we denote by   x and   x the floor of x and the ceiling of x , respectively. These are defined to be the unique integers satisfying     1 1 + < < - x x x x x Equivalently, if R x and Z N then (1)   x N = if and only if 1 + < N x N , and (2)   x N = if and only if N x N < - 1 . In other words: (1)   x is the greatest integer less than or equal to x , and (2)   x is the least integer greater than or equal to x . Lemma 1: Let R x and Z b a , . Then (1) b x a < if and only if   b x a < , and (2) b x a < if and only if   b x a < . Proof of (1): (i) x a implies   x a , since among all integers that are less than or equal to x ,   x is the greatest. (ii) b x < implies   b x < , since   x x . (iii)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/03/2009 for the course CS CS101 taught by Professor Agoreback during the Spring '09 term at American College of Gastroenterology.

Page1 / 4

CommonFunctions - CMPS 201 Algorithms and Abstract Data...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online