Javascript

## Find the middle of a given linked list

The tortoise and hare algorithm is a classic algorithm to find the median of a linked list. It is named after the fable of the tortoise and the hare, where the tortoise wins by virtue of its steady pace. The algorithm works as …

## Which One Should You Choose TypeScript vs JavaScript

When it comes to choosing between JavaScript and TypeScript, there are a few factors that should be considered. One of the biggest differences between the two is that TypeScript is a superset of JavaScript so it means that it ha…

## How To Implement Own Random Number Generator In JavaScript Using LCG

The Linear Congruential Generator is a pseudo-random number generator. It is one of the simplest and most widely used algorithms of this type. It was developed by Donald Knuth in 1974 and it’s based on the linear congruential met…

## How to Generate Prime Number Using JavaScript

Prime number is a natural number that has exactly two distinct natural number divisors: 1 and itself. The first 30 prime numbers are 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47 and 53. Prime numbers are very importa…

## Important Regular Expressions Every Developer Must Know

Regular expressions are a small but powerful language that can be used to find patterns in strings. These patterns can then be used to perform tasks on the strings or extract information from them. Regular expressions are commo…

## How to write a lexer and parser in JavaScript

Lexer and Parser are two important components of compiler. Lexer is responsible for tokenizing the source code, and parser will read the tokens to build an AST(Abstract Syntax Tree). To implement Lexer and Parser in JavaScript,…

## How To Implement LRU Cache In JavaScript In 28 Lines Or Less

LRU stands for Least Recently Used. It is a cache algorithm that is used to determine which elements should be discarded from memory when the cache is full. The most basic LRU algorithm would simply check the last time a given v…

## How to implement Priority Queue In TypeScript

In a priority queue, each element has an associated priority. Elements with higher priorities are served before elements with lower priorities. In a priority queue, the element with the highest priority is served first. In Java…

## How to Implement a "Did you mean by " in JavaScript

This blog post I will show you how to implement did you mean by in JavaScript. This algorithm can be easily translated to any language like C# ,Java or python. The implementation of Did You Mean By can be done by using edit di…