Skip to content

Commit

Permalink
Update merge_sort.hpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Liam0205 authored Oct 24, 2018
1 parent 91826a7 commit 73fc66e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions c-cpp/12_sorts/merge_sort.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ void inplace_merge_sort(BidirIt first, BidirIt last, BinaryPred comp = BinaryPre
const auto len = std::distance(first, last);
if (len <= 1) { return; }
auto cut = first + len / 2;
merge_sort(first, cut, comp);
merge_sort(cut, last, comp);
inplace_merge_sort(first, cut, comp);
inplace_merge_sort(cut, last, comp);
std::inplace_merge(first, cut, last, comp);
}

Expand Down

0 comments on commit 73fc66e

Please sign in to comment.