Let's say you want to write an algorithm for MergeSort given the following:(adsbygoogle = window.adsbygoogle || []).push({}); I know the algorithm:Code (Text):public void(int[]a, int n1, int m, int n2)

MergeSort

1. If array has 1 element dont don anything

2. Split array in two halves

3. Sort the first half and the second half

4. Merge both halves into one.

Any help is appreciated

**Physics Forums | Science Articles, Homework Help, Discussion**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Homework Help: Comp Sci Problem

**Physics Forums | Science Articles, Homework Help, Discussion**