JavaScript Program for Sum of Digits of a Number using Recursion (original) (raw)
Mathematical
- Check a Number is Prime or Not Using JavaScript A prime number is a whole number greater than 1, which has no positive divisors other than 1 and itself. In other words, prime numbers cannot be formed by multiplying two smaller natural numbers. For example:2, 3, 5, 7, 11, and 13 are prime numbers.4, 6, 8, 9, and 12 are not prime numbers because th 5 min read
Recursion
Array
- Javascript Program to Move all zeroes to end of array Given an array of random numbers, Push all the zero's of a given array to the end of the array. For example, if the given arrays is {1, 9, 8, 4, 0, 0, 2, 7, 0, 6, 0}, it should be changed to {1, 9, 8, 4, 2, 7, 6, 0, 0, 0, 0}. The order of all other elements should be same. Expected time complexity i 3 min read
Searching
- Count number of occurrences (or frequency) in a sorted array Given a sorted array arr[] and an integer target, the task is to find the number of occurrences of target in given array.Examples:Input: arr[] = [1, 1, 2, 2, 2, 2, 3], target = 2Output: 4Explanation: 2 occurs 4 times in the given array.Input: arr[] = [1, 1, 2, 2, 2, 2, 3], target = 4Output: 0Explana 9 min read
Sorting
- Sorting Algorithms in JavaScript Sorting is an important operation in computer science that arranges elements of an array or list in a certain order (either ascending or descending).Example:Input: [64, 34, 25, 12, 22, 11, 90]Output: [11, 12, 22, 25, 34, 64, 90] Input: [1, 2, -3, 3, 4, 5]Output: [-3, 1, 2, 3, 4, 5] Table of ContentB 5 min read
- How to Create an Array using Intersection of two Arrays in JavaScript ? In this article, we will try to understand how to create an array using the intersection values of two arrays in JavaScript using some coding examples. For Example: arr1 = [1, 3, 5, 7, 9, 10, 14, 15]arr2 = [1, 2, 3, 7, 10, 11, 13, 14]result_arr = [1, 3, 7, 10, 14]Approach 1: We will see the native a 3 min read
Hashing
String
Linked List