ProgrammingVery hard
For n = 10^5 cells in a 1D array viewed as a 316 x 317 grid, what is the total cell count?
- A. 100172
- B. 100000
- C. 100489
- D. 99999
Correct answer: A. 100172
316 x 317 = 100172, which is more than n, so the trailing cells must be unused.
More C Programming questions
- A matrix has R rows and C columns with R = 3 and C = 4 in a flat array of 12 ints. What flat index is cell (2, 3)?
- A square matrix is symmetric when a[i][j] equals a[j][i]. What is the time needed to test an n x n matrix for symmetry in C?
- A singly linked list is built by inserting 1, 2, 3 at the head. Then two nodes are popped from the head and their values printed. What is…
- A circular singly linked list holds 1 -> 2 -> 3 -> back to 1. Starting at the head node, the program prints six consecutive values. What…
- A sorted list 1, 1, 2, 3, 3 has its duplicates removed by a loop that unlinks a node whose value equals the previous node's value. How…
- A dynamic array starts with capacity 1 and doubles whenever it is full, until its capacity is at least 10. What is the final capacity?