Get the latest tech news
Deep list copy: More than meets the eye
ullprogram.com/blog/2024/07/31/ I recently came across a take-home C programming test which had more depth and complexity than I suspect the interviewer intended. While considering it, I also came up with a novel, or at least unconventional, solution.
I recently came across a take-home C programming test which had more depth and complexity than I suspect the interviewer intended. While thickheaded, this is conventional, and I cannot blame the test’s designer for sticking to familiar textbook concepts. If we can obtain a stable value from a pointer, i.e. uintptr_t — in practice virtually always true — then there’s an interesting O(n log n) solution using an intrusive map which doesn’t modify the original list.
Or read this on Hacker News