I have finished the first part of pset3.
It took me some time to implement selection sort. Arrays in C are def. harder than arrays on Python (Or lists). The interesting thing is that in Python you can print an array and see it how it looks and what is inside. In C you can’t do that, and so to see what’s inside of an array you need to print through a loop!
Hence the concept of “array” that I had is different. In C the important thing to keep in mind is that:
- Arrays have a determined size that you need to provide and you must declare this.
- Will be interesting how to deal with arrays of unknown size… size will I guess be a variable that changes if you need to add more things in I guess?
- You need to be careful as if you look into parts of array not allocated, you will get segmentation errors (as you are touching parts of memory you shouldn’t)