Photo by Kelly Sikkema on Unsplash

Selection sort

The algorithm first iteration selects the smallest element in the array and swaps it with the first element. The second iteration selects the second smallest item and swaps it with the second element. This continues until the second-largest item is swapped with the second to last index leaving the largest element in the last index.

Insertion sort

The first iteration of this algorithm considers the second element in the array if it is less than the first element then swaps it. …

Photo by Cookie the Pom on Unsplash

Java Collection

A collection is an object that holds references to other objects.

Some of the Collection Interfaces are:


Is an unordered collection that does not contain duplicate elements.


An ordered collection that contains duplicate elements.

List examples are:

ArrayList, LinkedList etc.


Is one with keys/values that aren’t duplicate but unique.

Some of the map classes are:

Hashtable, Hashmap, Hashsets etc.

Collection Methods

They help manipulate the collections as mentioned above.

fill — sets every list element to refer to a specific object.

copy — copies references from one list to another.

addAll — appends all elements…

Photo by STIL on Unsplash

Linear Search.

The Linear search algorithm is an algorithm that searches each element in an array in a sequence. If the searched-for element is found, the index of that element will be returned.

The efficiency of a Linear Search — Big O

This algorithm runs in O(n) time. The worst case is this algorithm will have to iterate through every element in an array until the searched-for element is found. In case the array is increased, so will be the number of iterations. …

Photo by Luke Chesser on Unsplash

Big O notation is how hard an algorithm has to work to solve a problem or, in technical terms, the worst-case run time for an algorithm.

O(1) — Constant run-time algorithm.

This is an algorithm that returns an element in a known position regardless of the data size or array. For instance, designing an algorithm to test if the first element of an array is equal to the second.

O(n) — Linear run-time algorithm

For this algorithm, the number of iterations grows as the number of array elements. This is expressed as (n-1) where n is the number of array…

Photo by Nick Morrison on Unsplash

Seek and you shall find, ask and you shall receive as it is mentioned in one of the oldest books ever written. So there I was, seeking for a learning community to acquire a structured flow of web development knowledge and skill. Thanks to the Facebook founder, an OutBox advert appeared on to my Facebook profile feeds giving me a week’s notice to apply for the course. I couldn’t look idly by and procrastinate, come on, I clicked that apply button and onboarded.

One evening, a notification appeared on my phone inviting me to the first class of orientation. Happy…

Michael Kasingye

I am a self-taught software developer in React JS, JavaScript and Java. I enjoy working in teams.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store