DEV Community


Discussion on: [HELP]Why every explanation about quicksort is somehow different?

imrc21 profile image
IMRC21 Author

Yeah, I think this defines perfectly my struggle with algorithms, I'm currently in my second year at university but couldn't pass some of the math courses and I'm having issues following the online lectures with all of this covid stuff.
At this point, I'm asking myself if it makes sense with continuing studying CS, I feel like I could even implement a quicksort (and everything else) without having the mathematical concepts but that would just make me a code monkey and I don't know if I want that.
I've watched the introduction of the course "introduction to mathematical thinking", looks like it's a really interesting course but I don't think I'll have the time.
Thank you for taking the time to answer me, I really appreciate it, you really made me think about my math gaps.

mattother profile image

No problem! I will say it mostly likely depends on your end goals.

Personally I have quite a few friends who are very successful in games and web development and do not have strong math or algorithmic skills. So if your concern is lacking knowledge in Algorithms will somehow make you unemployable that's definitely not the case. While helpful, they are not really necessary in a lot of areas of programming.

If you goal in academic then that could be different, a lot of CS is heavy in math and from what I've seen a lot of graduate CS work does require it. But you're probably best to verify for yourself.

My goal wasn't to dissuade you from exploring Algorithms either, just to try and point out materials that I personally found really helped me understand Algorithms a lot better.

Personally I'm somebody who understands better when I understand the fundamental reasons behind something. I found this a lot with classes like Calculus and Linear Alegbra. I didn't necessarily do terrible in them, but I didn't really grasp the fundamental ideas behind things like complex numbers, integrals, etc. And I found once I understand things like sets, the types of numbers systems, etc. it really helped things fall into place. And at least for me this wasn't something really covered in highschool either, so it was something I really ended having to explore myself.

If that is part of your struggles then I do think Introduction to Mathematical Thinking will be really helpful. I'll also point out he has a book too, if you're low on time, but I didn't find the book as good as the lectures themselves.

I find with Math and Algorithms there's also a lot of eureka moments too. It just takes finding the right angle to really get it. And they are both not easy subject matters, so I wouldn't to get too down if you're struggling either, pretty much everybody does.

I would give Python Algorithms a try first though. A lot of Algorithm books focus mostly on implementation rather than fundamental concepts, but Python Algorithms does a really good job of explaining the why it works part.

Also don't be afraid to ask questions to professors, online, etc. I think a lot of people are afraid of looking stupid, but there's nothing stupid about not understanding. These are tough subject matters and everybody learns in different ways. And there are plenty of people happy to help you learn (and who have probably struggled through the same material as well).

Anyways like I said I would check out Python Algorithms, I think it will probably help.

Also if you need a more in-depth explanation of Quicksort just let me know. I'm happy to try and explain it to you as best I can.