Question: In embedded systems, memory optimization is critical. Consider a structure `Buffer` that contains a dynamically allocated array for storing sensor data and a flag indicating if the buffer is full. Write a C program that:
→ Initializes a `Buffer` structure with a dynamically allocated array.
→ Provides functions to add data to the buffer, check if it is full, and reset the buffer.
→ Implement a function to compress the buffer by removing unnecessary elements (e.g., duplicate entries or zeros) and resizing the array dynamically.
→ Discuss the trade-offs between memory usage and processing time in this approach.