ARRAYS (implemented from scratch)

Поделиться
HTML-код
  • Опубликовано: 2 дек 2024
  • In this video I implement the ArrayList data structure from scratch :)

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

  • @jamesperalta35
    @jamesperalta35  8 часов назад

    CLARIFICATION: I’m demonstrating how to use a fixed array to implement a dynamic sizing array. I’m using Python so there’s no concept of a fixed array but if we were to use Java or any other language where the array is a fixed size, then it makes more sense. Either way these principles still hold on how to create a dynamic array from a fixed array regardless of the language 😅!

    • @p1nkflow
      @p1nkflow 8 часов назад +1

      so just use C/C++ to show how python lists really work. This video is confusing for beginners

    • @jamesperalta35
      @jamesperalta35  7 часов назад +1

      @@p1nkflow Sure thanks for the feedback! I'll re-make this video in C in the coming weeks.

  • @shantanukulkarni8883
    @shantanukulkarni8883 2 дня назад +6

    Can you make a video about Natural Talent vs Hard Work? I see so many people who seem naturally good at problem solving. Their IQ is just higher. I know about having a growth mindset and how the brain literally grows when we learn new things... but some people are naturally better at making those connections. Some people learn a lot faster and even retain those things. So it makes me question whether is it even worth it to put in the efforts? I do try to still keep learning, but every so often I see people like you 😅 who are really good, and leads to inferiority complex issues.

    • @jamesperalta35
      @jamesperalta35  День назад +2

      Hey @shantanukulkarni8883 - that's a great video idea! Like you mentioned - I think having a growth mindset is key here and not comparing yourself to others but instead comparing yourself to ONLY yourself from yesterday, yourself from 6 months ago, yourself from 2 years ago. Sounds cliché but what I mean by that is focus on things that you want to learn or gaps in your knowledge and then work to improve those, once you do, look for more gaps and improve those, REPEAT over and over lol... You'll get really good after a couple years of doing that.
      I think it's definitely the case that some people learn faster than others but I still think you can get reallllly good (95th percentile) from just working at it everyday. If you are still trying to keep learning then you are already doing more than a lot of people so keep it up!! Mastery takes time and I'm still striving to get better everyday as well.
      I have more thoughts on this but it probably warrants a full video :). Will post back here when it's uploaded.

    • @johnperaltaCFA
      @johnperaltaCFA День назад +2

      @@shantanukulkarni8883 lol how do u know this guy has natural talent 😂 I think James’ IQ is lower than average 🤪

    • @jamesperalta35
      @jamesperalta35  День назад +2

      hahah maybe we should do IQ tests on our channels

    • @johnperaltaCFA
      @johnperaltaCFA День назад +2

      @@jamesperalta35😂 bruh the IQ below average but the work ethic way above average 🤫

    • @jamesperalta35
      @jamesperalta35  День назад +1

      @@johnperaltaCFA hahah will explore this in a dedicated video

  • @valeriagamez1509
    @valeriagamez1509 День назад +1

    great video!!!🙌💚

  • @jamesperalta35
    @jamesperalta35  День назад

    Just dropped 6 new videos! “Everything you need to know” and “Implemented from scratch” for LinkedLists, Stacks, and Queues. Happy December y’all! 🎄
    Playlist: m.ruclips.net/p/PL1_cEA1Q0Z8-WO_mXqu8Nf0ObhxhqnBI-

  • @johnperaltaCFA
    @johnperaltaCFA День назад +2

    Lol let me stick with numpy array

  • @p1nkflow
    @p1nkflow 8 часов назад

    That's just weird data structure that is using data structure where every feature you are implementing is already implemented. It's just an overhead on top of pythons list

    • @jamesperalta35
      @jamesperalta35  8 часов назад

      I’m demonstrating how to use a fixed array to implement a dynamic sizing array. I’m using Python so there’s no concept of a fixed array but if we were to use Java or any other language where the array is a fixed size, then it makes more sense. Either way these principles still hold on how to create a dynamic array from a fixed array.
      Try prompting Chat GPT to build you a dynamic sizing array from scratch in C or C++ and you’ll see the code generated is very similar to this.

    • @p1nkflow
      @p1nkflow 8 часов назад

      @@jamesperalta35 just use C++ to show how python lists really work. This video is gonna be confusing for those who are trying to learn things

    • @p1nkflow
      @p1nkflow 8 часов назад

      ​@@jamesperalta35 so just use C/C++ to show how python lists really work. This video is confusing for beginners

    • @p1nkflow
      @p1nkflow 8 часов назад

      @@jamesperalta35 so just use C/C++ to show how python lists really work. This video is confusing for beginners

  • @mitswadas
    @mitswadas День назад +1

    Bro you are using array to implement array this is not from scratch

    • @jamesperalta35
      @jamesperalta35  День назад

      I’m demonstrating how to use an Array (which is fixed size in some languages) to implement a dynamic sizing array. I’m using Python so there’s no concept of a fixed array. But if we were to use Java or any other language where the array is a fixed size then it makes more sense. Either way these principles still hold on how to create a dynamic array from a fixed array.

    • @jamesperalta35
      @jamesperalta35  День назад

      ⁠other sources: www.geeksforgeeks.org/internal-working-of-arraylist-in-java/

    • @jamesperalta35
      @jamesperalta35  День назад

      Go on Chat GPT and ask it to build you an ArrayList from scratch in C and you’ll see the code is very similar to this.

    • @paulnikonowicz
      @paulnikonowicz 20 часов назад

      @@jamesperalta35 chat GPT is wrong then. here's a hint on how to create an array from scratch in python:
      ```
      import io
      # Create a memory block of 1024 bytes initialized with zeros
      memory_block = io.BytesIO(bytearray(1024))
      # Write the number 4 to the third byte (index 2, since indexing starts at 0)
      memory_block.seek(2) # Move the cursor to the third byte
      memory_block.write(b'\x04') # Write the value 4 as a single byte
      # To verify the change, read back the third byte
      memory_block.seek(2)
      third_byte = memory_block.read(1)
      print(f"Third byte value: {third_byte[0]}") # Should output 4
      ```

  • @mitswadas
    @mitswadas День назад

    And you just implemented a wierd queue data structure 😂😂. You are not even memory managing it.

    • @jamesperalta35
      @jamesperalta35  День назад

      In Python, memory management is handled automatically under the hood by the Python memory manager and garbage collector. Do you know of another way I could have implemented this?