Category: Trending
Bubble Sort Algorithm in Javascript
Bubble sort is a simple algorithm to sort a unsorted array. We will swap the the elements with the adjacent element. Please find the implementation below. References: https://www.geeksforgeeks.org/bubble-sort/ Also Please […]
Binary Search Program in Javascript
Binary Search is a technique to search a element in an array with efficient time complexity (Ologn) In binary search we divide array into halves and check if middle value […]
Find middle element in Linked List in Javascript
In this post we are going to find the middle of any Linked List . This is a very popular question ask by the interviewers . Lets start by creating […]
Create Linked List and Remove node in Javascript
Below is the program to create Linked List in Javascript. For creating a Linked List first we have to define a Node class defined below. Now we will create Linked […]
Longest Common Substring Program in Javascript
Given two strings ‘X’ and ‘Y’, find the length of the longest common substring. Input : X = “GeeksforGeeks”, y = “GeeksQuiz”Output : 5The longest common substring is “Geeks” and […]
Sort an array according to the order defined by another array in Javascript
Given two arrays A1[] and A2[], sort A1 in such a way that the relative order among the elements will be same as those are in A2. For the elements not […]
Longest Increasing Subsequence in Javascript
The Longest Increasing Subsequence (LIS) problem is to find the length of the longest subsequence of a given sequence such that all elements of the subsequence are sorted in increasing […]
Largest Sum Contiguous Subarray in Javascript
Simple Idea is to use Kadane’s algorithm is to look for all positive contiguous segments of the array. And keep track of maximum sum contiguous segment among all positive segments