Below is an algorithm for the nextGeneration from Assignment 0. It is intended to help you write your algorithm for the first part of Assignment 1. The algorithm was produced using "top-down design". We start at the "top", with a description of the overall algorithm. This description is kept very short. If necessary, details that would make the description long are given elsewhere. (This is analogous to using sub-methods or helper methods in a program.) Each sub-algorithm (for example, sub-algorithm 2 below) is broken down in the same fashion. The result is a set of algorithms that use each other, each of which is short and simple. These translate nicely into a set of short and simple methods in Java. TOP DOWN DESIGN/STEPWISE REFINEMENT FOR NEXT GENERATION IN ASSIGNMENT 0 Note: This is a very simple algorithm. The algorithm for nextGeneration in Assignment 1 will be considerably longer and more difficult. HINT for assignment 1: Your algorithm will take advantage of the list of live cells, but it should NOT depend on how the list is implemented. Instead, your algorithm should treat the live cell list as an abstraction. You can say things like "add cell c to the list of live cells", or "check if cell c is in the list of live cells", but you should not say things like "remove the first node from the linked list of live cells". ------------------------------------------------- to compute nextGeneration: 1. create a new grid to hold the next generation 2. determine the next generation 3. replace the old grid by the new grid ------------------------------------------------- 2. to determine the next generation: for each location 2.1 determine the number of live neighbours of the cell in that location of the old grid 2.2 evolve the cell and store the result in that location of the new grid ------------------------------------------------- 2.1 to determine the number of live neighbours of a cell in a particular location: use the integer variable num to count the number of live neighbours 2.1.1 initialize num to 0 if the cell is empty initialize num to -1 if the cell is live 2.1.2 for the rows r of and adjacent to the location for the columns c of and adjacent to the location if location (r,c) of the old grid contains a live cell increment num