Prabhdeep Singh has Published 197 Articles

JavaScript Program for Markov Matrix

Prabhdeep Singh

Prabhdeep Singh

Updated on 30-Mar-2023 11:40:36

101 Views

A matrix is a kind of 2-D array, which is in the form of some number of rows, and for each row, there is the same number of columns and by the row and column number, we can get the element at any particular index. For the Markov matrix, each ... Read More

JavaScript Program for Longest Subsequence of a Number having Same Left and Right Rotation

Prabhdeep Singh

Prabhdeep Singh

Updated on 30-Mar-2023 11:37:09

130 Views

We will implement a code to find the longest subsequence of a given number that has the same left and right rotation in the JavaScript programming language. The left and right rotation of a given number means, for left rotation we have to move the left-most digit of the number ... Read More

JavaScript Program for Left Rotation and Right Rotation of a String

Prabhdeep Singh

Prabhdeep Singh

Updated on 30-Mar-2023 11:36:01

686 Views

Left rotation of a string means anti-clockwise movement of the given number of characters from the prefix side and add them to the suffix side. Similarly, right rotation of a string means clockwise movement of the characters of the given string but just opposite of the left rotation and given ... Read More

JavaScript Program for the Least Frequent Element in an Array

Prabhdeep Singh

Prabhdeep Singh

Updated on 30-Mar-2023 11:33:39

423 Views

In this program, we are given an array of integers or elements and we have to return the element which presents the least numbers of the time in the array, and if there is more than one least frequent number present we can return any one of them which we ... Read More

JavaScript Program for the Last duplicate element in a Sorted Array

Prabhdeep Singh

Prabhdeep Singh

Updated on 30-Mar-2023 11:31:04

239 Views

In this program, we are given a sorted array with duplicate elements and we have to traverse the for loop and return the index of the last duplicate element present in the array and also the duplicate number, which is going to see in the article below. Introduction to Problem ... Read More

JavaScript Program for Inserting a Node in a Linked List

Prabhdeep Singh

Prabhdeep Singh

Updated on 24-Mar-2023 11:20:16

430 Views

Linked lists are data structures with varying lengths and any node can be deleted or added to the linked list. In this tutorial, we are going to implement a complete program for inserting a node in a linked list with space and time complexity. Let’s first understand the problem statement. ... Read More

JavaScript Program for Frequencies of even and odd numbers in a matrix

Prabhdeep Singh

Prabhdeep Singh

Updated on 24-Mar-2023 11:19:11

94 Views

In this tutorial, we will implement a JavaScript program for finding the frequencies of even and odd numbers. We will be given a 2D matrix that is the size of MXN and we have to find the frequencies (means the count of element present) of all odd and even numbers ... Read More

JavaScript Program for Finding the Length of Loop in Linked List

Prabhdeep Singh

Prabhdeep Singh

Updated on 24-Mar-2023 11:01:48

92 Views

In this program, we will be given a linked list that may consist of a loop and we have to find if the loop exists then what will be the size of the loop. Let’s a very famous approach to finding the length of a loop with the help of ... Read More

JavaScript Program for Finding Length of a Linked List

Prabhdeep Singh

Prabhdeep Singh

Updated on 24-Mar-2023 10:56:47

238 Views

A linked list is a linear data structure that can be a variable length and the length of the linked list can be changed, which was a problem in the array that the length of the array cannot be changed. In this article, we are going to find the length ... Read More

JavaScript Program for Finding Intersection of Two Sorted Linked Lists

Prabhdeep Singh

Prabhdeep Singh

Updated on 24-Mar-2023 10:53:38

149 Views

In this program, we are given two linked lists and we have to create a new linked list that will contain all the elements which are common in both of the lists as the lists are given sorted then we can use the concept of two pointers which are going ... Read More

Advertisements