Welcome To Tutorialspoint.dev
Officially launched 18th May 2019
Arrays Paytm Paytm

Find the minimum distance between two numbers

Given an unsorted array arr[] and two numbers x and y, find the minimum distance between x and y in arr[]. The array might also contain duplicates. You may assume tha...
Searching Sorting Amazon

Find a pair with the given difference

Given an unsorted array and a number n, find if there exists a pair of elements in the array whose difference is n. Examples: Input: arr[] = {5, 20, 3, 2, 50, 80}, n...
Arrays Amazon Amazon

Find the maximum repeating number in O(n) time and O(1) extra space

Given an array of size n, the array contains numbers in range from 0 to k-1 where k is a positive integer and k <= n. Find the maximum repeating number in this arr...
Strings Amazon cpp-pair

Given a string, find its first non-repeating character

Given a string, find the first non-repeating character in it. For example, if the input string is “GeeksforGeeks”, then output should be ‘f&#x2...
C Mathematical C-Operators

To find sum of two numbers without using any operator

Write a program to find sum of positive integers without using any operator. Only use of printf() is allowed. No other library function can be used. Solution It&#x20...
C C-String C

How to find length of a string without string.h and loop in C?

Find the length of a string without using any loops and string.h in C. Your program is supposed to behave in following way: Enter a string: GeeksforGeeks (Say user e...
Tree Amazon Cadence India

Write a Program to Find the Maximum Depth or Height of a Tree

Given a binary tree, find height of it. Height of empty tree is 0 and height of below tree is 3. Example Tree Recommended: Please solve it on “PRACTICE&#x20...
Binary Search Tree Amazon Google

Find k-th smallest element in BST (Order Statistics in BST)

Given root of binary search tree and K as input, find K-th smallest element in BST. For example, in the following BST, if k = 3, then output should be 10, and if k =...
C C++ cpp-array

How to find size of array in C/C++ without using sizeof ?

We can find size of an array using sizeof operator as shown below. // Finds size of arr[] and stores in 'size' int size = sizeof(arr)/sizeof(arr[0]); Can w...
Mathematical School Programming harmonic progression

Program to find sum of series 1 + 1/2 + 1/3 + 1/4 + .. + 1/n

If inverse of a sequence follows rule of an A.P i.e, Arithmetic progression, then it is said to be in Harmonic Progression.In general, the terms in a harmonic progres...

Subscribe to Our Newsletter