r/AskProgramming • • 3d ago

Algorithms Help me please

Hey guys, I have a DSA exam in about 4 hours and I’ve just started studying. The topics are mostly beginner friendly (Bubble sort, recursion, quick sort, merge sort etc). What’s the most efficient way to study rn in order to get a pass?
(I’ve just started studying because I’ve been ill)

0 Upvotes

15 comments sorted by

10

u/codepc 3d ago

You’re cooked

-8

u/Adventurous-Heart381 3d ago

Don’t do this to me 😭

14

u/nwbrown 3d ago

The most efficient way to study is to not wait until 4 hours before the exam.

5

u/MagicalPizza21 3d ago edited 3d ago

Recursion in theory is simple: base case, recursive case. Try implementing something simple, like factorial or Fibonacci, using a recursive algorithm to get the hang of it.

Merge sort is also pretty simple: you sort an array or list by splitting it into sorted subarrays and zipping them together into sorted order. This is a recursive algorithm. Try implementing it to get the hang of it. As a bonus, since it's recursive, it'll help solidify your understanding of recursion.

Bubble sort is also pretty simple. Greater values bubble up to the top (greater indices) by swapping repeatedly with the next value in the array. Try manually implementing this to get the hang of it. Actually, do this one first since it's not recursive and the simplest of the sorting algorithms you mentioned.

Quick sort is less simple. You might have to sacrifice it for the other three. It's also recursive, like merge sort.

For all 3 sorting algorithms, manually step through examples of lists of length about 10 to really get an idea of how they work.

2

u/burlingk 3d ago

The most efficient way to study those things is to do them. So four hours is going to be a bit tough. Especially since you need time to get ready for and get TO the exam.

2

u/dutchman76 3d ago

Back in my day I'd pay attention in class and barely have to study to pass.

2

u/reboog711 3d ago

What was your day?

I found that if I attended all classes, and did all homework I'd pick up enough to pass the class. ( Mid 90s)

2

u/Bata600 3d ago

If you quickly buy and take some speed and coke there's a solid chance you will be thrown out of school and that you will fail your exams because you didn't study.
Next time take four hours to seperate the amount of words you need to read in another 10 hours and that's how you will learn something in 14 hours.
You'll probabky still fail because here we study for days/weeks begore an exam.

keep learning tho. Maybe something you learned today comes up.
If not, maybe you can skip class and take it next time? 🤷

2

u/LoudAd1396 3d ago

Ive been programming for 14 years. I dont know what "DSA" means. Good luck!

2

u/reboog711 3d ago

Data Structures and Algorithms.

Have you never had to Leetcode for a job?

2

u/LoudAd1396 3d ago

Nope!

1

u/reboog711 2d ago

Hats off to you, then! The grind makes no sense to me!

1

u/182plus44 3d ago

Data structures and algorithms

1

u/iOSCaleb 3d ago

DSA = Data Structures and Algorithms.

1

u/Personal-March-4340 3d ago

Go over any review your teacher has given. Review your lecture notes and homework and recall things that were emphasized. Everything on the exam is likely a slight variation. You have been attending school for over a decade.

I am taking a Data Structures class this term. My teacher emphasized Big-O notation and classifying algorithms into various classes. Be able to compare the data structures and which are more efficient for accessing in various ways.