![]()  | 
    
| CS Home » My Home Page » Teaching Archive 2005/6 » COMP1008 » Problem Class 8 | 
  Problem Class Questions 2006
 | 
  
void quicksort(double[] a, 
               int left, 
               int right) {  | 
    int partition(double[] a, 
              int left, int right) {  | 
  
2. The Eight Queens puzzle requires 8 queens to be placed on a chess board, such that no queen can be taken by any other queen. One solution is:
 
Develop a recursive algorithm that will find all the solutions to this problem.
3. You are probably familiar with a sliding block puzzle like the one illustrated below, where you have to slide the numbered blocks into order:
  
Determine a data structure to represent a sliding block puzzle and a recursive algorithm that will find the sequence of moves needed to slide the blocks into order from any starting position.
Last updated: 
        September 2, 2006  | 
    
Computer Science Department - University College London - Gower Street - London - WC1E 6BT - 
 +44 (0)20 7679 7214 - Copyright  1999-2006 UCL