Java.util package provides a Random class. An instance of this class is used to generate a stream of pseudorandom numbers. The class uses a 48-bit seed, which is modified using a linear congruential formula. The algorithms implemented by class Random use a protected utility method that on each invocation can supply up to 32 pseudorandomly generated bits.
Java.util package provides a TreeSet class which is a NavigableSet implementation based on a TreeMap. The elements are ordered using their natural ordering, or by a Comparator provided at set creation time, depending on which constructor is used. The class guarantees that the Map will be in ascending key order and backed by a TreeMap.
Java.util package provides a EnumMap class which is a specialized Map implementation for use with enum type keys. All of the keys in an enum map must come from a single enum type that is specified, explicitly or implicitly, when the map is created.
Java.util package provides a PriorityQueue class where an unbounded priority queue based on a priority heap. The elements of the priority queue are ordered according to their natural ordering, or by a Comparator provided at queue construction time, depending on which constructor is used. A priority queue does not permit null elements. A priority queue relying on natural ordering also does not permit insertion of non-comparable objects.
Java.util package provides a BitSet class which implements a vector of bits that grows as needed. Each component of the bit set has a boolean value. The bits of a BitSet are indexed by nonnegative integers. By default, all bits in the set initially have the value false. One BitSet may be used to modify the contents of another BitSet through logical AND, logical inclusive OR, and logical exclusive OR operations.
Java.util package provides a Hashtable class which implements hash table and maps keys to value. Any non-null object can be used as a key or as a value. To successfully store and retrieve objects from a hashtable, the objects used as keys must implement the hashCode method and the equals method.
A linked list is a linear data structure, in which the elements are stored in the form of a node. Each node contains two sub-elements. A data part that stores the value of the element and next part that stores the pointer to the next node.
Java.util package provides a Dictionary class which is the abstract parent of any class, such as Hashtable, which maps keys to values. Every key and every value is an object. In any one Dictionary object, every key is associated with at most one value. Given a Dictionary and a key, the associated element can be looked up. Any non-null object can be used as a key and as a value.
A linked list is a linear data structure, in which the elements are stored in the form of a node. Each node contains two sub-elements. A data part that stores the value of the element and next part that stores the pointer to the next node.
Java.util package provides a LinkedList class which has Doubly-linked list implementation of the List and Deque interfaces. The class has all optional list operations, and permits all elements (including null). Operations that index into the list will traverse the list from the beginning or the end, whichever is closer to the specified index.
Java.util package provides a Scanner class. A simple text scanner parse primitive types and strings using regular expressions. A Scanner breaks its input into tokens using a delimiter pattern, which by default matches whitespace. The resulting tokens may then be converted into values of different types using the various next methods.
Python provides some special function having __ as prefix and suffix in the name, which is also known as Magic method or Dunder method. This function is automatically invoked when the associated operator is used.
Ndarray is the n-dimensional array object defined in the numpy. It stores the collection of elements of the same type. Elements in the collection can be accessed using a zero-based index. Each element in an ndarray takes the same size in memory.
Java.util package provides a Arrays class which contains a static factory that allows arrays to be viewed as lists. The class contains various methods for manipulating arrays like sorting and searching. The methods in this class throw a NullPointerException, if the specified array reference is null.
The type casting is a method of converting the value of one data type to another data type. It is also known as type conversion. In Java, there are several kinds of conversions. However, in this tutorial we will focus only on two major types: Widening Type Casting, Narrowing Type Casting.
The NumPy sum() function is used to compute sum of array elements over a given axis. The function calculates sum of all elements present in the array by default, otherwise over the specified axis.