r/learnprogramming • • Oct 15 '17

500 Data Structures and Algorithms practice problems and their solutions

1.7k Upvotes

68 comments sorted by

17

u/rockyrainy Oct 15 '17

I have to find a new job. This is just what I need.

0

u/[deleted] Oct 15 '17

[deleted]

26

u/[deleted] Oct 15 '17

[removed] — view removed comment

18

u/Ayelamb Oct 15 '17

Upvoted at -1 for being a go getter.

24

u/Calypxo Oct 15 '17

Is it bad that I can't begin to figure these out? I'm still a very new Java Programmer but I'm afraid of being unable to learn.

19

u/[deleted] Oct 15 '17

No its not. Everyone had knowledge gaps and that's fine. This kind of stuff gets easier the more you do it. Getting your foot in the door is hard, but it does get easier

7

u/MoltenCookie Oct 15 '17

Take it easy and relax. Everyone starts off not being able to solve these kinds of questions because they are different from the types of problems you'd expect in high school. Just be willing to learn how to approach these problems from an analytical perspective after you've done your homework on data structures and algorithms

4

u/[deleted] Oct 15 '17

Maybe take a step back: try to plot out the algorithm you'd use to do it, even if you don't know how to make a computer do it yet.

I have no shame in admitting that I can't do any of these in Java either.

2

u/HotBunnz Oct 15 '17

As a non-programmer, I took a look at this to see if my logic input coincided with the answer descriptions. Extremely interesting to watch how these decisions affect program viability.

4

u/Feel_Free_To_Downvot Oct 15 '17

At first they really look scary but more you spend time with them more familiar you will become and start making sense of them. My advice would be take it slowly and rush.

Also, one thing with data structures and algos is that in the beginning they seem like useless, archaic concepts or only useful for job interviews.

Truth is down the road, when you move from trivial tasks and more advanced topics become concern, algos will come very handy.

-16

u/[deleted] Oct 15 '17 edited Oct 15 '17

[removed] — view removed comment

34

u/Makishanuto Oct 15 '17

Careful, don't enter codeabby.com. That's a phishing site and will try to install malicious extensions.

http://codeabbey.com

9

u/errorseven Oct 15 '17

Good catch, its late.

4

u/rockyrainy Oct 15 '17

Pretty cool site.

12

u/figurehe4d Oct 15 '17

Thanks. I've been looking for something like this.

5

u/Star_forsaken Oct 15 '17

At what stage of my learning process should I be able to attempt something like this? I just started arrays in java last week.

6

u/Rorixrebel Oct 15 '17

Probably work on the basics more first

5

u/mojohn89 Oct 15 '17

Commenting cause i couldnt find the save button on mobile

8

u/rickbreda Oct 15 '17

On the official Android app it is a ribbon-looking icon on the top right of the screen

10

u/old_dog_new_trick Oct 15 '17

Huh. TIL how to save posts on the mobile app. Many thanks.

4

u/FlamingoOverlord Oct 15 '17

Username checks out

2

u/BorderPatrick Oct 15 '17

Thank you for sharing!

3

u/baneofthebanshee Oct 15 '17

Definitely going to use this. Anyone know of any resources for practice problems and solutions for hash tables?

Edit: I just skimmed through OPs link, it's very possible I just missed it.

2

u/AllAboutTheKitteh Oct 16 '17

Make a lookup table. Like a dictionary or a phone book. Or make a calendar to see what dates are which days of the week.

1

u/Nexpert12 Oct 15 '17

Thank you

1

u/aaqqbb Oct 15 '17

Thanks

1

u/Xoumi712 Oct 16 '17

Um am I the only one who's getting a 403 forbidden to ALL of the problems :( ?

Edit: Suddenly working. Regardless, curious as to why this happened. Anyone ?

1

u/learnie Oct 15 '17

Thank you so much. This is a very helpful resource.

1

