I created the 2 structures for 2D link list. I am not good with pointers. Can u tell me how can i initialize and get elements from min_cost_candidate structure?
like some thing
min_cost_all_col[0] ->min_cost[1].unique;
min_cost_all_col[0] ->min_cost[1].tmp_perm[2];
min_cost_all_col[0] ->min_cost[1].join[2][3];
Code:
typedef struct min_cost_candidate {
/*! Array that join the processes belongs to same group */
int **join=Null;
/*! Number of unique groups communicating in a column */
int unique = 0;
/*! Column No.*/
int col;
/*! Use to get starting index of column j in the structure */
int ptr;
/*! Process permutation ordering within column */
int *tmp_perm=Null;
/*! Number of processes in column */
int col_elem;
} min_cost_candidate;
/*! structure storing details of all permutation orders
which have smallest cost function for all columns */
typedef struct min_cost_all_col {
/*! pointer to array of min_cost_candidate elements of size of smallest_indexes_array */
min_cost_candidate *min_cost;
/*! Pointer to next column */
struct min_cost_all_col *next;
} min_cost_all_col;
min_cost_candidate *min_cost = (min_cost_candidate*)malloc(size *sizeof(min_cost_candidate));
min_cost_all_col *current_min_cost_all, *new_min_cost_all;

Originally Posted by
rcgldr
There could be a list class or structure with a head and tail pointer to node, used to access the first level list, and included as a member of in each of the nodes in the first level list to access the second level lists.