(Disclaimer: code will be written in Javascript.)
Hello there! In this article, we are going to walk through the question of “Minimum Depth of Binary Tree”. This question is not as popular as medium level questions, like “Binary Tree Level Order Traversal”. BUT! this question is a good way to get introduced to one of the common topics: traversing a binary tree with Breadth-First Search (BFS) (Note: I am aware that this is not the most optimized solution. Recursion has faster time complexity, compared to using BFS).
As of April, I am approaching to the 6-month mark since I’ve first learned ReactJS. I am currently preparing for any possible ReactJS interview questions and realized there are a lot I don’t know! I thought this would be a fun way for both you and I to learn React through some fun quizzes. Let’s get to it!
Q1. What is Reconciliation?
A. The process through which React deletes the DOM.
B. The process through which React updates and deletes the component.
C. It is a process to set the state.
D. The process through which React updates the DOM.
…
(Disclaimer: The code will be written and explained in JavaScript. I am no artist, so I don’t know the best tool to draw on computer and I will post my hand-drawn graphs in this article.)
Table of Contents:
Longest Substring Without Repeating Characters
Given a string s
, find the length of the longest substring without repeating characters.
Example 1:
Input: s = "abcabcbb"
Output: 3
Explanation: The answer is "abc", with the length of 3.
Example 2:
Input: s = "bbbbb" Output: 1 Explanation: The answer is "b", with…
If you haven’t checked out Part 1 where we discussed about slice()
and splice()
, click here!
Substring. Substr. Like seriously? What’s the deal? The latter word spells without the “-ing.” Did JS creators not like the gerund? I was very confused. As I read more, I finally understood the difference and I decided to write this article to break down the differences between the two. We would also compare to slice()
(which we discussed in Part 1 — Yes, I am self promoting lol).
substring()
and substr()
are used when you would like…
Array and string are the most basic things you would find in tech interview (especially for entry level). I have encountered a few of array-and-string-related questions in online assessments. The most common way of dealing these questions is using either slice
, splice
, substr
or substring
. I chose this topic for this article is because I constantly found myself in a position that I still have to Google all these methods one by one until I figure out how to use them. If you are reading this article, I’m sure you are probably in my position as well.
Studying is not easy. It is already not easy to study (and GRADUATE!) from college, but studying for a tech interview… it’s like that determines your future and your ultimate opportunity to work for the company… Just kidding, don’t let that ruin your confidence, you always learn from the mistakes and that’s how we grow. Anyways, I was studying some frontend questions. I have learned HTML5 for quite a while, but most of the time I still have to Google for the particular code. I came across some study guide some time ago and I was surprised how much I…
(Disclaimer: Prior Knowledge to Linked List is required for this article and the codes will be written in Javascript.)
I spent my last two weeks learning linked lists. I’ve gotta say after struggling with sorting algorithms (those bubble, insertion, merge, just — aaaahh), I found linked lists is so much easier to grasp. I will go back to sorting algorithms eventually. At this moment, I am living in the bubble of linked list (hats off to sorting algorithms🎩).
Table of Contents:
Before…
I have learned Javascript for several months, but I still could not differentiate null
and undefined
. This may sound silly, I know. So, in this article, I decided to dive deep the differences between the two.
Before we start, we have to understand the 7 primitive data types:
And there are 6 common known falsy values in Javascript(full list), which are:
false
0
and -0
(Also 0n
and -0n
)string
values: “”
, ''
, ``
null
(the absence of any value)undefined
NaN
— not a numberAs we…
I successfully deployed my website for the first time a month ago, but it took me a whole week to figure out, as I encountered a lot of problems along the way. I would walk through all the steps depends on your need. I will also provide a content page, so you can guide yourself to respective guide.
Before we start:
Full Stack Web Developer. Flatiron School + Recent College Graduate in Sociology. Snoopy. Iced Vanilla Latte. Sitcoms. Wannabe Solo Traveler. Avid Googler.