1) Write a while loop that prints out the numbers 1 - 10.
while x < 11:
2) Write a repeat until loop that prints out the numbers 1-10.
until x > 10
3) Problem 6 on page 251
Because there is no initial
6. The CSMA/CD protocol is not applicable in a wireless network because all machines
communicate with each other via a central AP as a machine may not be able to detect a collision.
If CSMA/CD is used, when the medium detect a collision, the en
8. Rewrite program segment using a while structure:
count = 1
while (count < 5):
count = count + 1
48. Binary search: least case: 1
Worst case: 11< log base 2 of 4000 <12
We have that the largest number of entries is 12.
Home Work 2
1. Write an algorithm that returns the index of the first occurrence of the value key
in the sequence s1,s2 ,s3 ,.sn . If the key is not in the sequence, the
algorithm returns the value of 0. Example
1. A man has eight shirts, four pairs of pants, and five pairs of shoes. How
many different outfits are possible?
2. How many times are the print statements executed?
For i = 1 to m
For j =1 to n