News for hackers. Stuff that matters.
Re:Learning Algorithms by rg111 on Saturday August 12, 2023 @03:52PM (#37103648)
The author would do himself a great service if he chooses some other resource for learning algorithms.

CLRS isn't bad. It is meant for a reference, and it also assumes that you are taking the course in college with an instructor teaching you.

There are other great resources out there.

Two I recommend are:

- Algorithms, Coursera (Sedgewick, Wayne)

- The Algorithm Design Manual (Skiena)

I have recommended self-taught programmers in the past, which all of them liked:

- A Common Sense Guide to Data Structures and Algorithms, PragProg (Jay Wengrow)

- Algorithms Illumited, book or Coursera MOOC (Tim Rougharden)

Re:Learning Algorithms by speakspokespok on Saturday August 12, 2023 @04:35PM (#37104021)
I always recommend 'A Common Sense Guide to Data Structures and Algorithms' as well but I'd like to call out the 2nd edition has expanded the recursion chapters and in general the end of chapter assignments are better. The 2nd edition was born from several years of teaching material from the first edition.
Re:Learning Algorithms by sdenton4 on Saturday August 12, 2023 @04:12PM (#37103814)
Skiena is great.

My usual learn-a-new-language routine is speed-running the first 25ish Project Euler problems. They cover a lot of three usual language basics.

https://projecteuler.net/

Re:Learning Algorithms by sn9 on Saturday August 12, 2023 @04:55PM (#37104152)
Skiena posts recent semesters of lectures on Youtube as playlists, as well.

Going through them at 1.25-1.5x speed, a lecture per night or every few days, is extremely helpful.

Re:Learning Algorithms by paedubucher on Saturday August 12, 2023 @05:24PM (#37104358)
One issue I have with CLRS is that array indices usually start at 1, but sometimes they use 0, because it works better in that particular case. Some functions I used in Erlang (lists:sublist/3, lists:nth/2) use 1-based indices, too. I thought that 0-based array indices (and exclusive upper bounds) were quite a done deal in computer science (https://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/E...).
Re:Learning Algorithms by PartiallyTyped on Sunday August 13, 2023 @02:59AM (#37107348)
CLRS and Tardos && Kleinberg are great if you spend a whole year on the book and have mathematical background.

The latter is great for algorithms because it groups everything by concepts, ie greedy, DP and then network flows.

Re:Learning Algorithms by BossingAround on Saturday August 12, 2023 @04:35PM (#37104018)
I've recently been trying to learn algorithms as a self-taught software engineer. I've made it quite far without much deeper knowledge of the area (I do have some basic overview of course), but it has always been on my mind that I should to study up.

I've tried CLRS, but oh boy it's a) a slog to go through, b) very sparse with explanations. You might say that the whole book is one explanation after another, and you'd be technically right, but there's nothing more frustrating than an overly complex explanation that might be absolutely precise yet complex to understand. I also often feel like the language is needlessly complex.

On top of that, for example, the mathematical explanations often skip steps that are obvious to authors. You might think it's reasonable, but to a struggling newcomer, this is a huge drag.

Unrelated to algorithms (but not totally), I am now studying Discrete Mathematics for Comp Sci [0] since I felt like my math knowledge (or lack thereof) is holding me back in reasoning about algorithms. Even those courses have a fair share of skipping obvious steps in mathematic explanations, but it's doable so far (especially with tools like ChatGPT and Wolfram Alpha to check my understanding).

I'm just trying to be a better engineer, and I'm having a really hard time trying to find a suitable resource to learn from.

[0] https://www.coursera.org/specializations/discrete-mathematic...

Re:Learning Algorithms by trealira on Saturday August 12, 2023 @06:00PM (#37104618)
I'm still in university, but I took discrete math at my university last semester and took data structures over the summer between semesters.

My data structures course mainly was graded from Zybooks assignments. I think it's actually a pretty good and understandable resource. It was this: https://www.zybooks.com/catalog/data-structures-essentials/

Anyway, maybe after you study discrete math from Coursera, that Zybook could help. It has some basics about big-O notation and determining the big-O of an algorithm (and calculating the number of operations it requires), but after that, it's all explanations of data structures accompanied by many animations and pictures. It may be tedious for someone who already knows how e.g. red black trees works, but it helped me understand them, as well as unbalanced BSTs, AVL trees, B-trees, heaps, and graphs. The stacks and queues were tedious for me, because I already know them.

I do think having taken discrete math helped me; I still flipped through CRLS during the course on the side, and their explanations were less impenetrable because I know the basics of mathematical proofs now.

There's also a book on data structures that went over hash functions (it's out of print, but I found a PDF online). It was also helpful for me. I'll reply to this comment with it when I get home.

Re:Learning Algorithms by trealira on Saturday August 12, 2023 @10:02PM (#37105956)
I got home. The book is Handbook of Algorithms and Data Structures in Pascal and C by G.H. Gonnet and R. Baeza Yates.
Re:Learning Algorithms by goodbyesf on Saturday August 12, 2023 @06:16PM (#37104714)
> I'm just trying to be a better engineer

Your time would be better spent on accumulating domain knowledge in whatever industry you are working in - finance, healthcare, government, etc. Especially if you want career advancement or make yourself look more attractive to prospective employers. Unless you are directly involved in writing algorithms or academic research, you really won't be proving time and space complexity of algorithms in your job. A general understanding is sufficient for 99% of the jobs out there.

Re:Learning Algorithms by mekoka on Saturday August 12, 2023 @10:08PM (#37105982)
What a strange advice. So much to disagree with, but I'll just stick with algorithms specifically. Only once I went through ds & algo, after a long career, that I understood what Linus Torvalds meant by "bad programmers worry about the code. Good programmers worry about data structures and their relationships."
Re:Learning Algorithms by goodbyesf on Monday August 14, 2023 @10:10PM (#37129331)
> Linus Torvalds meant by "bad programmers worry about the code. Good programmers worry about data structures and their relationships."

That's why I wrote: 'Unless you are directly involved in writing algorithms or academic research, you really won't be proving time and space complexity of algorithms in your job. A general understanding is sufficient for 99% of the jobs out there.' If you are developing a kernel, then you should have a solid understanding of algorithms, data structures, etc. But 99% of programmers aren't developing kernels. 99% of programmers are working in industry - finance, healthcare, government, etc.

Re:Learning Algorithms by mdp2021 on Sunday August 13, 2023 @03:26AM (#37107503)
Let us rephrase it as

"be balanced". (Do not disregard the other sides, work on all dimensions.)

Re:Learning Algorithms by eachro on Saturday August 12, 2023 @07:25PM (#37105131)
Leetcode is actually quite good for this. You can find problems to do by topic and the process of doing the easy -> medium problems will get you pretty far in the way of the standard topics (greedy, dynamic programming, divide/conquery, graph search, fundamental data structures and so on).
Re:Learning Algorithms by deprecative on Sunday August 13, 2023 @12:24AM (#37106653)
Anecdotal in the other way, Leetcode didn't help me at all trying to learn anything. If I knew algorithms and all that went with it/them I'd probably be able to get something out of those exercises.
Re:Learning Algorithms by rg111 on Sunday August 13, 2023 @12:17PM (#37111297)
Best beginners' Discrete Math MOOC I have ever seen: https://youtube.com/playlist?list=PLEAYkSg4uSQ2Wfc_l4QEZUSRd...
Re:Learning Algorithms by colesantiago on Saturday August 12, 2023 @05:05PM (#37104219)
Are there any startups doing or requiring complex or exotic algorithms these days to solve unique engineering problems?

Would really love to know to see different and various use cases.

Re:Learning Algorithms by zelphirkalt on Saturday August 12, 2023 @07:35PM (#37105180)
Can anyone recommend a book, that deals with purely functional algorithms? I already have "Purely Functional Data Structures" by Okasaki, which I began working through, but still have a long way to go. However, it is about data structures, not about algorithms, strictly speaking.

Perhaps there is a book for algorithms that does it the functional way? Probably a lot of it comes down to naive versions of algorithms using functional data structures and then some changes in the algorithms due to optimizing for functional data structures?

Re:Learning Algorithms by stathibus on Saturday August 12, 2023 @08:51PM (#37105568)
There is a good reason this book doesn't exist.
Re:Learning Algorithms by the_sleaze9 on Saturday August 12, 2023 @08:53PM (#37105579)
Do tell
Re:Learning Algorithms by paedubucher on Sunday August 13, 2023 @02:57AM (#37107339)
I haven't read it, nor do I own it, but "Algorithm Design with Haskell" might fit: https://www.cambridge.org/core/books/algorithm-design-with-h...
Re:Learning Algorithms by anoy8888 on Saturday August 12, 2023 @11:52PM (#37106528)
Don’t forget to try out Pharo which is modern small talk
Re:Learning Algorithms by paedubucher on Sunday August 13, 2023 @08:36AM (#37109381)
Maybe for the next project; together with Haskell.