Java stream API has the following important methods:

Java stream is a pipeline of functions or operations. These operations can be classed into two operations.

  1. Terminal operation.

The difference between the two is in the output which the operation creates. If an operation outputs another stream, to which…

Important methods:

ArrayList<String> list = new ArrayList<>();

ArrayList(class) — implements →List(Interface) — extends → Collection

ArrayList is not Synchronized, Its equivalent synchronized class is Vector.


List list = new ArrayList(); // Empty Constructor
List list = new ArrayList(50); // Initial capacity
List list = new ArrayList(oldList);// add collection

An ArrayList can also be created using an existing…

Binary Search
1.1 Search in Rotated Sorted Array

Finding elements in the array is a very easy problem, we can use linear search to find elements in O(N) time complexity.

Search in Rotated Sorted Array :


2. Now if the sorted array is on the left side then compare the target…

satish kathiriya

Associate Software Engineer | JP Morgan & Chase

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store