Ayush Gupta has Published 541 Articles

In Javascript how to empty an array

Ayush Gupta

Ayush Gupta

Updated on 07-Oct-2023 03:16:27

23K+ Views

There are multiple ways to clear/empty an array in JavaScript. You need to use them based on the context. Let us look at each of them. Assume we have an array defined as − let arr = [1, 'test', {}, 123.43]; Substituting with a new array − arr = []; ... Read More

Program to find the Area and Volume of Icosahedron in C++

Ayush Gupta

Ayush Gupta

Updated on 16-May-2022 07:24:22

141 Views

In this problem, we are given a value that denotes the side of an icosahedron. Our task is to create a program to find the Area and Volume of Icosahedron in C++.Icosahedron is a regular 30 sided polyhedron. It has 20 equilateral triangles of the same side. There are only ... Read More

Program to find the Area of a Pentagon in C++

Ayush Gupta

Ayush Gupta

Updated on 16-May-2022 07:23:40

410 Views

In this problem, we are given a number n that denotes that side of the pentagon. Our task is to create a program to find the Area of a Pentagon in C++.Pentagon is a five-sided geometric figure.Regular pentagon is a pentagon with all five sides and angles equal.Let’s take an ... Read More

Program to find the Circumcircle of any regular polygon in C++

Ayush Gupta

Ayush Gupta

Updated on 16-May-2022 07:22:35

141 Views

In this problem, we are given two numbers that give the number of sides of a polygon N and the length of each side A. Our task is to create a Program to find the Circumcircle of any regular polygon in C++.Problem description − Here, we need to find the ... Read More

Maximum sum bitonic subarray in C++

Ayush Gupta

Ayush Gupta

Updated on 15-Oct-2020 14:00:02

326 Views

In this problem, we are given an array arr[]. Our task is to create a program to find the maximum sum bitonic subarray in C++.Bitonic Subarray is a special subarray in which the element strictly increase first and then strictly decreases after reaching a certain point.Let’s take an example to ... Read More

Maximum sum Bi-tonic Sub-sequence in C++

Ayush Gupta

Ayush Gupta

Updated on 15-Oct-2020 13:56:52

118 Views

In this problem, we are given an array arr[]. Our task is to create a program to find the maximum sum Bi-tonic subsequence in C++.Bi-tonic subsequence is a special sequence whose elements first increase and then decrease.Let’s take an example to understand the problem, Inputarr[] = {4, 2, 3, 7, ... Read More

Maximum sum from a tree with adjacent levels not allowed in C++

Ayush Gupta

Ayush Gupta

Updated on 15-Oct-2020 13:45:55

94 Views

In this problem, we are given a binary tree consisting of positive numbers. Our task is to create a program to find the Maximum sum from a tree with adjacent levels not allowed in C++.Code DescriptionHere, we will find the maximum sum of node of the tree in such a ... Read More

Maximum sum from three arrays such that picking elements consecutively from same is not allowed in C++

Ayush Gupta

Ayush Gupta

Updated on 15-Oct-2020 12:34:25

245 Views

In this problem, we are given three arrays arr1[], arr2[], and arr3[] all of size N. Our task is to create a program to find the Maximum sum from three arrays such that picking elements consecutively from same is not allowed in C++.Problem DescriptionWe will find the maximum sum by ... Read More

Maximum sum in a 2 x n grid such that no two elements are adjacent in C++

Ayush Gupta

Ayush Gupta

Updated on 15-Oct-2020 12:32:24

256 Views

In this problem, we are given a rectangular grid of size 2 x n. Our task is to create a program to find the Maximum sum in a 2 x n grid such that no two elements are adjacent in C++.Problem DescriptionTo find the maximum sum, we cannot select elements ... Read More

Maximum sum in circular array such that no two elements are adjacent in C++

Ayush Gupta

Ayush Gupta

Updated on 15-Oct-2020 12:30:13

225 Views

In this problem, we are given a circular array cirArr[]. Our task is to create a program to find the Maximum sum in circular array such that no two elements are adjacent in C++.Problem DescriptionFor the circular array, we need to find the maximum sum sum of elements of the ... Read More

1 2 3 4 5 ... 55 Next
Advertisements