This week we covered merge sort and though we didn't have a programming assignment I took some time to explore it. I watched some videos suggested by my classmates and did my own search to find out about some of its real world applications. I'm a fan of low level code and embedded systems so I looked at the Linux kernel. As it turns out, the list_sort algorithm in the kernel which is used to sort linked lists, is based on merge sort. One difference from other applications is that they use an iterative approach and avoid recursion. The iterative approach makes for more predictable memory usage, better constrained stack usage, and cuts down on function call overhead.
Linux 6.17 list_sort
We also had our midterm this week. The process of preparing, and in my case probably over preparing, helped make the concepts we covered more concrete in my mind. Specifically, preparing my four page note sheet. With the pace of the classes, sometimes I worry that too much of what is taught might wind up in short term memory and might not serve us when we need it. I think the process of exam prep definitely helps avoid that possibility.
No comments:
Post a Comment