jjang36524's blog

By jjang36524, history, 4 years ago, In English

Have you ever implemented a sort(not using stl)?

I am a master and I implemented my first nlogn sort algorithm recently.

Do you implement sort during contest time?

  • Vote: I like it
  • -40
  • Vote: I do not like it

»
4 years ago, # |
  Vote: I like it +15 Vote: I do not like it

I remember taking an online computer science course (link) from Harvard before I was even interested in competitive programming, and I implemented merge sort using C.

  • »
    »
    4 years ago, # ^ |
      Vote: I like it +2 Vote: I do not like it

    WOW! My merge sort code had a lot of bug.

    • »
      »
      »
      4 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Here is my implementation in C++.

      Spoiler
»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

does implementing merge sort tree count?

»
4 years ago, # |
  Vote: I like it +14 Vote: I do not like it

When I first started CP I implemented bubble sort a few times because I was too lazy to figure out how to use the standard library sort. :P

»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

A lot earlier when I didn't know about std::pair I had to write my own sorting function whenever I needed to store the original index of elements so that I can take 2 different arrays (one for storing index)

»
4 years ago, # |
  Vote: I like it +29 Vote: I do not like it

Nah, I usually assert that the array comes already sorted. Sometimes it works.

»
4 years ago, # |
  Vote: I like it +10 Vote: I do not like it

some interactive problems you need to implement sorting with very little comparison.

Then you have to implement ford johnson :/

  • »
    »
    4 years ago, # ^ |
      Vote: I like it -26 Vote: I do not like it

    No comparision sort: counting sort, radix sort, etc. But not in interactive

»
4 years ago, # |
  Vote: I like it +1 Vote: I do not like it

Yeah this happened during the snackdown 2018 when we were in the first year of our college.One of my friend started writing merge sort code from his notes.Lol!

»
4 years ago, # |
  Vote: I like it +4 Vote: I do not like it

In the times of old (2006 I think) most people still used pascal in NEERCm and it lacks sort algorithm in it's standard library. One team almost got disqualified because they tried to hide prewritten sort algorithm in shortcut during practice session to have it ready for main contest