ar7aditya / DSA-Hacktoberfest-2022

DSA
MIT License
20 stars 64 forks source link

Create merge.java #173

Closed UTKARSHMOHAN2003 closed 1 year ago

UTKARSHMOHAN2003 commented 1 year ago

The merge function compares the elements of both sub-arrays one by one and places the smaller element into the input array. 2T(n/2) corresponds to the time required to sort the sub-arrays, and O(n) is the time to merge the entire array. When solved, the time complexity will come to O(nLogn).