function merged_array = merge(left_array, right_array)

	if (isempty(left_array)) |	(isempty(right_array))
	  merged_array = [left_array right_array];
	else
	  if (left_array(1) <= right_array(1))
	    merged_array = [left_array(1) merge(left_array(2:end), right_array)];
	  else
	    merged_array = [right_array(1) merge(left_array, right_array(2:end))];
	  end
	end
