Web Development Articles - Page 106 of 801
572 Views
To find the length of a linked list in JavaScript, we need to count how many nodes are present. A linked list is made up of nodes, where each node contains data and a reference to the next node. The length is determined by starting at the head and counting each node until the end of the list. If the list is empty, the length should be 0. Our task is to write a JavaScript program that calculates the length of a linked list . In other words, we need to find out how many nodes are in the ... Read More
208 Views
In this article, we are going to implement a JavaScript program for finding a triplet from three linked lists with a sum equal to a given number. This problem is a kind of variation of the standard and famous three-sum problem but in a linked list manner. Let’s see the problem and implement its code along the key points of the problem. Introduction to Problem This problem is the variation of the standard problem of three sums where we are given three arrays and we have to find if there is any triplet present in the array with a sum ... Read More
488 Views
Counting sets of 1s and 0s in a binary matrix can be achieved using nested for loop with conditional statement. A binary matrix is a matrix that consists of only two digits as its name suggests and those two digits are 1 and 0. In this article, we are having a 2D binary matrix having 0 and 1 only. Our task is to write a JavaScript program for counting the sets of 1s and 0s in a given binary matrix. Formula: Let us a consider a set as {a, b} having 2 elements i.e, n = 2. Total number ... Read More
2K+ 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 we are having an array with duplicate elements, our task is to count frequencies of array elements in JavaScript. Users must be familiar with array and it's functions, JavaScript methods and function, loops, conditional statement and Javascript objects. Approaches to Count Array Elements Frequencies Here is a list of ... Read More
4K+ Views
Prime numbers are numbers that have exactly two perfect divisors. We will see two methods to find the number of prime numbers in a given range. The first is using the brute force method and by this method time complexity is a bit high. Then we will improve this method and will go for the Sieve of the Eratosthenes algorithm to go with better time complexity. In this article, we are going to find the total number of prime numbers in the given range using the JavaScript programming language. Brute Force Method In this method first, we will learn how ... Read More
209 Views
In this article, we will go through a JavaScript program to check whether all the rotations of a given number are greater than or equal to the given number or not. We will write an algorithm and explain every step that what we are doing. The time complexity of the code that is going to discuss will be optimistic and space complexity will all be improved from one code to another. Introduction to Problem In the problem, we are given a number and we have to check for each rotation whether they all are greater than the current number or ... Read More
480 Views
The basic structure of a Linked List in JavaScript can be created using the class in JavaScript and then the movement of the nodes from one position to another can be done for rotation. In this article, we will learn how to rotate a linked list in a clockwise manner in JavaScript programming language. We will see the code for understating the concepts in deep. In the given problem we have given a linked list and we have to rotate it in a clockwise manner. This means, we have to put the last element in first place in every move ... Read More
803 Views
Snack is an open-source Expo platform where React Native programming is done and the results can be seen instantly. It compiles and builds the bundle for execution on different types of devices or for Android , IOS or web. The code can be saved and shared quickly on Snack. As the user types the code, the library installation links are given by this interface to the user. Snack is a nice and quick to use platform which makes learning of React native easy for beginners. The user doesn't need to install anything. Just SignUp and then login to your expo ... Read More
421 Views
Memoization is a helper function, or we can say a technique for improving the efficiency of a program by Keeping track of the values that the function has already calculated in the past. In this article, we will discuss the Memoization Helper function with different examples and discuss all the examples in detail so that we can get a better understanding of Memoization. Now let’s discuss the Memoization helper function in the deep in the below section and also see their implementation with an explanation. Introduction to Memoization Helper Function Memoization is a technique of programming that is used to ... Read More
338 Views
Backbone.js is helping us to organize the JavaScript as it is a compact library. And HTTP is referred to as HyperText Transfer Protocol which helps us to connect the web server over the internet. First, we need to discuss the Backbone.js, HTTP protocol, and HTTP request for a clear understanding of HTTP requests in Backbone.js. In the below section we have discussed all after that we go towards the HTTP Request in Backbone.js with working of the HTTP Request and also examples. And in the end, we conclude the whole article. In this article, we are going to discuss the ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP