Java Algorithms and Implementations

This page list down all java algorithms and implementations discussed in this blog, for quick links. Feel free to suggest more algorithms you may want to learn.

Java Sorting Algorithms

  1. Quick Sort

    Quicksort is a divide and conquer algorithm, which means original array is divided into two arrays, each of them is sorted individually and then sorted output is merged to produce the sorted array.

  2. Merge Sort

    Merge sort is used when the data structure doesn’t support random access, since it works with pure sequential access (forward iterators, rather than random access iterators). It’s also widely used for external sorting, where random access can be very, very expensive compared to sequential access.

  3. Bubble Sort

    Bubble Sort is a simple and slow sorting algorithm that repeatedly steps through the collection, compares each pair of adjacent elements and swaps them if they are in the wrong order.

  4. Selection Sort

    Selection Sort is a simple and slow sorting algorithm that repeatedly selects the lowest or highest element from the un-sorted section and moves it to the end of the sorted section.

  5. Insertion Sort

    Insertion Sort is a simple and slow sorting algorithm that repeatedly takes the next element from the un-sorted section and inserts it into the sorted section at the correct position.

More Java Algorithms

Below are more Java Algorithms present in the blog.

  1. Phonetic search using Soundex algorithm

    Have you ever wondered how spell checkers, in any word editor, suggest you a list of probable other words whenever you have any spelling mistake?? This is done using phonetic search. Soundex is a phonetic algorithm for indexing names by sound, as pronounced in English.

  2. Compare and Swap [CAS] Algorithm

    This algorithm compares the contents of a memory location to a given value and, only if they are the same, modifies the contents of that memory location to a given new value. This is done as a single atomic operation.

  3. Password encryption using MD5, SHA, PBKDF2, BCrypt etc.

    A password hash is an encrypted sequence of characters obtained after applying certain algorithms and manipulations on user provided password, which are generally very weak and easy to guess. Let’s explore few algorithms to generate these hashes.

  4. How to detect infinite loop in linkedlist

    You are asked that if you have a linked list in which you can traverse only in one direction, and if that linked list has a loop in it, how you will detect it?? Let’s solve the problem.

  5. AES (Advanced Encryption Standard) Algorithm Example

    Advanced Encryption Standard which is a symmetric encryption algorithm. AES encryption is used by U.S. for securing sensitive but unclassified material, so we can say it is enough secure.

Happy Learning !!

Was this post helpful?

Join 7000+ Awesome Developers

Get the latest updates from industry, awesome resources, blog updates and much more.

* We do not spam !!

1 thought on “Java Algorithms and Implementations”

Comments are closed.


A blog about Java and related technologies, the best practices, algorithms, and interview questions.