Not sure where to start on this
Hey all, I have a programming assignment that I'm not really sure where to start. A week ago for part1 I had to write my own classes for the requirements, but now my professor said we HAVE to use his predesigned classes. His algo is way different than mine, and I'm lost.
The program has to do the following. There are four inputs from the command line: number of rows, number of columns, number of people, and if random.
The program is a i by j gridworld that is populated by N number of people. If the flags are not specified rows=5 cols=5 and N=5 and distribution is random. After making the grid, which I have managed to do so far, I have to spread the N number of people randomly throughout the grid. After this the program must do the following: print all members in district (i,j) (linear time), find x and display the district (constant time), and move x to a specified district (also constant time). The constant time is taken care of the doubly linked list and its implimentation.
Now I'm stuck, I think that the next step would be to randomly distribute the members in lists. Each element of the gridarray would serve as a pointer to a list. Any hints on how I should proceed?