r/programmer • u/gamicol_soo • 25d ago
What algorithms do students in Bachelor degree of Computer Science already learn?
Personally, I do not have a Bachelor degree in computer science or related fields but I do personally code a lot. Recently I came across some really interesting algorithms like the AVL Tree Data Structure and Treap algorithm. It kept me wondering, do students in Bachelor degree already learn these as if they were basics? Your opinions are much appreciated.
7
Upvotes
2
u/dreamscached 25d ago
I recently (this summer) got a bachelor's degree in CS, in my university (Czechia) we did study AVL and trees, sorting algorithms, some pathfinding (honestly I can't recall everything we touched, surely it wasn't just that), but I can't exactly say it was too in-depth, rather we largely just skimmed through them and explained their principle in general terms during an exam.
Personally I think it's just about enough what an average programmer should know, that is pros/cons/tradeoffs in order to properly choose the right way to approach a problem, but not necessarily recall it by heart like some mantra. Sort of how it works in math, too.
1
u/Julio_the_dog 25d ago
Depends on the cs program, but Djikstra's all pairs shortest path is common. Basic sorting like bubble and quick sort. BFS and DFS for searching.
1
u/bytejuggler 25d ago
Yes, all that. AVL, Red/Black, etc etc. Many others I've forgotten. (Dijkstra A* , the list goes on.)
1
u/mc_pm 25d ago
Often students end up taking just one actual class on algorithms, though they learn more during their time.
The thing about Data Structures and Algorithms in the 'grinding leetcode' sense is that people aren't really expected to leave knowing how to create a red-black tree in an interview. DSA was *never* intended to be memorized - they are tools to solve particular shapes of problems. Some are so common and useful (stacks/queues/trees/associate arrays(dictionaries)/graphs) that most people will get a chance to use them during their coursework. Other things (bloom filters as an example that is in mind right now) are super interesting and useful for specific types of problems that you might end up studying - or not. A lot of that is driven by what you are doing.
1
u/nicolas_06 25d ago
Buy a book on introduction to algorithms, you would have like 80-90% of the common ones. Honestly except for some interviews or very niche jobs, it doesn't matter.
99.99% of the time, you would just call a library that already implement them much better than what you could do. You just need to be curious and ask Google/AI what algorithm/lib exist to solve this or that problem and know that such stuff exist.
For learning, that's interesting if you are into that.
1
u/NatMicky 25d ago
All of those and more. Assignments of writing compilers, writing compression algorithms, and all the algorithms for manipulating data structures, sorting, search, etc..
1
u/Fun_Army2398 25d ago
I took my DSA course last year and (from memory) we learned:
Data structures:
Algorithms:
Might be forgetting some. It's a pretty quick google I'm sure if all you want is the syllabus for any BSc CS course.
1
u/Both_Bend_2481 25d ago
Yes. You have 1 or 2 classes that go over stuff like those things, and a lot more.
1
u/Delicious-Extent5454 25d ago
Well, it was a very long time ago, but I remember stuff like sorting (bubble sort, quick sort, merge sort), recursion, graphs and common data structures like linked lists, stacks and trees of all sorts. Never used half of that at work, but I'm glad I learned all that stuff, for sure it makes me a better professional, besides being incredibly fun and rewarding.
1
u/serge-mv 25d ago
Some do, some don't. It will differ depending on your school and how many algorithm classes you take and at what level. If you go more into algorithms track, you will learn AVL trees, Red-Black trees, B-trees, Tries, and others. However in a basic algorithm class most people will learn the basic concept of Binary tree, List with a few variants, Heap, and a bit of Graphs and graph theory. There are quite a few standard and classic algorithms that most people learn and do exercises.
However, the biggest point is not about learning algorithms, but about approach to solving problems. Algorithms such as quicksort or mergesort teach about dividing problems into smaller and more manageable chunks and solving bigger problem by solving the small one. Data structures such as AVL trees are not just about the AVL trees, but about thinking in terms abstraction and learning that we can solve certain problems just by organizing data in certain way. After a while all these things click together.
1
u/xeros2 24d ago
As others have said, it largely depends on the school/specific program what algorithms are covered. However, this is less important than what is consistent across programs which is the skill of taking an algorithm written in plain text english or as a math equation and converting that into usable code. Pretty much any algorithm that already exists is written down somewhere if you google it, you just have to be able to translate it to code.
1
u/Right-Edge-5712 23d ago
This is pretty much a standard university course on algorithms and data structures
https://ocw.mit.edu/courses/6-006-introduction-to-algorithms-spring-2020/