Successfully reported this slideshow.
Your SlideShare is downloading. ×

Does anyone know how did we get answer for part (b)- Below is an inter.docx

Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Upcoming SlideShare
C mcq practice test 1
C mcq practice test 1
Loading in …3
×

Check these out next

1 of 1 Ad

Does anyone know how did we get answer for part (b)- Below is an inter.docx

Download to read offline

Does anyone know how did we get answer for part (b)?
Below is an internal node in the backtracking tree for the 6 queens problem.
(a) Show the next solution that the program will discover.
(b) Use the above conguration to estimate the size of the backtracking tree (i.e., assume that the random experiment ended at the above left conguration).
ANSWER: Estimate = 1 + 6 + 6 * 3 + 6 * 3 * 1 + 6 * 3 * 1 * 1 + 6 * 3 * 1 * 1 = 97.
Another example is in page 9 http://www.csd.uwo.ca/~lila/anis.pdf
Solution
private void printGrid(){ 02         System.out.println(\"Count: \" + count); 03         for(boolean[] rows:grid){ 04             for(boolean b:rows){ 05                 System.out.print((B)/> ? \"T\":\"F\"); 06             }            07             System.out.println(); 08         } 09         System.out.println(\"\ \"); 10     }
.

Does anyone know how did we get answer for part (b)?
Below is an internal node in the backtracking tree for the 6 queens problem.
(a) Show the next solution that the program will discover.
(b) Use the above conguration to estimate the size of the backtracking tree (i.e., assume that the random experiment ended at the above left conguration).
ANSWER: Estimate = 1 + 6 + 6 * 3 + 6 * 3 * 1 + 6 * 3 * 1 * 1 + 6 * 3 * 1 * 1 = 97.
Another example is in page 9 http://www.csd.uwo.ca/~lila/anis.pdf
Solution
private void printGrid(){ 02         System.out.println(\"Count: \" + count); 03         for(boolean[] rows:grid){ 04             for(boolean b:rows){ 05                 System.out.print((B)/> ? \"T\":\"F\"); 06             }            07             System.out.println(); 08         } 09         System.out.println(\"\ \"); 10     }
.

Advertisement
Advertisement

More Related Content

Similar to Does anyone know how did we get answer for part (b)- Below is an inter.docx (20)

More from wviola (20)

Advertisement

Recently uploaded (20)

Does anyone know how did we get answer for part (b)- Below is an inter.docx

  1. 1. Does anyone know how did we get answer for part (b)? Below is an internal node in the backtracking tree for the 6 queens problem. (a) Show the next solution that the program will discover. (b) Use the above conguration to estimate the size of the backtracking tree (i.e., assume that the random experiment ended at the above left conguration). ANSWER: Estimate = 1 + 6 + 6 * 3 + 6 * 3 * 1 + 6 * 3 * 1 * 1 + 6 * 3 * 1 * 1 = 97. Another example is in page 9 http://www.csd.uwo.ca/~lila/anis.pdf Solution private void printGrid(){ 02 Â Â Â Â Â Â Â Â System.out.println("Count: " + count); 03 Â Â Â Â Â Â Â Â for(boolean[] rows:grid){ 04 Â Â Â Â Â Â Â Â Â Â Â Â for(boolean b:rows){ 05 Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â System.out.print((B)/> ? "T":"F"); 06 Â Â Â Â Â Â Â Â Â Â Â Â }Â Â Â Â Â Â Â Â Â Â Â 07 Â Â Â Â Â Â Â Â Â Â Â Â System.out.println(); 08 Â Â Â Â Â Â Â Â } 09 Â Â Â Â Â Â Â Â System.out.println(" "); 10 Â Â Â Â }

×