Prabhdeep Singh has Published 197 Articles

JavaScript Program for Reversal algorithm for right rotation of an array

Prabhdeep Singh

Prabhdeep Singh

Updated on 12-Apr-2023 12:21:05

126 Views

Right rotation of an array means to rotate the elements of the array to their right side by a given number of times and for the number which are present at the edge they will move to the first index in their right rotation by assuming an array in a ... Read More

JavaScript Program for Reversal algorithm for array rotation

Prabhdeep Singh

Prabhdeep Singh

Updated on 12-Apr-2023 12:19:55

142 Views

An array is a linear data structure used to store the different types of objects and we are given an array of size n and an integer k (where k is the number by which we will rotate an array). We will rotate the array by k elements and then ... Read More

JavaScript Program for Removing Duplicates From An Unsorted Linked List

Prabhdeep Singh

Prabhdeep Singh

Updated on 12-Apr-2023 12:18:55

154 Views

The linked list is a linear data structure that consists of nodes, and each node is stored in memory in a non-contiguous manner. Nodes are connected by storing the address of the next node. We are given a linked list that will contain some integers in a random manner and ... Read More

Javascript Program For Removing Duplicates From A Sorted Linked List

Prabhdeep Singh

Prabhdeep Singh

Updated on 12-Apr-2023 12:17:02

236 Views

Linked list is linear data structure and we have given a sorted linked list that consists of the integers. There are some numbers that may be duplicated or repeated and we have to remove them. As the given linked list is sorted, we can simply iterate over it and by ... Read More

Javascript Program for Range Queries for Frequencies of array elements

Prabhdeep Singh

Prabhdeep Singh

Updated on 12-Apr-2023 12:15:19

90 Views

We are given an array that will contain integers and another array will be given that will contain the queries and each query represents the range that we are given by the leftmost and the rightmost index in the array and an element. For that range or the subarray, we ... Read More

Explain Class Methods in Coffeescript

Prabhdeep Singh

Prabhdeep Singh

Updated on 04-Apr-2023 11:51:39

71 Views

To understand the class methods in CoffeeScript first we need to understand what it is CoffeeScript. CoffeeScript is a lightweight programming language, and this language compiles in JavaScript and is also inspired by languages like JavaScript, python, ruby, Haskell, etc. Further, we will discuss it in detail after that we ... Read More

JavaScript Program for Maximum and Minimum in a Square Matrix

Prabhdeep Singh

Prabhdeep Singh

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

169 Views

To find the maximum or minimum element, we have to focus on the number of comparisons we are going to make and which method will be efficient to choose for comparisons: the one that compares elements with if-else statements or one which comes as in-built. We will see the complete ... Read More

JavaScript Program for Maximum Sum of i*arr[i] Among all Rotations of a Given Array

Prabhdeep Singh

Prabhdeep Singh

Updated on 30-Mar-2023 11:46:07

96 Views

In this article, we will implement the JavaScript program for the Maximum sum of i*arr[i] among all the rotations of the given array. Here i*arr[i] expression indicates that we have to maximize the sum of all the elements of the array by taking the product of them with the current ... Read More

JavaScript Program for Maximum Product Subarray

Prabhdeep Singh

Prabhdeep Singh

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

220 Views

A subarray is part of an array formed by removing some or no prefixes of the array and removing some or no suffix elements of the given array. We will try to find the subarray that will contain the elements, and by multiplying all of them, we can get the ... Read More

JavaScript Program for Maximize Elements Using Another Array

Prabhdeep Singh

Prabhdeep Singh

Updated on 30-Mar-2023 11:42:46

110 Views

In this article, we are going to implement a JavaScript program for Maximizing elements using another array. We are given two arrays and have to pick some elements from the second array and replace the elements of the first array. We will see the complete code to implement the concepts ... Read More

Advertisements