Jim_Moriarty_'s blog

By Jim_Moriarty_, history, 5 years ago, In English

Can anyone explain !! How the complexity of building the merge sort is O(nlog(n)) . As if we build segment tree for maximum query it will take O(n) time because we had to cover approx 2*n to 4*n nodes and at each node merging two children nodes took O(1) time. But here in merge sort merging two children nodes takes O(n) time . So how come the complexity is O(nlog(n))?

  • Vote: I like it
  • +3
  • Vote: I do not like it