Aishwarya Mani Tripathi

Aishwarya Mani Tripathi

18 Articles Published

Articles by Aishwarya Mani Tripathi

18 articles

JavaScript program for Mean of range in an array

Aishwarya Mani Tripathi
Aishwarya Mani Tripathi
Updated on 15-Mar-2026 637 Views

Given an array of numbers and a range, the goal is to calculate the mean of all the numbers within that range. This problem can be approached in various ways, but in this tutorial, we will explore a simple and efficient solution using JavaScript. Before we begin, let's define what we mean by "mean". In mathematics, the mean (also known as the average) is calculated by adding up all the values in a set of numbers and then dividing the sum by the number of values. In the context of an array, the mean of a range of values ...

Read More

JavaScript Program for Merging Two Sorted Linked Lists Such That Merged List Is in Reverse Order

Aishwarya Mani Tripathi
Aishwarya Mani Tripathi
Updated on 15-Mar-2026 396 Views

In this tutorial, we will learn about the JavaScript Program for merging two sorted linked lists such that the merged list is in reverse order. We will first understand the problem statement with some examples. Then we will go through a step-by-step approach to solve this problem, including creating a function that takes in two linked lists as arguments and returns the merged list in reverse order. We will also discuss different approaches and their time complexity to help you choose the most efficient solution. Problem Statement We have two linked lists sorted in increasing order and our ...

Read More

JavaScript program for Minimum move to end operations to make all strings equal

Aishwarya Mani Tripathi
Aishwarya Mani Tripathi
Updated on 15-Mar-2026 399 Views

There are many problems that require a certain level of expertise and creativity to solve. One such problem is determining the minimum number of moves required to make all strings equal. In this article, we will explore how to solve this problem using JavaScript programming. First, let's define the problem. Problem Statement Given an array of strings, we need to find the minimum number of moves required to make all strings equal. In a move, we can move the first character of a string to the end of the same string. Example Consider the following array ...

Read More

JavaScript Program for Rotate the matrix right by K times

Aishwarya Mani Tripathi
Aishwarya Mani Tripathi
Updated on 15-Mar-2026 346 Views

The term "perform right rotation on a matrix" refers to shifting each column in the matrix to the right. This operation is repeated "k" times when specified. In other words, it's a right shift of the matrix that occurs "k" times. This program can be implemented using various programming languages but a simple yet effective approach is to consider JavaScript for rotating the matrix right by k times. How to rotate the matrix right by K times? It is straightforward to carry out a right rotation on a matrix by k times, which involves shifting each column of ...

Read More

JavaScript Program for Search an element in a sorted and rotated array

Aishwarya Mani Tripathi
Aishwarya Mani Tripathi
Updated on 15-Mar-2026 454 Views

When an array is sorted in ascending order and then rotated by some pivot point, it becomes challenging to search for an element using traditional search algorithms. As a developer, you need to find an efficient solution to this problem. In this article, we will guide you through the process of writing a JavaScript program to search for an element in a sorted and rotated array. We will explain the underlying logic and provide you with a step-by-step approach to implementing this program. Problem Statement Before we begin, let's understand the problem statement. We have a sorted ...

Read More

JavaScript Program for Searching an Element in a Linked List

Aishwarya Mani Tripathi
Aishwarya Mani Tripathi
Updated on 15-Mar-2026 686 Views

To search for an element in a linked list, we need to go through each node one by one and check if its value matches the target element. If we find the element, we return its position in the list. If not, we return a message saying the element is not found. In this article, our task is to implement a JavaScript program that searches for a specific element in a linked list and returns its position if found, or a message if it is not present. Example Let's look at the below examples: Linked ...

Read More

JavaScript program for Shortest Un-Ordered SubarrayJavaScript program for Shortest Un-Ordered Subarray

Aishwarya Mani Tripathi
Aishwarya Mani Tripathi
Updated on 15-Mar-2026 191 Views

The problem statement requires finding the shortest un-ordered subarray in an array of integers. In other words, we need to identify the smallest subarray in which the elements are not sorted in ascending or descending order. This problem can be solved through various approaches, but in this article, we will discuss a simple and efficient solution using JavaScript. So first we will start by defining what an un-ordered Subarray is, then understand the problem statement in detail and then proceed to explain the step-by-step solution using examples and code snippets. By the end of this article, you will have ...

Read More

JavaScript program for Sort the given matrix

Aishwarya Mani Tripathi
Aishwarya Mani Tripathi
Updated on 15-Mar-2026 403 Views

Sorting a given matrix using JavaScript is a fundamental operation in programming. Sorting is the process of arranging the elements of a collection or matrix in a particular order. It is essential to make searching and other operations more efficient. In this article, we will discuss how to sort a given matrix using the JavaScript programming language. Problem Statement Given an n x n matrix, we need to sort all elements so that the matrix follows "strict order" - each row is sorted in ascending order, and for any row i where 1 ≤ i ≤ n-1, ...

Read More

JavaScript Program for Sorting a Linked List of 0s, 1s, And 2s

Aishwarya Mani Tripathi
Aishwarya Mani Tripathi
Updated on 15-Mar-2026 298 Views

In this tutorial, we will learn the JavaScript program for sorting a linked list of 0s, 1s, and 2s. Sorting algorithms are essential for any programming language, and JavaScript is no exception. Sorting a linked list of 0s, 1s, and 2s is a common problem that developers encounter in coding interviews and real-world applications. So, let's dive in and explore how to sort a linked list of 0s, 1s, and 2s using JavaScript programming. What is Sorting? Sorting is the process of arranging elements in a specific order, either ascending or descending. It is a fundamental operation ...

Read More

JavaScript program for Minimum Product Subset of an Array

Aishwarya Mani Tripathi
Aishwarya Mani Tripathi
Updated on 15-Mar-2026 347 Views

JavaScript Program for Minimum product subset of an array is a common problem that arises in the field of computer science and programming. The problem statement requires us to find the minimum product that can be obtained from any subset of the given array. A minimum product subset of an array is a subset of array elements that yields the smallest possible product. Several algorithms are available for identifying this subset, including dynamic programming, greedy algorithms, and branch and bound. The selection of the algorithm is determined by the particular constraints and specifications of the problem at hand. ...

Read More
Showing 1–10 of 18 articles
« Prev 1 2 Next »
Advertisements