Found 8895 Articles for Front End Technology

JavaScript Program for Reversal algorithm for right rotation of an array

Prabhdeep Singh
Updated on 12-Apr-2023 12:21:05

146 Views

Right rotation of an array means to rotate the elements of the array to their right side by a given number of times and for the number which are present at the edge they will move to the first index in their right rotation by assuming an array in a cycle form. We will implement a proper code to implement the algorithm with an explanation. Example Let us assume we have given array as [1, 2, 3, 4, 5, 6, 7, 8, 9] The number of right rotations of the array is 3 Output: 7 8 9 1 2 ... Read More

JavaScript Program for Reversal algorithm for array rotation

Prabhdeep Singh
Updated on 12-Apr-2023 12:19:55

161 Views

An array is a linear data structure used to store the different types of objects and we are given an array of size n and an integer k (where k is the number by which we will rotate an array). We will rotate the array by k elements and then return the rotated array. Rotation means we have to traverse the array from the given kth element and shift all the integers by one and we have to shift each element by 1 till the kth element came to position ‘0’ or we can say at index number ‘0’. Note ... Read More

JavaScript Program for Removing Duplicates From An Unsorted Linked List

Prabhdeep Singh
Updated on 12-Apr-2023 12:18:55

174 Views

The linked list is a linear data structure that consists of nodes, and each node is stored in memory in a non-contiguous manner. Nodes are connected by storing the address of the next node. We are given a linked list that will contain some integers in a random manner and not in a sorted manner. The task is to find the elements of the linked list which are repeated and we have to remove the duplicated ones. We will see the proper code and explanation. In this problem, we will keep the first copy of the elements of the ... Read More

Javascript Program For Removing Duplicates From A Sorted Linked List

Prabhdeep Singh
Updated on 12-Apr-2023 12:17:02

261 Views

Linked list is linear data structure and we have given a sorted linked list that consists of the integers. There are some numbers that may be duplicated or repeated and we have to remove them. As the given linked list is sorted, we can simply iterate over it and by using the while loop can remove the duplicate nodes from it. We will implement a proper code to understand the logic better with the discussion of time and space complexity. Example Given linked list is: 1-> 2 -> 2 -> 3 -> 4 -> 4 -> 4 -> 5 -> ... Read More

Javascript Program for Range Queries for Frequencies of array elements

Prabhdeep Singh
Updated on 12-Apr-2023 12:15:19

101 Views

We are given an array that will contain integers and another array will be given that will contain the queries and each query represents the range that we are given by the leftmost and the rightmost index in the array and an element. For that range or the subarray, we have to find the frequency of the given element present in that range. The frequency of the elements means that we have to tell for each integer present in that range how many times it occurs. For example − If, the given array is: [5, 2, 5, 3, 1, 5, ... Read More

How to set blur distance in CSS?

Shabaz Alam
Updated on 12-Apr-2023 09:08:08

224 Views

CSS (Cascading Style Sheets) is a powerful tool for designing the visual effects of a website. The blur effect is one of the many features in CSS, which is used to blur any element using the blur property. To create a soft, dreamy effect or to draw attention to a specific element on a page, we can use the blur effect. Syntax css element { filter : blur (amount) } The Concept of Blur Distance in CSS Before discussing the practical aspect of setting blur distance, it is important to understand the concept of blur distance. ... Read More

How to set background-image for the body element using CSS?

Shabaz Alam
Updated on 12-Apr-2023 09:06:52

234 Views

CSS (Cascading Style Sheets) is a powerful tool for designing the visual appearance of a website. The background-image property is one of the many features in CSS, which is used to set the background image using the background-image property. In web development, the background image is an important part of the overall design of a website. The default background of the body element in HTML is white, but with a few lines of CSS code, the background of a webpage can be changed to any image. Setting background-image in CSS Setting a background image is a great way to enhance ... Read More

How to set alternate table row color using CSS?

Shabaz Alam
Updated on 12-Apr-2023 09:06:07

8K+ Views

Tables are used to present data in a structured and organized format. It is an essential part of web design. Alternate row colors are used to enhance the readability and aesthetics of tables. Alternate row color is a design technique in which the background color of every other row in a table is different from the adjacent rows. This technique helps readers to differentiate rows and improves the overall look of the table. Basic CSS Syntax for Alternate Row Color The :nth-child() pseudo-class selector in CSS is used to set an alternate row color for a table. The nth-child selector ... Read More

How to set all the font properties in one declaration using CSS?

Shabaz Alam
Updated on 12-Apr-2023 09:04:41

1K+ Views

CSS or Cascading Style Sheets, is a powerful tool that provides a range of properties for aligning and positioning fonts on a web page. The font declaration property is one of the many properties available in CSS. In CSS, all font properties can be set in one declaration using the shorthand property. This property allows specifying the font style, variant, weight, size, line height, family, text decoration, and text transform all in one line of code. Setting Font Properties in CSS CSS provides a variety of font properties for styling text, which are used to style text on a web ... Read More

How to create a rainbow using HTML5

Aman Gupta
Updated on 11-Apr-2023 16:06:09

2K+ Views

Overview The task is to create a beautiful rainbow using the HTML5 version. The rainbow consists of the seven colors, these seven colors are Violet, Indigo, Blue, Green, Yellow, Orange and Red. These colors are arranged in the bottom-up approach. So to achieve this task we will use the Scalable Vector Graphics tag which helps us to create the graphics shape inside a HTML page. Inside the svg element we have several elements by which we can draw the shape. These tags are: rect, circle, ellipse, line, polyline, polygon and path. Syntax The syntax used to create the ... Read More

Advertisements