Mergesort

Mergesort Mergesort is an efficient and widely used sorting algorithm. Stable sorting algorithm: preserves the order optimal time complexity: N log N in all cases suboptimal in space usage: usage of an extra array for merging Usage examples: Sorting Linked Read more…

Java Array Exercises

This article contains a series of exercises on java arrays, including resizing array implementation, merging sorted arrays, etc.. Resizing-array implementation A Java ArrayList is a resizable-array implementation of the List interface providing amortized-time for insertion of O(1). Exercise: implement a Read more…

Algorithms

Sorting, searching, and binary search Divide-and-conquer Dynamic programming and memorization Greedy algorithms Recursion Graph traversal, BFS and DFS Sorting Main algorithms presented Mergesort: Java sort for Objects Quicksort: Java sort for primitive types Heapsort Mergesort vs Quicksort vs Heapsort All Read more…