- 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
1K+ Views
In this tutorial, we are going to write a program that finds the result for lagranges's interpolation formula.You don't have write any logic for the program. Just convert the formula into code. Let's see the code.Example Live Demo#include using namespace std; struct Data { int x, y; }; double interpolate(Data ... Read More
Hafeezul Kareem
270 Views
In this tutorial, we are going to learn about largrange's four square theorem.The lagranges's four square theorem states that every natural number can be written as sum of squares of 4 numbers.The following code finds the 4 numbers which satisfies the above condition for the given number n.ExampleLet's see the ... Read More
Hafeezul Kareem
76 Views
In this tutorial, we are going to write a program that finds the k-th smallest number in the unsorted array.Let's see the steps to solve the problem.Initialise the array and k.Sort the array using sort method.Return the value from the array with the index k - 1.Let's see the code.Example Live ... Read More
Hafeezul Kareem
167 Views
In this tutorial, we are going to find the k-th smallest element after every insertion.We are going to use the min-heap to solve the problem. Let's see the steps to complete the program.Initialise the array with random data.Initialise the priority queue.Till k - 1 there won't be any k-th smallest ... Read More
Hafeezul Kareem
219 Views
In this tutorial, we are going to write a program that finds the k-th prime number which is greater than the given number n.Initialise the number n.Find all the prime numbers till 1e6 and store it in a boolean array.Write a loop that iterates from n + 1 to 1e6.If ... Read More
Hafeezul Kareem
254 Views
In this tutorial, we are going to write a program that finds the k-th odd number from the given array.Let's see the steps to solve the problem.Initialise the array and k.Iterate over the array.If the current element is odd, then decrement the value of k.If k is 0, then return ... Read More
Hafeezul Kareem
63 Views
In this tutorial, we are going to write a program that finds the k-th node in the diagonal traversal of a binary tree.Let's see the steps to solve the problem.Initialise the binary tree with some sample data.Initialise the number k.Traverse the binary tree diagonally using the data structure queue.Decrement the ... Read More
Hafeezul Kareem
346 Views
In this tutorial, we are going to write a program that finds the length of union of segments of a line.We are given starting and ending points of the line segment and we need to find the length of union of segments of the line.The algorithm that we are going ... Read More
Hafeezul Kareem
264 Views
In this tutorial, we are going to write a program that checks whether the given number is Keith Number or not.The number n is called Keith number if it appears in the sequence generated using its digits. The sequence has first n terms as digits of the number n and ... Read More
Hafeezul Kareem
2K+ Views
In this tutorial, we are going to write a program that finds whether the given number is kaprekar number or not.Take a number. Find the square of that number. Divide the number into two parts. If the sum of the two parts is equal to the original number, then the ... Read More