Found 10483 Articles for Web Development

How to Change Image Source URL Using AngularJS?

Aayush Mohan Sinha
Updated on 13-Apr-2023 15:30:40

1K+ Views

AngularJS is a prevalent and potent framework for creating the front-end of web applications, enabling developers to produce dynamic and interactive web pages with great ease. An essential aspect of AngularJS is the capability to modify HTML elements and their characteristics dynamically, offering greater flexibility and customization to developers. One such conventional circumstance is dynamically altering the source Uniform Resource Locator (URL) of an image, which can be highly advantageous in diverse web-based programs. In this scholarly composition, we shall delve into the methodology of modifying the image source Uniform Resource Locator (URL) using AngularJS, and ascertain how to utilize ... Read More

JavaScript Program To Add Two Numbers Represented By Linked Lists- Set 1

Prabhdeep Singh
Updated on 04-May-2023 11:02:09

263 Views

Adding two numbers is an easy task but could be tricky if the numbers are given in the form of the linked list. Each node of the linked list contains the digit of the number it represents in a continuous manner from the first node to the last node. We will be given two linked lists representing two different numbers and we have to add them and return the third number in the form of a linked list. Input 1 -> 2 -> 3 -> null 3 -> 2 -> 4 -> null Output 4 -> 4 -> 7 ... Read More

JavaScript Program to Check horizontal and vertical symmetry in binary matrix

Alshifa Hasnain
Updated on 20-Dec-2024 11:33:30

498 Views

In this article, we will learn to create a program to check both horizontal and vertical symmetry in a binary matrix in JavaScript. A binary matrix is a 2-D array that consists of one and zero only as the elements in each cell. Horizontal symmetry of a binary matrix means if the first row is the same as the last row, the second row is the same as the second last row, and so on. What are symmetry matrices?  Symmetry in matrices refers to how the values in the matrix mirror themselves along an axis. In the case of a ... Read More

JavaScript Program for Writing A Function To Get Nth Node In A Linked List

Prabhdeep Singh
Updated on 04-May-2023 10:58:19

202 Views

Linked list is a linear data structure and all the nodes are connected to each other by storing the address of the next node. To find the nth node in a linked list means to get the value present at the nth node of the given linked list and that can be done by two methods that are iterative and recursive method. Example Given linked list: 1 -> 2 -> 3 -> 4 -> 5 -> 6 -> null Node to find: 3 Output 3 Explanation: The value present at the third node is 3. Iterative Approach ... Read More

JavaScript Program to Check if Strings are Rotations of Each Other or Not

Prabhdeep Singh
Updated on 21-Jan-2025 09:48:14

727 Views

To check if strings are rotations of each other or not, it means that two strings can be rotated to either the right or left direction to obtain the other string. In the right rotation characters of the string shift to their following index and for the zeroth index, it takes the character of the last index assuming the string is in a circle. Left rotation is similar to right rotation but in the opposite direction. In this article We are having two strings and we have to write a JavaScript program to check whether by rotating the characters of ... Read More

JavaScript Program to Check if Matrix is Upper Triangular

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

236 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 to check if matrix is upper triangular matrix. Users must be familiar with upper triangular matrix, nested for loop, conditional statement and javascript methods. Example Input: Matrix: [[1, 2, 3, 4], 0, 5, 6, 7], ... Read More

JavaScript Program to check if the matrix is lower Triangular

Prabhdeep Singh
Updated on 13-Apr-2023 15:30:14

134 Views

A matrix can be defined as a 2D array that stores elements in it and mathematically it stores the numbers in it. A Lower triangular matrix is a squared matrix that has the same number of rows and columns and all the elements that are present above the main diagonal passing from the first cell (present at the top-left) towards the last cell (present at the bottom-right) are zero. We will implement a proper code with explanation and discussion over time and space complexity. Example Input 1: mat = [ [ 1, 0, 0, 0], [ 2, ... Read More

JavaScript Program to Check if it is possible to sort the array after rotating it

Prabhdeep Singh
Updated on 13-Apr-2023 15:28:38

121 Views

Rotating an array means moving the elements of each index (excluding one end ) to the following index for the right rotation and the previous index for the left rotation. For the right rotation zeroth index takes the value of the last index and vice-versa for the left rotation. Sort an array means that all the elements are in the proper increasing order. We will implement the proper code with an explanation and time, and space complexity discussion. Example Input: 5 6 9 10 2 3 3 4 Output: Yes Explanation: We can rotate the given array 4 times ... Read More

JavaScript Program to Check if it is possible to make array increasing or decreasing by rotating the array

Prabhdeep Singh
Updated on 13-Apr-2023 15:27:24

193 Views

Rotation of the array means to assume the array as a circular array and rotate the elements of the array to either their left or right direction by one index at each rotation and the element at one end may take the value present at another end. An Increasing array means that each element will be greater than or equal to its previous element and decreasing array means each element will be less than or equal to the previous element. In this problem, we are given an array and we can rotate the array in either the left or the ... Read More

JavaScript Program to Check if all rows of a matrix are circular rotations of each other

Prabhdeep Singh
Updated on 13-Apr-2023 15:26:25

235 Views

Matrix is a kind of 2-D array in which there is an array of fixed arrays that defines the rows and for each index of this array there are fixed length arrays present and the length of these arrays defines the number of columns present in the matrix. We can store any kind of data type in these cells provided by the matrix. We will be provided with a matrix and each row contains some integers and we have to check if each row is the rotation of one another or not. Rotation of each other means by some number ... Read More

Advertisements