lab0-c
lab0-c copied to clipboard
It can use VLA to bypass the memory allocating limit in q_sort()
In q_sort(), it prefered to use a in-place algorithm to sort the list, so it disallowed the malloc() in some testcases.
But I can still use Variable-length array to bypass this limit, and use a algorithm which space complexity is O(n) to pass all testcases.
Is it a fatal problem?
@eecheng87, we can follow the way how Linux kernel removed VLA. That is, enforce compilation argument -Wvla.