Using doubly linked list

I have this function below, and I'm having difficulties on where to start. I have to build a Grid World using doubly linked lists. And the function below must be constant time O(1).

 
int *members (World*w, int i, int j, int *n);


Behavior for this function is to return an integer array that contains the members of district {i, j} in the world. Also, stores in *n is the number of entries in the array. Therefore, if {i,j} are not valid, then NULL is returned. Otherwise, return the integer array.

The output of this function should print the list of people living in district (i,j).

I have tons of other functions to write, but if someone could explain how I could start with a pseudo-code for this function, I think I can do the rest of the other functions. Thank you.


Last edited on
Topic archived. No new replies allowed.