Тёмный

Prefix Sum Array Explained 

Mike the Coder
Подписаться 19 тыс.
Просмотров 56 тыс.
50% 1

Hi guys,
My name is Michael Lin and this is my programming youtube channel. I like C++ and please message me or comment on what I should program next. It really helps out a lot.
Rate, Comment, Subscribe
Subscribe to my singing channel:
/ @michael89240
Personal Accounts:
Instagram: @michaellin250
Twitter: @Michaellin250

Опубликовано:

 

8 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 39   
@kender2272
@kender2272 Год назад
thank you, very well and simply explained, I'm writing my final school leaving exam soon, and I'm extending computer science(in my country you can choose extended additional subjects).
@gatusko123
@gatusko123 Год назад
This damn problem on LeetCode. Reading and trying to understand the solutions. But this video is the best one and the one finally understand it. Thank you very much man.
@walthertrgovac6087
@walthertrgovac6087 4 года назад
You explained that really good, thank you! It helped me a lot :D
@MiketheCoder
@MiketheCoder 4 года назад
No problem!
@rauljg143
@rauljg143 4 года назад
Great explanation. Thank you. "Prefix sum" kept coming in the context of loop-unrollling and I'm like "back up. what's a prefix sum???" Now I get it and can move on!
@aakashtiwari836
@aakashtiwari836 4 года назад
In which course and in which year you are???
@almuhimen8023
@almuhimen8023 4 года назад
What is loop unrolling?
@MiketheCoder
@MiketheCoder 3 года назад
loop unrolling is when you try to unroll the loop in assembly to make it more efficient, that's super exhausting to do though
@dThapa966
@dThapa966 Год назад
This was explained extremely well. Thank you very much !!
@MiketheCoder
@MiketheCoder Год назад
Glad it was helpful!
@Ashh_Man
@Ashh_Man 2 месяца назад
Giving a codeforces contest ,this really came in clutch,Great work!!
@taal7245
@taal7245 2 года назад
damn.. I just want to grab that pencil right off his hands, sharpen it. Then give it back to him!
@sunnyday12131
@sunnyday12131 2 года назад
Thanks for this, finally I got to know what prefix sum is and helps me solve leetcode 370!
@justmeandmy
@justmeandmy 4 месяца назад
What I'm struggling with is understanding how and when to use it for things beyond the prefix sum algo itself. eg - I know that facebook coding puzzle Director of Photography can be used to solve it, but I still don't really understand how to spot the use cases.
@thisjoman
@thisjoman 3 года назад
love you bro
@MiketheCoder
@MiketheCoder 3 года назад
love you too man!
@user-du3ly2yo4k
@user-du3ly2yo4k 3 года назад
great explanation
@MiketheCoder
@MiketheCoder Год назад
Glad you think so!
@pranavsudhir7645
@pranavsudhir7645 3 года назад
Amazing explanation Michael. Great job. Subscribed to your channel.
@MiketheCoder
@MiketheCoder 2 года назад
thanks!!
@abrarmasumabir3809
@abrarmasumabir3809 Год назад
Thanks brother! That was really cool!
@MiketheCoder
@MiketheCoder Год назад
You bet!
@egecalskan6355
@egecalskan6355 3 года назад
This video was very helpful, thank you!
@MiketheCoder
@MiketheCoder 3 года назад
Glad it was helpful!
@Yazan_Majdalawi
@Yazan_Majdalawi 11 месяцев назад
Thanks!
@xpluto13x
@xpluto13x 3 года назад
Saved me. Thank you
@MiketheCoder
@MiketheCoder 3 года назад
Glad it helped!
@bahrawygamer3929
@bahrawygamer3929 2 года назад
man ily
@mandeepkhadka388
@mandeepkhadka388 4 года назад
Can you also make a video on implementing a parallel version of Prefix Sum?
@MiketheCoder
@MiketheCoder 4 года назад
With multithreading???? Maybe. I’ll think about it.
@atulkrjha
@atulkrjha 11 месяцев назад
Hi Mike great video, So i am like little confused if it is given to calculate sum between 2 indexes except 0 i.e sum between 3 to 5 index why do we do PS[5] - PS[3-1] and not PS[5] - PS[3]
@MiketheCoder
@MiketheCoder 11 месяцев назад
It's because sometimes people like to start their prefix sum as value 0 first or not. Let's say you have: Arr: [1, 2, 3, 4, 5, 6] Pref: [1, 3,6, 10, 15, 21] Sum index 3 to 5: 4 + 5 + 6 = 15 To get that you need to do: 21 - 6 = pref[5] - pref[2] But if you start your prefix sum at 0: Pref: [0, 1, 3, 6, 10, 15, 21] 21 - 6 = pref[5 + 1] - pref[3] It depends how you want to start your prefix sum
@atulkrjha
@atulkrjha 11 месяцев назад
@@MiketheCoder Isn't our prefixSum would have length > than our original array if we start from 0?
@MiketheCoder
@MiketheCoder 11 месяцев назад
@@atulkrjha Yup, it really depends on the individual how they want to code it.
@srajputplays8054
@srajputplays8054 Год назад
noice😊
@mirsahib596
@mirsahib596 6 месяцев назад
So prefix sum is basically a version of sliding window technique
@prajwalchoudhary4824
@prajwalchoudhary4824 4 года назад
great explanation
@MiketheCoder
@MiketheCoder 4 года назад
Thank you!!
@juliancruz87
@juliancruz87 4 года назад
@@MiketheCoder you're such a great teacher explaining it!
Далее
How to Solve ANY LeetCode Problem (Step-by-Step)
12:37
Просмотров 203 тыс.
▼ЮТУБ ВСЁ, Я НА ЗАВОД 🚧⛔
30:49
Просмотров 291 тыс.
COMP526 3-7 §3.6 Parallel primitives, Prefix sum
38:50
Master Pointers in C:  10X Your C Coding!
14:12
Просмотров 304 тыс.
2D Prefix Sum and Submatrix Sum Queries
5:12
Просмотров 4,9 тыс.
LeetCode was HARD until I Learned these 15 Patterns
13:00
I gave 127 interviews. Top 5 Algorithms they asked me.
8:36
How to Use the Two Pointer Technique
10:56
Просмотров 100 тыс.
5 Simple Steps for Solving Any Recursive Problem
21:03