Data Structures in Typescript #11 - Circular Buffer Introduction

Поделиться
HTML-код
  • Опубликовано: 20 окт 2024

Комментарии • 15

  • @wulymammoth
    @wulymammoth 4 года назад

    quick, concise, and useful

  • @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?

  • @ajwaus
    @ajwaus 5 дней назад

    Thank you

  • @simon-r
    @simon-r 2 года назад

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

  • @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.

  • @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

  • @emmajennnings5920
    @emmajennnings5920 2 года назад

    thanks

  • @skisgy
    @skisgy 4 года назад +1

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