Selection Sort | Algorithms
In our previous articles, we have seen two of the searching algorithms like Binary Search and Fibonacci Search alogorithm. In this article, we will go through Selection Sort algorithm. Selection sort is one of the simplest sorting algorithm available. Before going into more details we will see first see why sorting is required in programming. Sorting […]
Fibonacci search
In this article, we will see one more searching algorithm Fibonacci search. This searching algorithm has some similarity with Binary Search that we have seen in our last article. Both of them works on sorted arrays. Fibonacci Search is a comparison-based technique that uses Fibonacci numbers to search an element in a sorted array. Fibonacci Search Definition […]
Binary Search
There are many ways to search for the element from the given sorted array of n elements. Linear search, binary search, Fibonacci Search are few of them. In this article, we will see the binary search in detail. Binary search enables searching of the element in O(log n) time complexity. Binary Search (definition) Search a sorted […]
How is HashSet implemented internally in Java?
In our previous article, we have seen internal implementation of SynchronizedMap and the difference between HashMap, Hashtable, SynchronizedMap and ConcurrentMap. In this article, we will understand how does HashSet work internally? How JDK implementers have reused HashMap effectively for HashSet implementation. The best way to understand internal implementation of any built-in Java class is by looking into its […]
Hashtable vs SynchronizedMap vs ConcurrentHashMap
Java Collection classes are heart of Java API. It is essential to use built-in java collections like HashMap, ArrayList or LinkedList for accessing, storing and processing data in java applications. For Example, we have extensively used HashMap to transfer data between two layers of our MVC framework. In all core java interviews, you will definitely face questions on […]
View vs Materialized View | Oracle SQL
Every Java Developer is expected to have basic knowledge of database like SQL Queries, joins, having clause, group by, views, stored procedures, cursors, triggers, etc. If you are preparing for Java / J2EE interview, you should also prepare basic SQL interview questions. In our previous article on SQL interview Questions, we have seen differences between UNION and UNION […]
String Pool | Java
String pool in Java is a pool of String literals and interned Strings in JVM for efficient use of String object. Since String is Immutable Class In Java, it makes sense to cache and shares them in JVM. Java creators introduced this String pool construct as an optimization on the way String objects are allocated […]
Access Modifiers in Java
In this article, we will discuss one of the basic feature of Java- Access Modifiers. As the name suggests access modifiers in Java helps to restrict the scope of a class, constructor, variable, method or data member. Assigning an access modifier to a class, constructor, field or method is also sometimes referred to as "marking" that […]
Program to find nth digit of the series 3, 5, 6, 9, 10, 12, …
Bit Manipulation programming questions are integral part of any online coding challenges or programming rounds of 3-4 year exp Java/C/Python developer interviews. So, why are we talking about bit manipulation in this series problem? Lets look at the binary representation of all the numbers in this series. Decimal Digit Binary Representation 3 0011 5 0101 6 […]
Program to check if a given number is power of two or not?
In this post, we will discuss about one of the easiest and commonly asked Bit Manipulation Interview Question i.e. Write a program to check if a given number is power of two or not? This post is continuation of our previuos article Program To Find Number Of Set Bits In The Number. Both of the approach […]