How can I get better at JavaScript algorithms?

How can I get better at JavaScript algorithms?
0

#1

I’m looking to get better at algorithms. I’m struggling with the algorithms challenge and have yet to get one completely correct without looking at the answers. I’ve been advised to start practising math problems and playing chess etc. but I’m not sure where to start. Thanks in advance.


#2

I suggest not peeking - instead ask questions about a specific problem on the forum - you will get hints and suggestions for every stage right from how do I start tackling this problem


#3

First, break down the problem into smaller problems (try to go as small as you can conceptually). Naturally, it helps to know what is available in the language (if this is for FCC algorithm challenges, they usually give hints as to useful methods and functions in the sidebar).

Then, try writing the whole process out. You can do this in steps:

  1. Flowchart
  2. Pseudocode
  3. Real JavaScript

The only step you’ll need to worry about syntax for is step 3. Once you get to that point, it will be a lot of Googling: for example, Googling split string into array every space js will help you find exactly what you need (the split() string method).


#4

Just check these algorithms solving sites:

Hope it would help


#5

I’l make sure to look into them right away. Thanks.


#6

Thank you. I’ll do my best to keep this in mind.


#7

as above. do it urself. dont worry, algo’s take a LOT of time.
maybe run codecademy js another time. i did both js and jQ there 2 times. or do the codeschool stuff. it has lots of js, and i thought it to be very good.


#8

I think one of the most important things, like others have said, is to break the problem down into smaller parts.

WHEN you do this, see if you can identify what you really understand and can solve, what you kinda understand, and any parts that are new concepts that you have never been introduced to.

I went through a 9 month bootcamp and wasn’t really exposed to algos, and had trouble solving the most basic code wars problems.

I had a horrible whiteboarding session where I embarrassed myself and the next day started from square 1 with bubble sort and basic recursion. I spent several days watching tutorials, memorizing how the code was written in those tutorials and writing them from memory over and over again, while reading the code aloud to myself.

Doing this had an unintended but welcome benefit. My mind started to to think logically, mathematically, and I was able to reason about and solve problems I had never seen before.

I don’t know what your math background is, but mine is weak. Almost failed Algebra 1 and 2 in HS and scraped by in College Algebra and that was back in the 90’s, early 00’s.

I had a flabby math brain that wasn’t dumb, it was just out of shape and had never really been to the gym.

I guess what I’m saying is that if you keep at it, you get it Even just the fact that you are here seeking help means you are in the process of transforming your brain and learning aptitude.


#9

Thanks for the advice. Do you by any chance have any videos in mind?