Posts from Java

Check whether a given tree is a Binary Search Tree in Java

By vikrant_tomar

In this Java tutorial, we will solve a well-known problem of Tree data structure. Given a tree, we will check whether the given tree is a Binary search tree or not. Binary Search T.... Read More

Reading and writing a file in java using FileWriter and FileReader

By Sneha Mitra

In this Java tutorial, first of all, we will learn about reading and writing a file in Java. We will also learn about FileWriter and FileReader classes in Java. Hence these classe.... Read More

Finding Missing number in an array using XOR operation in Java

By divyesh srivastava

In this Java tutorial, we gonna learn how to find a missing number in an array in Java using XOR operation. Problem Statement We are given an array of ‘n-1’ elements an.... Read More

Pair with a given sum in an array using HashSet in Java

By divyesh srivastava

In this Java tutorial, we are going to find the existence of a pair in an array whose sum is equal to a given value using HashSet. What is HashSet in Java? Set is an unordered coll.... Read More

BigInteger class in Java

By divyesh srivastava

In this Java tutorial, we are going to discuss BigInteger class in Java. It is very important for mathematical operations in which output is very large and our primitive data types.... Read More

Different HashSet() methods in Java

By divyesh srivastava

Set is an unordered collection of values in which duplicate values are not allowed. Set can be implemented using HashSet. In this Java tutorial, we are going to discuss different .... Read More

How to implement an algorithm for the Fractional Knapsack Problem

By Saurabh Singh

In this Java tutorial, we are going to implement an algorithm for the fractional knapsack problem. Knapsack Problem Description A thief finds a very big loot than his bag size. We .... Read More

Preorder, Inorder and Postorder traversals without Recursion in Java

By vikrant_tomar

In this Java tutorial, we will learn how to traverse a tree without recursion in Java. We will implement preorder, inorder and postorder traversals without recursion in Java. Preor.... Read More