Featured Article

Palindromic Tree | Introduction & Implementation

We encounter various problems like Maximum length palindrome in a string, number of palindromic substrings and many more interesting problems on palindromic substrings . Mostly of these palindromic substring problems have some DP O(n2) solution (n is length of the given string) or then we have a complex algorithm like Manacher’s algorithm which solves the… Read More »

Java.Lang.Long class in Java

Long class is a wrapper class for the primitive type long which contains several methods to effectively deal with a long value like converting it to a string representation, and vice-versa. An object of Long class can hold a single long value. There are mainly two constructors to initialise a Long object- Long(long b): Creates… Read More »

Java.lang.Integer class in Java

Integer class is a wrapper class for the primitive type int which contains several methods to effectively deal with a int value like converting it to a string representation, and vice-versa. An object of Integer class can hold a single int value. Constructors: Integer(int b): Creates a Integer object initialized with the value provided. Syntax… Read More »

random header in C++ | Set 1(Generators)

This header introduces random number generation facilities. This library allows to produce random numbers using combinations of generators and distributions. Generators: Objects that generate uniformly distributed numbers. Distributions: Objects that transform sequences of numbers generated by a generator into sequences of numbers that follow a specific random variable distribution, such as uniform, Normal or Binomial.… Read More »

Warnsdorff’s algorithm for Knight’s tour problem

Problem : A knight is placed on the first block of an empty board and, moving according to the rules of chess, must visit each square exactly once. Following is an example path followed by Knight to cover all the cells. The below grid represents a chessboard with 8 x 8 cells. Numbers in cells… Read More »

Interfaces and Inheritance in Java

Prerequisites: Interfaces in Java, Java and Multiple Inheritance A class can extends another class and/ can implement one and more than one interface. Output; Welcome: inside the method m1 Welcome: inside the method m2 Interface inheritance : An Interface can extend other interface. Output: Rohit JIIT An interface can also extend multiple interfaces. Output: Rohit… Read More »

Java.Lang.Short class in Java

Short class is a wrapper class for the primitive type short which contains several methods to effectively deal with a short value like converting it to a string representation, and vice-versa. An object of Short class can hold a single short value. There are mainly two constructors to initialise a Short object- Short(short b): Creates… Read More »

Java.Lang.Byte class in Java

Byte class is a wrapper class for the primitive type byte which contains several methods to effectively deal with a byte value like converting it to a string representation, and vice-versa. An object of Byte class can hold a single byte value. There are mainly two constructors to initialise a Byte object- Byte(byte b): Creates… Read More »