Java program to merge contents of all the files in a directory
Prerequisite : PrintWriter, BufferedReader. We are given a directory/folder in which n number of files are stored(We dont know the number of files) and we… Read More »
Prerequisite : PrintWriter, BufferedReader. We are given a directory/folder in which n number of files are stored(We dont know the number of files) and we… Read More »
Given a positive integer . The task is to find the perfect square number closest to N and steps required to reach this number from… Read More »
The retainAll() method in AbstractCollection helps in retaining elements of the specified collection from another collection and removes the unmatched elements from the result. Syntax:… Read More »
Given a sorted array of String and a String x, find index of x if it is present in the array. Examples: Input : arr[]… Read More »
Given a positive integer N, the task is to find the absolute difference of N and the prime number closest to N . Note: The… Read More »
Given an array arr[] of N integers and an index range [a, b]. The task is to sort the array in this given index range… Read More »
Given two arrays of size N and two integers X and Y indicating the maximum number of elements one can pick from array A and… Read More »
String is a special class in Java. substring() is one of the widely used methods of String class. It is used to extract part of… Read More »
Given a positive integer n, the task is to find the sum of the first n natural numbers given that n is very large (1… Read More »
Given a graph with adjacency list representation of the edges between the nodes, the task is to implement Dijkstra’s Algorithm for single source shortest path… Read More »
Given an integer n, the task is to check whether n is in binary or not. Print true if n is the binary representation else… Read More »
The add(E ele) method of List interface in Java is used to insert the specified element to the end of the current list. Syntax: public… Read More »
A Min-Heap is a complete binary tree in which the value in each internal node is greater than or equal to the values in the… Read More »
Given a file containing data of student name and marks scored by him/her in 3 subjects. The task is to find the list of students… Read More »
Given a string, move all Uppercase alphabets char to the end of the String. Examples: Input : Geeksforgeeks A Computer Science Portal for Geeks!! Output… Read More »