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
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 ran
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_ty
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 as
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_Ind
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
Suppose we have two Strings :- Pattern and Text pattern: consisting of unique characters text: consisting of any length We need to find the number of patterns t
Java Collection framework provides a Stack class which models and implements Stack data structure. The class is based on the basic principle of last-in-first-ou
The Queue interface is available in java.util package and extends the Collection interface. The queue collection is used to hold the elements about to be proces
Prerequisite : Priority Queue, Comparator Priority Queue is like a regular queue, but each element has a “priority” associated with it. In a priority queue,
Given a singly linked list, find middle of the linked list. For example, if given linked list is 1->2->3->4->5 then output should be 3. If there are even nodes,
In this article, we will see how hashmap’s get and put method works internally. What operations are performed. How the hashing is done. How the value is fetch
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
C# is a general-purpose, modern and object-oriented programming language pronounced as “C sharp”. It was developed by Microsoft led by Anders Hejlsberg and
Background A Database Management System (DBMS) stores data in the form of tables, uses ER model and the goal is ACID properties. For example a DBMS of college h
A data-warehouse is a heterogeneous collection of different data sources organised under a unified schema. There are 2 approaches for constructing data-warehous
Prerequisite – Data Warehousing Data warehouse can be controlled when the user has a shared way of explaining the trends that are introduced as specific subje
Prerequisite – DBMS | File Organization – Set 1, File Organization-Set 2 B+ Tree File Organization – B+ Tree, as the name suggests, It uses a tree like st
In general terms, “Mining” is the process of extraction of some valuable material from the earth e.g. coal mining, diamond mining etc. In the context of com
Prerequisites – Data Warehousing, Data Warehouse Architecture, Characteristics and Functions of Data warehouse Here are some of the difficulties of Implementi
Data Mining – Knowledge Discovery in Databases(KDD). Why we need Data Mining? Volume of information is increasing everyday that we can handle from business tr
Datawarehouse and Data Mart, both are storage components of HDFS. Data mart is such a storage component which is concerned on a specific department of an organi
In this post, we will discuss what are different sources of data that are used in data mining process. The data from multiple sources are integrated into a comm
Prerequisite – Introduction to Hadoop, Apache Hive The major components of Hive and its interaction with the Hadoop is demonstrated in the figure below and al
This article is going to help you in learning how to do basic database operations using JDBC (Java Database Connectivity) API. These basic operations are INSERT