
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 10483 Articles for Web Development

20K+ Views
To find area of a circle using javascript, we will be using simple formulae of calculating the area of circle. The formula used is: Area = π × r² where r is the radius and π is a constant value pi. In this article, we are having radius of the circle and our task is to find the area of the circle using JavaScript. Example let radius = 10 and π(pi) = 3.1415926535 Area = π × r² Area= 3.1415926535 * 10 * 10 Area= 314.15926535 Steps to Find Area of Circle ... Read More

9K+ Views
To find the area and perimeter of a rectangle in JavaScript, we will be using the basic formulas for the perimeter and area of a rectangle. The area of a rectangle is the multiplication of its length by its breadth, and the perimeter of a rectangle is the sum of the lengths of all its four sides. In this article, we are going to understand the formula for the area and perimeter of a rectangle, how to find them using JavaScript, and implement practical examples for this. Understanding the Formulas The formulas for the area and perimeter of a ... Read More

526 Views
In this article, we will learn to find three numbers in an array that add up to a given sum value using JavaScript. We are going to write a JavaScript program to find a triplet that sums up a given value. This program will make use of nested loops to iterate over the input array and check for the existence of a triplet with a sum equal to the given value. We'll present two different approaches and analyze their implementations. Sorting and Two-Pointer Technique The first approach uses sorting and the two-pointer technique to solve the problem efficiently. This method ... Read More

318 Views
We will be writing a JavaScript program that finds a triplet where the sum of two elements equals the third element. This program will be implemented using arrays and loop structures. We will be iterating through the array and checking for each element if the sum of two elements equal to the current element. If we find such a triplet, we will immediately return it. This program will be helpful in various mathematical computations where we need to find such triplets that follow a specific rule. Approach Here is one approach to solving the problem of finding a triplet such ... Read More

418 Views
To efficiently compute sums of diagonals of a matrix, we will be discussing two different approaches. We will calculate the sum of the elements present in the left-to-right and right-to-left diagonal i.e primary and secondary diagonal respectively. In this article we are having a square matrix, our task is to write a JavaScript program to efficiently compute sums of diagonals of a matrix. Example Input: Matrix: [[1, 2, 3], [4, 5, 6], [9, 8, 9]] Sum of primary diagonal elements = 1+5+9 Sum of secondary diagonal elements = 3+5+9 Output: Sum of ... Read More

305 Views
We will be implementing a function to delete nodes in a linked list which have a greater value on their right side. The approach is to traverse the linked list from right to left and keep track of the maximum value encountered so far. For each node, we will compare its value with the maximum value and delete the node if its value is less than the maximum value. This way, all the nodes with values greater than the maximum value on their right side will be deleted. Approach The approach to delete nodes which have a greater value on ... Read More

230 Views
We will be writing a JavaScript program to delete alternate nodes of a linked list. We will be utilizing a while loop to traverse the linked list while keeping a track of the current and previous node. In each iteration of the loop, we will be skipping the current node and linking the previous node directly to the next node, effectively deleting the current node from the list. This process will be repeated until all the alternate nodes have been deleted from the linked list. Approach Traverse the linked list from head to end. For every node, store ... Read More

446 Views
In this article, we will learn to count triplets with a sum smaller than a given value in JavaScript. Triplets in an array whose sum is less than a provided number is a popular problem in competitive coding and algorithm design. Problem Statement Given an array of integers and a target sum, we need to find the number of triplets (a, b, c). For exampleInput const arr = [5, 1, 3, 4, 7]; const sum = 12;Output 4 Explanation: The valid triplets are :(1, 3, 5)(1, 3, 4)(1, 4, 5)(1, 3, 7), all having a sum of less than 12. ... Read More

280 Views
We are going to write a program in JavaScript that counts the number of rotations of a given number which are divisible by 10. We will loop through the rotations of the number and check if each one is divisible by 10. If a rotation is divisible, we will increment our count. In the end, we will return the count as the result of our program. This program will be useful in various applications as it provides a simple solution to check the divisibility of a number by 10. Approach The approach to solve this problem is as follows − ... Read More

167 Views
We will be writing a program to count the number of rotations required to sort an array in non-increasing order. The program will use a loop to traverse the array and keep track of the maximum element found so far. When a smaller element is found, we will increment the rotation count and update the maximum element. In the end, the rotation count will be returned as the result of the program. This program will help us efficiently sort the array and determine the number of rotations required to achieve a non-increasing order. Approach The approach to counting rotations required ... Read More