Understanding (luv’n) JavaScript thru Data Structures & Algorithms (DS & A)

Toni T Diep
3 min readDec 31, 2021

Bit by bit is the process space and time complexity should be more assessible when in a hurry, we want to already learn and execute the baddess lines of code without first recognize the brute force solutions.

What does it mean to solve problems, in the manner of brute force? Brute force allows us to graciously without judgment solve a problem, in possible ways, to reach the same answer. between each brute force approach with solving problems on CodeWars, Leetcodes, and HackerRank , just to came a few. I am sharing what works and my processes with learning DS & A, in hopes someone does not have to struggle as much and do not forever develop a new disdain for math and programming. I got links to resources that aid in cemeting the learning processes, so good luck folks — you got this!!

https://www.bigocheatsheet.com/pdf/big-o-cheatsheet.pdf

At the end of bootcamp, I scrambled and immersed myself into DS & A without any reservation that it will take myself a journey to having everything click for myself — it is coming along — short answer is to understand the business logic per writing code by assessing their space and time complexity. The vernacular in business logic denotes a high level or effectively way to execute algorithms that is not time and space consuming, whichis costly and expensive — we do not want that. HOWEVER, I DISGRESS. I allow myself to solve it in “brute force” or what came naturally from a culmindation of self-studying and working in groups, in your chosen programming language. I have done this in JavaScript, which I have learn to enjoy thoroughly. From here I was able to see the parallels in logic to the syntax of Python and Java — which I felt is impressive — for one considering making that switch to a new language and/or pickingup another one.

https://www.bigocheatsheet.com/pdf/big-o-cheatsheet.pdf

Tips and Tricks
• Sounds archaic — but pseudocode how to solve the problem per instructions request — read it over and last all your questions, in your interview.
• JavaScripts syntax: I started clicking onto all the JS Array Methods to give myself tools and options when solving array algorithm problems
• Google for clarity your those blogs and video tutorials — it is okay to find few content creators or a couple, that concisely breakdown the problems.
• Recognize and honor your learning style.
• Working through CodeWars and Leetcodes actually helps reinforce syntax usage and refactoring in JavaScript.
• When you are ready to see the solutions, view it objectively without the judgment that you are not quickly picking up the material.
• In turn, I started recognizing patterns in algorithms and when we use certain operations, in loops, nested loops and constant operations/time/approach.
• DS/A problems actually help me appreciate and learn JavaScript built-in methods as we still need to know that they exists when referencing them.

Calculating how to factor in time and space complexity. https://www.bigocheatsheet.com/pdf/big-o-cheatsheet.pdf

Best of luck y’all. I am sure we will have to address time and space complexity at some point in our careers. To paraphrase this idea: “we can eat the entire elephant all at once” so step by step or bit by bit, we will reach those milestones. Thank you for reading.

Happy coding. Clap if you like the read.

Resources
• “Big-O Algorithm Complexity”.
• “JavaScript Array References”. w3schools.com
• Lim, Changmin. “Big-O Notation for beginners”. Medium.com
• “MDN Web Docs”. https://developer.mozilla.org/
• “JavaScript Algorithms and Data Structures Masterclass.” udemy.com (I purchased this course)

--

--

Toni T Diep

multilingual Software Engineer, always learning and growing.