u/iamdeveloperr Oct 15 '17

Been looking for this because I get zero experience with this at work. Thank you

1

u/apple4lifex Oct 15 '17

Saved. Thank you!

1

u/[deleted] Oct 15 '17

Awesome

1

u/nihilismMattersTmro Oct 15 '17

Do the links work for you? I'm getting an error just now

1

u/[deleted] Oct 15 '17

It looks like the site is down/getting hugged to death

2

u/nihilismMattersTmro Oct 15 '17

ah yes... I had suspected the reddit hug. It was a pretty heavily upvoted content piece.

I'll surely save it for later viewing though... sounds like good stuff

0

u/gigabyteIO Oct 15 '17

Nice thank you

0

u/[deleted] Oct 15 '17

[deleted]

26

u/Dark_Ice_Blade_Ninja Oct 15 '17

>sidebar material
>quora

Does not compute

11

u/OmniscientOCE Oct 15 '17

I used to like Quota but now it's mostly just junk it feels like

4

u/[deleted] Oct 15 '17

It may be the first site I've seen where the comments would get better if they removed all the people who have written a book

2

u/OmniscientOCE Oct 15 '17

Holy shit yes

6

u/salaTechie Oct 15 '17

Right? I quit quora a month back. Bullshit question and answers spammed my homepage

2

u/Erestyn Oct 15 '17

"What is Donald Trump's favoured programming language?"

With the top answer being about how a friend of a friend once ate dinner with him, he was indecisive, but they happen to be writing a book based on the experience.

Every time I think about quitting there's an interesting question that keeps me hanging on for another week.

1

u/OmniscientOCE Oct 15 '17

And then they promote their blog or book or something. So many people promoting themselves or pushing something on there

1

u/[deleted] Oct 15 '17

I don't use it but I've seen it quite a bit lately and often it's spam bots.

1

u/Hari_a_s Oct 15 '17

I faced the same problem until I started following around a 100 topics and 100 writers.. the content became relevant to my interests.

-1

u/Hari_a_s Oct 15 '17

I faced the same problem until I started following around a 100 topics and 100 writers.. the content became relevant to my interests.

1

u/[deleted] Oct 15 '17

Too many Indians on Quora spamming and posting pathetic-quality answers everywhere.

0

u/[deleted] Oct 15 '17

[deleted]

390

u/[deleted] Oct 15 '17

[removed] — view removed comment

80

u/_lettuce_ Oct 15 '17

It's one of those actions that makes you feel like you are actually accomplishing something, like buying a difficult book never to touch it again or making eye contact with an attractive person without talking with her/him.

23

u/AirieFenix Oct 15 '17

making eye contact with an attractive person without talking with her/him

That makes me feel sad actually. Specially if it's a girl.

7

u/trakam Oct 15 '17

How hard is it to swipe right?

10

u/AirieFenix Oct 15 '17

Don't both persons need to swipe right?

12

u/[deleted] Oct 15 '17

Screw that. I'm digging through this to see if I can find something useful.

...

Fk. What are some of these..?!

10

u/[deleted] Oct 15 '17

This hits too close to home.

2

u/[deleted] Oct 15 '17

RemindMe! 3 months. "Did you actually try to solve some of these problems?"

2

u/RemindMeBot Oct 15 '17 edited Jul 08 '18

I will be messaging you on 2018-01-15 18:40:25 UTC to remind you of this link.

9 OTHERS CLICKED THIS LINK to send a PM to also be reminded and to reduce spam.

Parent commenter can delete this message to hide from others.


FAQsCustomYour RemindersFeedbackCodeBrowser Extensions

2

u/Erestyn Oct 15 '17

And in a day or twos time you'll be sat at home thinking "I know I was supposed to solve something..."

2

u/brandonk96 Oct 15 '17

I saved this post then immediately saw this comment

1

u/[deleted] Oct 16 '17

Challenge Accepted.