Sale!

rationale for the algorithm

Original price was: $40.00.Current price is: $30.00.

Category:

Description

Rate this product

Consider a set of n boxes with their positions numbered from 1 to n.  Initially all the boxesare CLOSED. These n boxes are subject to modifications over n iterations as follows.  At the ithiterations the boxes at the positions whose ids are multiples of i are flipped,  i.e.  changed fromCLOSED to OPEN or vice-versa.  For example, at iteration 1, boxes at all positions are flipped,at iteration 2, boxes at positions 2,4,6,etc.  are flipped, at iteration 3, boxes at positions 3,6,9, etc.are flipped.Propose an algorithm for find out, that after n such iterations how many boxes will be OPEN.Note that the answer requires only how many boxes, not their positions.  Describe the rationalefor the algorithm, give the pseudocode, and its complexity.  Grading scheme:  (your grade will bebased on whichever class your algorithm falls in)

Reviews

There are no reviews yet.

Be the first to review “rationale for the algorithm”

Your email address will not be published. Required fields are marked *