{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

COT 3100 Spring 2010-Midterm2_practice

# COT 3100 Spring 2010-Midterm2_practice - Name UFID COT 3100...

This preview shows pages 1–6. Sign up to view the full content.

Name:__________________________________________________ UFID:___________________________ _ 1 COT 3100 Spring 2010 Practice for Midterm 2 For the first two questions #1 and #2, do ONLY ONE of them. If you do both, only question #1 will be graded. 1. (20 pts) Give iterative and recursive algorithms for reversing a bit string. 2. (20 pts) Give iterative and recursive algorithms for calculating the term of the sequence * + where . Which algorithm is more efficient and why?

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

View Full Document
Name:__________________________________________________ UFID:___________________________ _ 2 3. (10 pts.) Use mathematical induction to show that ( ) , whenever n is a positive integer. 4. (20 pts) Let ( ) . Use induction to show that a) for .
Name:__________________________________________________ UFID:___________________________ _ 3 b) ( ) ( ) . 5. (10 pts) Give the recursive definition of the sequence {a n }, n = 1,2,3,… if a. b. ( ) 6. (10 pts) How many ways are there to seat 6 people around a circular table, where seatings are considered to be the same if they can be obtained from each other by rotating the table?

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

View Full Document
Name:__________________________________________________ UFID:___________________________ _ 4 7. (20 pts) Show that among any group of 20 people (where any two people are either friends or enemies),

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}