Below you will find pages that utilize the taxonomy term “Java”
April 27, 2018
Undertow REST API
Part of my daily routine is to consume, design and deliver services built for HTTP clients. This might manifest in something special like WebSocket, Protobuf but most often a plain JSON REST API. In any case, the performance is key, and an Undertow REST API with JAX-RS can deliver a stable performance under consistent load.
In this article, I will cover some basics for setting up and deploying a REST API with Undertow, in Docker.
December 1, 2016
Heapsort algorithm (Java)
Heapsort algorithm details: Worst-case Time Complexity: O(n log(n))
Space Complexity: O(1)
The algorithm The heapsort algorithm is an in-place, comparison based sorting algorithm. In the core of the algorithm (as the name suggest), the use of the heap data structure is improving the time complexity. In a nutshell, heap is a special type of tree, where the elements in the tree are in a certain order to each other. This allows to find the minimum or maximum of binary heap in O(1) and insertion/deletion in O(log(n)).
November 16, 2016
Merge sort algorithm (Java)
Merge sort algorithm details: Worst-case Time Complexity: O(n log(n))
Space Complexity: O()
The algorithm Merge sort is comparison based algorithm, from the efficient sorting category. The algorithm is based on “Divide and conquer” (John Van Neumann), which means in this case, that the original collection is divided into smaller chunks. This idea can be implemented in a recursive fashion, so that the collection is divided into single elements and then re-constructed into a sorted collection.
November 14, 2016
Bubble sort algorithm (Java)
Algorithm details: Worst-case Time Complexity: O(n^2)
Space Complexity: O(1)
The algorithm Bubble sort is a very simple sorting algorithm, with straight forward implementation. The algorithm is based on comparison of all elements to each other. The compared element positions are switched on the comparison result, and the element is shifted to the correct location. This implies, that each element has to be checked against each other. This results in n*n comparisons, even if the collection is in order.