Prerequisite: InetAddress
getByName() : Returns the InetAddress of the given host. If the host is a literal IP address, then only its validity is checked. Fetches pub...
Share
Checksum is an error-detecting technique that can be applied to message of any length. It is used mostly at the network and transport layers of the TCP/IP protocol su...
Share
Given a number n, find n-th Fibonacci Number. Note that n may be large.
Examples:
Input : 100
Output : 218922995834555169026
Input : 500
Output : 861682916002384507...
Share
sort() method is a java.util.Arrays class method.
Syntax:
public static void sort(int[] arr, int from_Index, int to_Index)
arr - the array to be sorted
from_Index ...
Share
java.util.Collections.sort() method is present in java.util.Collections class. It is used to sort the elements present in the specified list of Collection in ascendi...
Share
We often need to sort array while programming. For this, we use inbuilt method provided by Java in Arrays class i.e sort(). sort() method uses merge sort or Tim Sort ...
Share
Arrays.binarySearch() is the simplest and most efficient method to find an element in a sorted array in Java
Declaration:
public static int binarySearch(data_type arr...
Share
Arrays.binarySearch()| Set 1 covers how to to find an element in a sorted array in Java. This set will cover “How to Search a key in an array within given rang...
Share
java.util.Collections.binarySearch() method is a java.util.Collections class method that returns position of an object in a sorted list.
// Returns index of key in so...
Share
Given a dictionary of words and an input string, find the longest prefix of the string which is also a word in dictionary.
Examples:
Let the dictionary contains the f...
Share