- 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
Hafeezul Kareem has Published 344 Articles
![Hafeezul Kareem](https://www.tutorialspoint.com/assets/profiles/120468/profile/60_159160-1581501828.jpg)
Hafeezul Kareem
4K+ Views
We are given a array and we need to find the most frequent element from it. Let's see an example.Inputarr = [1, 2, 3, 3, 2, 2, 1, 1, 2, 3, 4]Output2In the above array, 2 occurs 4 times which is most frequent than any other in the array.Algorithm - ... Read More
![Hafeezul Kareem](https://www.tutorialspoint.com/assets/profiles/120468/profile/60_159160-1581501828.jpg)
Hafeezul Kareem
166 Views
We are given a number N. We need to find the prime palindrome that is greater than N. Let's see an example.InputN = 10Output11AlgorithmInitialise the number N.Write a function to check whether the given number is prime or not.Write a function to check whether the given number is palindrome.Write a ... Read More
![Hafeezul Kareem](https://www.tutorialspoint.com/assets/profiles/120468/profile/60_159160-1581501828.jpg)
Hafeezul Kareem
986 Views
The next smaller element is the element that is the first smaller element after it. Let's see an example.arr = [1, 2, 3, 5, 4]The next smaller element for 5 is 4 and the next smaller element for elements 1, 2, 3 is -1 as there is no smaller element ... Read More
![Hafeezul Kareem](https://www.tutorialspoint.com/assets/profiles/120468/profile/60_159160-1581501828.jpg)
Hafeezul Kareem
254 Views
The n-ary tree is the tree with n children for each node. We are given a number n and we have to find the next larger element from the n-ary tree.We can find the solution by traversing through the n-ary tree and maintaining the result.AlgorithmCreate n-ary tree.Initialise a result.Write a ... Read More
![Hafeezul Kareem](https://www.tutorialspoint.com/assets/profiles/120468/profile/60_159160-1581501828.jpg)
Hafeezul Kareem
390 Views
We are given a number n, we have to find the number that is greater than n with same number of set bits as n in its binary representation.The digit 1 in the binary representation is called set bit.Let's see an example.Input124Output143AlgorithmInitialise the number n.Write a function get the count ... Read More
![Hafeezul Kareem](https://www.tutorialspoint.com/assets/profiles/120468/profile/60_159160-1581501828.jpg)
Hafeezul Kareem
75 Views
Given a number n, swap any two digits of the number so that the resulting number is greater than the number n. If it's not possible then print -1. Let's see an example.Input12345Output12354We have swapped the digits 4 and 5. And we got the higher number with one swap.AlgorithmIt's not ... Read More
![Hafeezul Kareem](https://www.tutorialspoint.com/assets/profiles/120468/profile/60_159160-1581501828.jpg)
Hafeezul Kareem
80 Views
Given N, A, and B. Find the number which is greater than N with the same number of AÂ and BÂ digits. Let's see an example.N = 1234 A = 2 B = 3We need to check for every possibility of the given number of digits. There are two digits to form ... Read More
![Hafeezul Kareem](https://www.tutorialspoint.com/assets/profiles/120468/profile/60_159160-1581501828.jpg)
Hafeezul Kareem
89 Views
We are given a number n, we have to find the number that is greater than n with one more set bit than n in its binary representation.The digit 1 in the binary representation is called set bit.Let's see an example.Input124Output125AlgorithmInitialise the number n.Write a function get the count of ... Read More
![Hafeezul Kareem](https://www.tutorialspoint.com/assets/profiles/120468/profile/60_159160-1581501828.jpg)
Hafeezul Kareem
669 Views
The next greater element is the element that is first greater element after it. Let's see an example.arr = [4, 5, 3, 2, 1]The next greater element for 4 is 5 and the next greater element for elements 3, 2, 1 is -1 as there is no greater element after ... Read More
![Hafeezul Kareem](https://www.tutorialspoint.com/assets/profiles/120468/profile/60_159160-1581501828.jpg)
Hafeezul Kareem
61 Views
The next greater element is the element that is first greater element after it. Let's see an example.arr = [4, 5, 3, 2, 1]The next greater element for 4 is 5 and the next greater element for elements 3, 2, 1 is -1 as there is no greater element after ... Read More