In Java, every application must contain a main method which serves as an entry point for the application similar to the main function in C and C++.
Sieve of Eratosthenes is a very efficient algorithm that can be used in most coding competitions involving prime numbers in the range of a given number n. The algorithm starts off by assuming that all the numbers in the range 2 to n are prime. Now we traverse the list starting from 2 to …
In this post, we will check if two integer arrays are equal to one another or not.
Given an array of n-1 distinct integers in the range of 1 to n, find the missing number in the array in linear time.
Given an array of integers, find minimum product among all combinations of triplets in the array.
In this post, we will see how to override equals and hashCode method in Java.
Given a text file, write a C program to find frequency of characters Number of words having each character Total number of words in the file and Special characters present in the file.
Write a C program to print map of India. Below is obfuscated version in C that generates the map of India. Obfuscated code is any code that is difficult for humans to understand.
Given a square matrix of 0’s and 1’s, calculate the size of the largest plus formed by 1’s.
Write an efficient function to implement atoi function in C. Standard atoi() function convert input C-string to its corresponding integer value.
Write a program to calculate n’th Fibonacci number where n is a given positive number. Fibonacci sequence is characterized by the fact that every number after the first two is the sum of the two preceding ones. For example, consider below sequence – 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, …
Write a program to print all numbers between 1 to N without using semicolon.