diagonal from left to right is constant. A circular Toeplitz matrix is a square matrix that has the same elements in each row, but rotated to the left by one element than the upper row. For example, If the circular Toeplitz matrix is 3x3, then it is:
123
312
231
array2D
Then these elements are stored in the memory as 1 2 3 3 1 2 2 3 1 in order.
Assume that we are given the size of the circular Toeplitz matrix, write a C code that takes the size of the circular Toeplitz matrix, generates the matrix and prints its elements. Use a single pointer pointing to the first address of the array2D. You can use iterators to find the position of an element in the matrix, but not the array subscript notation.
For example, if a user enters the size of the matrix as 3. Create a pointer, then start populating the elements pointed to by this pointer at i and j index. Here, you can check if the indices are within the boundary. Then print array2D using the created pointer.
Hint 1: Divide your main problem into smaller pieces.
Hint 2: Maybe it is easier to attempt the problem first using the array notation before switching to
the pointer notation. Hint 3: Keep It Simple, Stupid (KISS).
Hint 4: allocate different variables for indexing and the value of the matrix element.
111