Category: Java

Named Pipes with Java

In this post, we will discuss using Named Pipes with Java. Let’s start with a brief overview of Pipes and Named Pipes. Overview: On Unix, a pipe is a channel of communication between two processes, also known as ‘interprocess communication’ (IPC). Pipes are unidirectional, meaning that data travels in one direction at one time. Pipes have a read end and a write end. Data written to the write end of...

Merge Sort: Implementation and Analysis

Merge Sort Merge sort is a divide and conquer algorithm that sorts objects in O(n log n) time. Merge sort begins by dividing the input list into two sublists, and then continues to divide each subsequent sublist until we are left with a bunch of sublists that each contain one element. Each one element list is considered sorted. Next, Merge sort conquers each sorted sublist by repeatedly merging adjacent sorted...

Insertion Sort: Implementation and Analysis

Insertion Sort Overview Insertion sort is simple, but poorly performing sort algorithm that can sort a list in place. The Insertion sort algorithm works by splitting the input list into two partitions; a sorted part and an unsorted part. At the start of Insertion sort, the sorted part consists of 1 item; the first item in the input. Insertion sort then takes the first item of the unsorted part and...

Bubble Sort: Implementation and Analysis

Bubble Sort Overview Bubble Sort is a simple sort algorithm. When sorting a given list of items, in general, Bubble sort will make multiple passes over the list of items. During each pass, Bubble sort compares each adjacent pair of items. If the pair is in the correct order, Bubble sort does nothing and moves to the next adjacent pair. If the pair is out of order, Bubble sort swaps...

TestNG Basics

Unit tests are written to ensure that small units of code function as intended. When it comes to Unit tests, the higher your code coverage, the higher your confidence when refactoring and/or extending code functions and features. Unit tests play an incredibly important role when it comes to sustaining and maintaining code. TestNG is a simple, yet powerful unit test framework for Java. TestNG enables you to construct test cases...