Found 8591 Articles for Front End Technology

JavaScript Program for Two Pointers Technique

Ravi Ranjan
Updated on 06-Jun-2025 12:33:05

2K+ Views

In this article we are given a sorted array, our task is to find if there exists any pair of elements such that their sum is equal to a given number. Users must be familiar with array, loop and nested loops, and if/else statement. Two Pointers Technique Two pointers technique is a commonly used algorithmic approach to solve various problems that require linear time complexity. This technique is used to find a solution for problems that involve searching, sorting, or manipulating arrays, strings, or linked lists. In this article, we are going to solve the pair sum problem using brute ... Read More

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

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

793 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 of distinct elements in Javascript. Users must be familiar with array, loops and conditional statement. Example Input: arr = [2, 5, 8, 1, 4, 10, 7] => Highest: 10, second highest: 8, third highest: 7 Output: 7 Approaches for Third Largest Element in Array ... Read More

JavaScript program for Swapping Nodes in A Linked List Without Swapping Data

Aishwarya Mani Tripathi
Updated on 17-Apr-2023 15:50:02

364 Views

JavaScript program for Swapping Nodes in A Linked List Without Swapping Data is a familiar problem in web development that involves rearranging the order of nodes in a linked list. A linked list is a data structure that consists of nodes, each containing a piece of data and a reference to the next node in the list. In this article, we will learn a complete tutorial about swapping nodes in a linked list without swapping data using JavaScript. So let’s get started by defining swapping nodes first and then we move ahead in this tutorial. So, Keep learning! Swapping Nodes ... Read More

File Upload using Angular

Nikesh Jagsish Malik
Updated on 17-Apr-2023 17:03:54

4K+ Views

This guide aims to show how to implement file uploading using Angular. File uploads are a crucial component for many websites, allowing users to transfer files from their devices to the server. Whether it be for storing user-generated content, sharing files with others, or downloading files from the server, file uploads play a significant role. Steps for File Uploading with Angular Configuring the File Upload Before diving into the actual file upload implementation, we must first set up the necessary file upload configuration. This involves specifying the server-side script URL that will handle the upload, as well as any additional ... Read More

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

Aishwarya Mani Tripathi
Updated on 17-Apr-2023 15:47:44

230 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 in computer science ... Read More

JavaScript program for Sort the given matrix

Aishwarya Mani Tripathi
Updated on 17-Apr-2023 15:45:51

303 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. Example Given a n x n matrix in a specific order known as the "strict order". In the strict order, each row of the matrix must be sorted in ascending order, and for any row i where 1 matrix[i + 1][j]) ... Read More

JavaScript program for Size of the Subarray with Maximum Sum

Aishwarya Mani Tripathi
Updated on 17-Apr-2023 15:44:08

301 Views

JavaScript program for the Size of the Subarray with Maximum Sum is a common problem in the field of programming, especially in web development. The problem statement involves finding the contiguous subarray within a given one-dimensional array of integers which has the largest sum. This is also known as the maximum subarray problem. Solving this problem can be extremely useful in a variety of applications, such as financial analysis, stock market prediction, and signal processing. In this article, we will see the algorithm and the implementation of the size of the subarray with maximum sum using JavaScript. We will begin ... Read More

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

Aishwarya Mani Tripathi
Updated on 17-Apr-2023 15:41:46

119 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 Searching an Element in a Linked List

Aishwarya Mani Tripathi
Updated on 17-Jan-2025 14:56:03

563 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 list: 10 -> ... Read More

Explain about IIFEs in JavaScript

Nikesh Jagsish Malik
Updated on 17-Apr-2023 15:44:45

291 Views

In the world of JavaScript, there are various techniques and patterns that developers use to write efficient, maintainable code. One such powerful programming technique is the Immediately Invoked Function Expression (IIFE). In this article, we'll dive into IIFEs, their benefits, and how to implement them using different approaches. We'll also explore some practical examples to help you understand their applications in real-world scenarios. Algorithm The algorithm for implementing IIFEs in JavaScript can be summarized as follows − Create a function expression. Wrap the function expression in parentheses. Add an additional set of parentheses immediately after the function expression to ... Read More

Advertisements