Se ha denunciado esta presentación.
Se está descargando tu SlideShare. ×

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

Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Próximo SlideShare
C mcq practice test 1
C mcq practice test 1
Cargando en…3
×

Eche un vistazo a continuación

1 de 1 Anuncio

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

Descargar para leer sin conexión

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     }
.

Anuncio
Anuncio

Más Contenido Relacionado

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

Más de wviola (20)

Anuncio

Más reciente (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 Â Â Â Â }

×