Implement Insertion Sort

แชร์
ฝัง
  • เผยแพร่เมื่อ 1 ก.พ. 2025

ความคิดเห็น • 7

  • @NeetCodeIO
    @NeetCodeIO  ปีที่แล้ว +2

    You can implement Insertion Sort yourself here: neetcode.io/problems/insertionSort
    A lot more content for neetcode.io on the way 🚀🚀🚀

    • @jeysiva_ap
      @jeysiva_ap ปีที่แล้ว

      Exited for this!

  • @ForfeitedBrains
    @ForfeitedBrains 6 หลายเดือนก่อน

    I know I am nitpicking here, but wouldn't it be better to use classic setup where n = 1 and j = n - 1? In this concrete example, because we need to append initial state to the result your approach is working well, but for general case we would have a blank first loop in forloop.

  • @doc9448
    @doc9448 9 หลายเดือนก่อน

    What did he mean by "because this is an object and we're continually modifying it"? 6:48

    • @AayushChaudharyGames
      @AayushChaudharyGames 6 หลายเดือนก่อน +1

      It means that if we directly add it to the result then it will act like a pointer then at the end of sorting all the items in `res` will be sorted since that is the last stage we find it in.

  • @jjhassy
    @jjhassy 5 หลายเดือนก่อน

    Did you get Nick Fuentes to narrate this?

  • @satwiktatikonda764
    @satwiktatikonda764 ปีที่แล้ว

    I think it would be better if the ratio of pro & nrml codes are 6:4 rather than 8:2