Dynamic Array

Dynamic Array class  package datastructure.algorithms.ArrayList; /** * * @author GOKUL */ public class ArrayList<T> { private Object[] array; private int size; private int index = -1; public ArrayList() { this.size = 5; array = new…

Linked List

Node class /** * * @author GOKUL */ public class Node { private int data; private Node next; public Node(int data,Node next) { this.data=data; this.next=next; } public int getData() { return data; } public void…

BinarySearch

Binary Search is used to find an element in an array of element in logarithmic time. The time complexity of Binary Search is O(log n).Which is very fast in comparision to linear search. Features Binary…

Searching an Element in Array

Searching an element in array is very easy, we just need to iterate through every element in the array and if we find the element just prints its location otherwise just print "the element not…