Data Structures in Typescript #11 - Circular Buffer Introduction

Поділитися
Вставка
  • Опубліковано 28 лис 2024

КОМЕНТАРІ • 16

  • @wulymammoth
    @wulymammoth 4 роки тому

    quick, concise, and useful

  • @ericlespiana3193
    @ericlespiana3193 Місяць тому

    good job! thanks bro

  • @ajwaus
    @ajwaus Місяць тому

    Thank you

  • @simon-r
    @simon-r 2 роки тому +1

    Isn't it's better to use a simple array or arrayList?

  • @playertwo9895
    @playertwo9895 3 роки тому +1

    I guess its case dependent but wouldn't overwriting the data at the current readIndex lead to inconsistent results? For example, in the animated diagram of the circular buffer, if the processor is busy but the user keeps typing, if they enqueue enough times to force an overwrite of the current read index, the data will be lost forever (due to a busy processor).
    I figure the example is sort of unlikely (since the buffer would either be large enough or the processor would be fast enough to avoid this), but wouldn't it make more sense to move unread data that's being overwritten to some other array? Or have multiple levels to a circular buffer?

    • @henrychan720
      @henrychan720 3 роки тому

      Just write until current readIndex - 1?

  • @tnczm
    @tnczm 3 роки тому

    thanks for the explanation, very helpful

    • @rylandethan4949
      @rylandethan4949 3 роки тому

      I know Im randomly asking but does anyone know of a tool to get back into an Instagram account..?
      I was stupid lost the login password. I would appreciate any tricks you can give me.

    • @gideonjake6475
      @gideonjake6475 3 роки тому

      @Ryland Ethan Instablaster ;)

    • @rylandethan4949
      @rylandethan4949 3 роки тому

      @Gideon Jake i really appreciate your reply. I got to the site on google and Im waiting for the hacking stuff now.
      Seems to take a while so I will get back to you later with my results.

    • @rylandethan4949
      @rylandethan4949 3 роки тому

      @Gideon Jake it did the trick and I finally got access to my account again. I am so happy:D
      Thank you so much, you saved my ass !

    • @gideonjake6475
      @gideonjake6475 3 роки тому

      @Ryland Ethan Happy to help xD

  • @karenhompland7654
    @karenhompland7654 2 роки тому

    Why is 8 overwritten at enqueue(17)? It has not been read yet and will now be overwritten adn "lost"?

    • @gtav1163
      @gtav1163 2 роки тому

      1:16 - 1:22 , this the why it's circular, it has fixed size like a circle and if the write pointer point to the same pointer as the read, it will overwrite 'stale' data, that hasn't been read.

  • @emmajennnings5920
    @emmajennnings5920 2 роки тому

    thanks

  • @skisgy
    @skisgy 4 роки тому +1

    The sun is a circular buffer...i see it buffer everyday