- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 8894 Articles for Front End Technology
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
3K+ Views
Tree Data StructureA tree is a collection of nodes connected by some edges. Conventionally, each node of a tree holds some data and reference to its children.Binary Search TreeBinary Search tree is a binary tree in which nodes that have lesser value are stored on the left while the nodes with a higher value are stored at the right.For instance, visual representation of a valid BST is − 25 / \ 20 36 / \ / \ 10 22 30 40Let’s now implement our very own Binary Search ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
138 Views
SubsequenceFor the purpose of this problem, we define a subsequence as a sequence that can be derived from one sequence by deleting some characters without changing the order of the remaining elements. Any string is a subsequence of itself and an empty string is a subsequence of any string.ProblemWe are required to write a JavaScript function that takes in an array of strings as the only argument. Our function needs to find the length of the longest uncommon subsequence among them.By longest uncommon subsequence we mean, longest subsequence of one of the strings in the array and this subsequence should ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
122 Views
ProblemWe are required to write a JavaScript function that takes in an array of Integers, arr, as the first argument and a single Integer, target as the second and first argument. Our function should check whether there exists a continuous subarray of size at least 2 that sums up to the multiple of k, that is, sums up to n*k where n can be any integer.We return true if it exists, false otherwise.For example, if the input to the function is −const arr = [23, 2, 6, 4, 7]; const target = 6;Then the output should be −const output = ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
213 Views
ProblemWe are required to write a JavaScript function that takes in a random English alphabet string, str, as the first argument and an array of strings, arr, as the second argument.The task of our function is to try deleting some characters from the string str and check which longest word can be formed that exists in the array arr as well. Our function should return the longest possible string.If there exists no such string, we should return an empty string.For example, if the input to the function is −const str = 'sdgfdfghdjh'; const arr = ['sdf', 'fghj', 'gfdfg', 'absc', 'a', ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
247 Views
Problem:We are required to write a JavaScript function that takes in a binary array, arr, (an array that only consists of 0 or 1). Our function should return the length of the contiguous subarray from the array that consists of the same number of 1 and 0.For example, if the input to the function is −const arr = [1, 0, 0, 1, 0, 1, 0, 0];Then the output should be −const output = 6;Output ExplanationThe first 6 elements of the array are 1, 0, 0, 1, 0, 1 (three 1s and three 0s)ExampleThe code for this will be − Live Democonst ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
302 Views
Beautiful Arrangement:Suppose we have num integers from 1 to num. We define a beautiful arrangement as an array that is constructed by these num numbers successfully if one of the following is true for the ith position (1 ≤ i ≤ N) in this array −The number at the ith position is divisible by i.i is divisible by the number at the ith position.ProblemWe are required to write a JavaScript function that takes in a number, num, and returns the count of beautiful arrangements we can construct for num.For example, if the input to the function is −const input = ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
758 Views
We are required to write a JavaScript function add() that takes in two numbers m and n. The function should, without using the four basic arithmetic operations add the two numbers taken as input and return the sum.ExampleThe code for this will be − Live Democonst m = 67, n = 33; const add = (x, y) => { while(y !== 0){ let carry = x & y; x = x ^ y; y = carry
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
457 Views
Natural Number Sequence:1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12...This sequence extended infinitely is known as natural number sequence.We are required to write a JavaScript function that takes in a number, num, as the first and the only argument. The function should find and return the (num)th digit that will appear in this sequence when written, removing the commas and whitespaces.For example −If the input number is −const num = 13;Then the output should be −const output = 1;because '1234567891011' this string has its 13th number as 1ExampleThe code for this will be − Live Democonst num ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
73 Views
We are required to write a JavaScript function that takes in a natural number, num, as the first argument and two natural numbers m and n as the second and third argument. The task of our function is to return an array that contains all natural numbers from 1 to num (including num) in increasing order.But if any number is a multiple of m, we should replace it by 'kit' string, if any number is a multiple of n, we should replace it by 'kat', andif any number is a multiple of both m and n it should be replaced ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
138 Views
We are required to write a JavaScript function that takes in an array of numbers as the first and the only argument.The task of our function is to pick and return the third maximum number from the array. And if the array does not contain any third maximum number then we should simply return the maximum number from the array.For example −If the input array is −const arr = [34, 67, 31, 87, 12, 30, 22];Then the output should be −const output = 34;ExampleThe code for this will be − Live Democonst arr = [34, 67, 31, 87, 12, 30, 22]; ... Read More