Implementation of merge function for merge sort
Basic data types