Ravi Ranjan has Published 148 Articles

JavaScript Program to Check if Matrix is Upper Triangular

Ravi Ranjan

Ravi Ranjan

Updated on 06-Jun-2025 19:36:38

226 Views

To check if matrix is upper triangular matrix, we check if all the elements below the main diagonal is 0. We are going to discuss two different approaches and compare their complexities. In this article we are having a 2D square matrix, our task is to write a JavaScript program ... Read More

Javascript Program to Count Pairs with Given Sum

Ravi Ranjan

Ravi Ranjan

Updated on 06-Jun-2025 19:17:34

1K+ Views

To count pairs with given sum, is a common problem asked in job interviews and is often used in many real-world applications such as cryptography and data compression. In this article we are having an array and a target sum value, our task is to write a Javascript program to ... Read More

JavaScript Program for the Third Largest Element in an Array of Distinct Elements

Ravi Ranjan

Ravi Ranjan

Updated on 06-Jun-2025 19:17:02

775 Views

For the third largest element in an array of distinct elements, we will discuss three different approaches. We will improve efficiency with each approach and discuss their complexities. In this article we are having an array of distinct elements, our task is to find third largest element in an array ... Read More

JavaScript Program for Counting Frequencies of Array Elements

Ravi Ranjan

Ravi Ranjan

Updated on 06-Jun-2025 19:16:49

1K+ Views

Counting frequencies of array elements means we have to count the number of times an element from the array appears in the given array. We will be discussing five different approaches to achieve this. We can use some inbuilt data structures or external libraries for easy implementation. In this article ... Read More

JavaScript Program to Find Common Elements in Two Sorted Arrays

Ravi Ranjan

Ravi Ranjan

Updated on 06-Jun-2025 19:16:37

489 Views

To find common elements in two sorted arrays using JavaScript, we will be discussing various approaches. Common element refers to element which is present in both the arrays. First, we will try brute force approach and then we will optimize our code to improve the time complexity. In this article ... Read More

C++ program to search an element in a sorted rotated array

Ravi Ranjan

Ravi Ranjan

Updated on 06-Jun-2025 19:16:12

1K+ Views

A sorted and rotated array is an array that is sorted in ascending order and then rotated either left or right by a specific number of elements. There should exist exactly one pivot point around which the array is rotated. The array can be said to be split into two ... Read More

Check if an array is sorted and rotated in C++

Ravi Ranjan

Ravi Ranjan

Updated on 06-Jun-2025 19:15:03

2K+ Views

A sorted and rotated array is an array that is sorted in ascending or descending order and then rotated either left or right by a specific number of elements. There should exist exactly one pivot point around which the array is rotated. The array can be said to be split ... Read More

JavaScript Program for Mirror of Matrix Across Diagonal

Ravi Ranjan

Ravi Ranjan

Updated on 06-Jun-2025 19:14:12

382 Views

To write a javascript program for mirror of matrix across diagonal, we will be discussing two approaches with their code example and explanation of code. In this article we are having a 2D matrix. Our task is to write a JavaScript program for mirror of matrix across diagonal. ... Read More

JavaScript Program to Find Lexicographically minimum string rotation

Ravi Ranjan

Ravi Ranjan

Updated on 06-Jun-2025 19:13:41

587 Views

To find lexicographically minimum string rotation in Javascript, we will understand two different approaches in this article. A lexicographically minimum rotation of a string is the smallest string that can be obtained by rotating the original string any number of times in lexicographical order. By lexicographical order it means dictionary ... Read More

JavaScript program to convert 24 hours format to 12 hours

Ravi Ranjan

Ravi Ranjan

Updated on 06-Jun-2025 19:13:26

2K+ Views

To convert 24 hours format to 12 hours in Javascript, we have discussed two different approaches. In this article we are having time in 24 hours format, our task is to write a JavaScript program to convert 24 hours format to 12 hours. Approaches to Convert 24-hours format to ... Read More

Previous 1 ... 4 5 6 7 8 ... 15 Next
Advertisements