- 76
- 254 965
ByteQuest
India
Приєднався 1 лип 2023
Here you will see animated videos about computer science topics like Algorithms, Security, Data structures and others.
Sometimes also about Maths and Puzzles.
Sometimes also about Maths and Puzzles.
LeetCode 53 | Maximum Subarray Solution (Kadane's Algorithm) Visually Explained | Top Interview 150
Welcome to a clear and concise walkthrough of #LeetCode 53: Maximum Subarray, a cornerstone problem from the Top Interview 150 list! 🚀
In this video, we skip over complex and unnecessary methods and dive straight into the most efficient solution using Kadane's Algorithm, which runs in O(n) time complexity and uses O(1) space complexity.
✅ What you'll learn:
Quick and intuitive explanation of the problem:
We'll discuss how the task is to find the contiguous subarray with the largest sum, and why brute force solutions (checking all subarrays) are inefficient.
The optimized solution step-by-step:
Learn how Kadane's Algorithm works by iteratively maintaining the maximum sum so far and the current sum for the subarray.
Code walkthrough:
We'll break down the Python implementation of Kadane’s Algorithm, which can easily be adapted to any programming language of your choice.
Github link for the code:- github.com/ByteQuest0/Leetcode/tree/main/53.%20Maximum%20Subarray
LeetCode problem link:- leetcode.com/problems/maximum-subarray/description/
tools used to make the video:- Manim (python lib) for animation, premier pro for video editing, and a TTS model.
Music used:-
Sovereign by Kevin MacLeod | incompetech.com/
Music promoted by www.chosic.com/free-music/all/
Creative Commons CC BY 3.0
creativecommons.org/licenses/by/3.0/
In this video, we skip over complex and unnecessary methods and dive straight into the most efficient solution using Kadane's Algorithm, which runs in O(n) time complexity and uses O(1) space complexity.
✅ What you'll learn:
Quick and intuitive explanation of the problem:
We'll discuss how the task is to find the contiguous subarray with the largest sum, and why brute force solutions (checking all subarrays) are inefficient.
The optimized solution step-by-step:
Learn how Kadane's Algorithm works by iteratively maintaining the maximum sum so far and the current sum for the subarray.
Code walkthrough:
We'll break down the Python implementation of Kadane’s Algorithm, which can easily be adapted to any programming language of your choice.
Github link for the code:- github.com/ByteQuest0/Leetcode/tree/main/53.%20Maximum%20Subarray
LeetCode problem link:- leetcode.com/problems/maximum-subarray/description/
tools used to make the video:- Manim (python lib) for animation, premier pro for video editing, and a TTS model.
Music used:-
Sovereign by Kevin MacLeod | incompetech.com/
Music promoted by www.chosic.com/free-music/all/
Creative Commons CC BY 3.0
creativecommons.org/licenses/by/3.0/
Переглядів: 366
Відео
LeetCode 189 | Rotate Array Solution Visually Explained | Top Interview 150 |
Переглядів 33512 годин тому
Welcome to a clear and concise walkthrough of #LeetCode 189: Rotate Array, one of the must-know problems from the Top Interview 150 list! 🚀 In this video, we skip the unnecessary brute force solutions and dive straight into the efficient approach that solves the problem with O(n) time complexity and O(1) space complexity. ✅ What you'll learn: A quick and intuitive explanation of the problem. Th...
Data Structures And Algorithms Visually Explained | Full Course In 4 Hours
Переглядів 9 тис.14 днів тому
This video offers a comprehensive collection of animated lessons on Data Structures and Algorithms, presented in a unique and intuitive way that makes the concepts easier to grasp compared to traditional blackboard-style teaching. Most of the data structures in the video are implemented in Python, and the animations are also created using Python. The video on arrays features my own human voice,...
Hash Tables Visually Explained
Переглядів 46014 днів тому
In this video the hash table data structure has been explained visually using animation. first the basic idea of hash table is explaned, and then how insertion works? what is a collion? followed by how collisions are handelled. first method of collision handeling shown is called chaining, in which the insertion and deletion has been explained. Then in the other techniques such as Double hashing...
Kruskal's Algorithm Visually Explained | Disjoint Sets | Union By Rank | Path Compression
Переглядів 39721 день тому
In this video, I have explain How Kruskal's Algorithm Of Finding The minimum spanning tree of a graph works, i have explained how the algorithm works, then I've explained how Cycle detection works using Disjoint sets, where i have discuss the Union By rank method along with path compression, then the time and space complexitites of it followed by the python implementation. GitHub link for the c...
Prim's Algorithm Visually Explained | Minimum Spanning Tree
Переглядів 208Місяць тому
This video contains a visual demonstration of Prim's algorithm and the code. this algorithm is used to find the minimum spanning tree of a graph. tools used:- Manim for animations, premier pro for video editing and chatGPT TTS.
Floyd-Warshall Algorithm Explained
Переглядів 1,7 тис.Місяць тому
in this video, the Floyd-Warshall Algorithm for finding the shortest path between any pair of nodes in a graph has been explained visually. Here we use the adjacency matrix of the graph and update it iteratively by checking a shorter path via Each node and if a shorter path is found we update the matrices. We repeat this for all the nodes. Bellman-Ford Algorithm:- ua-cam.com/video/B5PmlJACZ9Y/v...
Bellman Ford Shortest Path Algorithm
Переглядів 2,5 тис.Місяць тому
In this video, Bellman-Ford Algorithm Algorithm for finding the shortest path from one one node to all the other nodes has been explain. first, it creates a table where all the nodes are stored as well as the cost of the shortest path to reach that node as well as their previous element in the order. The Algorithm starts by initializing the distances to all nodes as infinity, except for the sta...
25 CyberSecurity Terms You Should Know
Переглядів 761Місяць тому
This video uses animations and graphics to provide quick and brief descriptions of 25 cybersecurity terms that everyone should know without much technical detail. tools used to make this video: Manim animation library (by 3B1B), Adobe Premier Pro, and AI-generated images. keyframes:- 0:00 - 0:34 End-to-End Encryption 0:35 - 1:03 Symmetric Encryption 1:04 - 1:49 Asymmetric Encryption 1:50 - 2:40...
Dijkstra's Algorithm Visually Explained | Dijsktra's Shortest Path Algorithm
Переглядів 429Місяць тому
In this video, Dijkstra's Algorithm for finding the shortest path from one one node to all the other nodes has been explain. first, it creates a table where all the nodes are stored as well as the cost of the shortest path to reach that node as well as their previous element in the order. it then starts from the starting node and iteratively starts going to each node based on the ordering of th...
Heaps Visually Explained (Priority Queues)
Переглядів 7812 місяці тому
in this video, I have explained how the Heap Data structure works using a visual representation of Max Heap. I have included the insertion, deletion, and building heap from array operation along with their Python implementation code. also at the last, I've explained How this is used to build priority queues. The Voice in the video is not mine, it is generated using an online TTS tool so sometim...
BFS Visually Explained (Graphs)
Переглядів 2872 місяці тому
this video contains a visual animated explanation of the BFS or Breadth-First-Search Algorithm in Graphs. the video also contains the implementation in Python. GitHub Link:- github.com/ByteQuest0/Implemention_codes/blob/main/Graph/bfs.py This channel also has similar animated algorithms and data structure videos that you might find useful:- Knuth-Morris-Pratt Algorithm:- ua-cam.com/video/q4_90f...
DFS Visually Explained (Graphs)
Переглядів 3862 місяці тому
This video contains the DFS Algorithm Visual Explanation using Animation. both recursive and iterative versions of the Algorithm have been explained along with the Python code. 0:00 - 3:40 Recursive Approach 3:41 - 7:40 Iterative Approach GitHub Code Link:-github.com/ByteQuest0/Implemention_codes/blob/main/Graph/dfs.py Tools Used: Manim Python Library. Music Used:- Sovereign by Kevin MacLeod | ...
Introduction To Graphs
Переглядів 2202 місяці тому
0:00 - 4:10 Intro 4:11- 8:12 Adjacency Matrix 8:12- 12:00 Adjacency Lists Tools Used:- Manim (open-source animation Library), Python, Premier Pro. Music used:- Sovereign by Kevin MacLeod | incompetech.com/ Music promoted by www.chosic.com/free-music/all/ Creative Commons CC BY 3.0 creativecommons.org/licenses/by/3.0/
5 Sorting Algorithms Every Programmer Should Know
Переглядів 4774 місяці тому
5 Sorting Algorithms Every Programmer Should Know
Binary Search Tree Visually Explained
Переглядів 2234 місяці тому
Binary Search Tree Visually Explained
Complexity Analysis and The Big O Notation
Переглядів 1526 місяців тому
Complexity Analysis and The Big O Notation
Knuth-Morris-Pratt Algorithm Visually Explained
Переглядів 21 тис.11 місяців тому
Knuth-Morris-Pratt Algorithm Visually Explained
Rabin-Karp Algorithm Visually Explained
Переглядів 1,8 тис.Рік тому
Rabin-Karp Algorithm Visually Explained
Awesome tutorial. Not where I thought that was going
لا بأس بالمحتوى التقني ايضا👍
Aahhhhhhh.... So he wrote at the bottom found at 5 10 How did he figure this out? Shoudnt it be 5 13? Aahhhh....why coudnt ge complete the full thing?..he forgot the main thing..where does the pattern start and end..how to find that Anyone tell me this
It means that if you start matching the text and pattern from index 5 or 10, you'll find a match.
@@Byte_Quest still didn't get it... The pattern in the text is from 5 to 13 correct? So how is it possible to start from 10, nevertheless end at 10 but not 13,because pattern in text goes upto 13..basic and easy question I'm asking & therefore Expecting an easy and basic answer(asap,as i have my exam on 21st) Thank you
That's how the KMP Algorithm is designed. 5 to 13 is a match and 10 to 18 as well. Those two matches are overlapping, that's why KMP started matching from 13 directly (because it already knows that from 10 to 13 is matching)
@@Byte_Quest so what's the final answer? Wht am i supposed to write in my exam?
Write that it finds multiple instances of the pattern in the text in linear time. It avoids matching cells unnecessarily using the LPS table information. And how the algorithm works...
may i know what is blockchain?
Decentralised, since the database is distributed across multiple nodes.
this visualization is so well done
You can check out the long video on the channel for more detailed explanation.
Amazing video, thanks!
Very good sir
absolutly loved it! i always wanted visually explained solutions of LeeCode Questions.
These are amazing! Thank you for creating so much quality content. Manim question: how do you label the edges in your weighted graphs? I've only found workarounds using unofficial plugins that don't look very good and may become outdated someday
I take the midpoint of the edge, and adjust the text Mobject around. The code is on GitHub, try it out.
spectacular thank you!!!
After union with C, A's rank should be 2, isn't it!! And after union with D it's rank should be further increased from 2!!
We're doing "Union by rank" so no need. If we were doing Union by weight we would have further increased. You can modify your code and make it like that.
Excellent explanation! Although, I must say using `l` instead of `j` for the prefix-suffix array part was quite confusing at first. Like when `lps[i]` gets updated to `l` when `pattern[i] == pattern[l]`, I thought it was being updated to the value 1 and was confused lol But the visuals helped me understand the KMP algorithm on a deeper level, and that's all that matters, so thank you!
Aha, yes while creating the LPS array.
The problem with all these KMP videos is , they are all jumping from naive approach directly to a pattern of suffix==prefix matching ( abc...abc ). What if the pattern is "abcde" ? Which I think is the most crucial part of the algo.
Hey, that's an excellent question. Worth pinning. You provided the pattern:- "abcde" So the LPS array will be: [0,0,0,0,0]. Now keep in mind that i always move forward (no backtracking). When the current j (pattern letter) matches the current i (text letter) they both get incremented by 1. And when they mismatch and j is 0, i get an increment by 1 and if j is not zero, it will go to the target index found using the LPS table. Now the key idea is that i always move forward. Hence the overall complexity remains linear.
this is called education🔥🔥. If educational activities feel boring, it's a scam
Thanks
You have a great voice. I hope the decision was to save your throat and not imposter syndrome. Would you like to sell it?
Thanks, i thought I needed a little bit of practice regarding the voice but i will use my own voice after a few weeks.
There is one mistake I found: if pat[j]==text[i]: i+=1 j+=1 if j==m: print(i-j) j=lps_[j-1]
It's a micro-optimisation. Won't really affect the runtime much.
So is a DNF Spoofing similar to a man in the middle attack ?
In MiTM attack, the hacker intercepts the message between 2 parties, here the attacker redirects the victim to somewhere else than intended.
I hope this video gets more views
superbbb... 🌟
Hi, Can any one tell which software we can use to make this kind of video
I use Manim, which is a free python library.
❤❤❤can't thank u enough brother 🙏
Thanks a lort bro it more helpfull
Great content! Great animations!
Can you please explain how you came to the bruteforce time complexity of O((n - m + 1) * m / 2) specifically the m / 2 part. I understand the n - m + 1 part since we are not looping the full string. I am not able to understand the m / 2 part. Unless we are doing some optimisation to reduce the pattern searching by half which is not possible/ we are not doing in bruteforce. You have mentioned: On average, it compares m / 2 characters which I don't think is the case or even if it is the case, we don't give time complexity considering average cases or best cases. We give it according to worst cases. So at the end, the time complexity would come to O((n - m + 1) * m) which we can say as O(n * m).
The pattern will go over the text n - m + 1 times, In each iteration, while matching the corresponding letters, if any letter didn't match we break the inner loop without checking further letters.... So sometimes the matching runs nearly as long as the pattern length and sometimes it breaks earlier... So we conclude that half the letters are matching on an average.
Bro u should have so much more Subs. Keep on buddy!!!!!!!!
The individual videos are also available on the channel, you can checkout. This video is just an ordered merged video.
DSA playlist should have all these subsections as individual videos in the right order. Just a suggestion.
It is already there, i just merged all this in one video for Algorithm to catch.
Okay yes. The Videos seem to be in reverse order, may be my youtube settings are wrong.
They're little outta order.
okay np.
This is god-sent. Thank you very much for your hard work.
Thanks for such kind words. Stay connected, more high quality contents are under production.
Great video great work brother🫡🫡🔥🔥🔥 subbed 🙌
underrated
Thank you sooooooo much!!! Self explanatory now😊
Happy to help!
useful content thanks btw brother!
Glad to help out!
GREAT
thank you
Sweet, can you make an intro to python series ?
This is a good idea, maybe a 30 minute video covering the following:- Starting from data types, variables, etc... Basic arithmetic, conditions, Loops... Error Handling.... Functions.... Recursion... OOP and others....... Will work on it next....thanks..
@ yesssss!!! Exactly!!!
Thanks 👍🏼
Underrated channel. High quality video. Starting was a little abrupt but the explanation in the video is so detailed. Absolutely love it.
Thanks for the feedback!
Nice video 👍
thanks
You're welcome!
AWESOME!!
Awesome!!
what is the shortest path from A to D ?
A -> F -> B -> E -> C -> G -> D
I have a doubt. For example, A is the sender, B is the receiver, and C is a hacker. A encrypts the text (e.g., "I am Ashwin") using B's public key. Is there a chance that C (the hacker) could modify the text (e.g., to "I am Vinoth") using the same public key of B? If so, when B decrypts the message using B's private key, they would get the text "I am Vinoth" instead of "I am Ashwin." In this case, C (the hacker) cannot see the original message sent by A but has modified the message that was sent by A.
C can intercept and replace the original message by encrypting a new message (e.g., "I am Vinoth") using B's public key. However, C cannot read the original message sent by A or impersonate A authentically without A's private key. To prevent such attacks, A can use a digital signature to sign the message before encrypting it. This ensures that B can verify the message's authenticity and detect any tampering. Secure protocols like TLS/SSL can also protect the communication from interception. C cannot directly modify the message that has been encrypted by A. It would lead to dara corruption.