




























































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





























































































(week 5-6)
List ADT by array
ADT Lists
Dynamic Allocation of Matrices
Allocating storage for a matrix as an array of arrays int** M = new int*[n]; // allocate an array of row pointers for (int i = 0; i < n; i++) M[i] = new int[m]; // allocate the i-th row
Array Limitations
Linked Lists
How another node is referenced?
Continued..
Continued.. /* Allocate memory / one = malloc(sizeof(struct node)); two = malloc(sizeof(struct node)); three = malloc(sizeof(struct node)); / Assign data values */ one->data = 1; two->data = 2; three->data=3;
Continued..