Java Program to print distinct permutations of a string
Given a string str, the task is to print all the distinct permutations of str. A permutation is an arrangement of all or part of… Read More »
Given a string str, the task is to print all the distinct permutations of str. A permutation is an arrangement of all or part of… Read More »
Given a keypad of a mobile, and keys that need to be pressed, the task is to print all the words which are possible to… Read More »
Given a string str, the task is to print all the permutations of str. A permutation is an arrangement of all or part of a… Read More »
Given a string str, the task is to print all the sub-sequences of str. A subsequence is a sequence that can be derived from another… Read More »
The toArray() method of ArrayList is used to return an array containing all the elements in ArrayList in the correct order. Syntax: public Object[] toArray()… Read More »
The Java.util.ArrayList.clone() method is used to create a shallow copy of the mentioned array list. It just creates a copy of the list. Syntax: ArrayList.clone()… Read More »
The iterator() method of ArrayList class in Java Collection Framework is used to get an iterator over the elements in this list in proper sequence.… Read More »
Given an array of integers, find the closest greater element for every element. If there is no greater element then print -1 Examples: Input :… Read More »
ArrayList is a part of collection framework and is present in java.util package. It provides us dynamic arrays in Java. Though, it may be slower… Read More »
Given an array and a key, the task is to remove all occurrences of the specified key from the array in Java. Examples: Input: array… Read More »
Here are couple of differences between ArrayList and HashSet. Inheritance: Implementation: Implementation : ArrayList implements List interface while HashSet implements Set interface in Java. Internal… Read More »
Given an array list, find first and last elements of it. Input : aList = {10, 30, 20, 14, 2} Output : First = 10,… Read More »
Reversing an array in java can be done in three simple methods. Examples: Input : 1, 2, 3, 4, 5 Output :5, 4, 3, 2,… Read More »
Given a list, we need to split into two news lists in Java. Input : list = {1, 2, 3, 4, 5, 6} Output :… Read More »
Given an ArrayList with duplicate values, the task is to remove the duplicate values from this ArrayList in Java. Examples: Input: List = [1, 10,… Read More »