Nth Largest Element in the list using Bubble Sort

Bubble sort algorithm is very slow sorting algorithm if we think about its running time O(n2), but it can be very useful in finding the nth largest element in the list. There are several ways to find the largest and smallest elements in an array/list, …

Remove consecutive duplicates from a list in Haskell

Suppose a given list of integers has some consecutive duplicate entries and it is required to remove those duplicates and to keep just one entry of that integer. This can be done in Haskell programming language using foldr or foldl functions. It can also be done …