title
Data Structures and Algorithms in Python - Full Course for Beginners

description
A beginner-friendly introduction to common data structures (linked lists, stacks, queues, graphs) and algorithms (search, sorting, recursion, dynamic programming) in Python. This course will help you prepare for coding interviews and assessments. 🔗 Course website: https://jovian.ai/learn/data-structures-and-algorithms-in-python ✏️ Created by Aakash N S, founder and CEO of Jovian. ⭐️ Course Lessons with Code ⭐️ 🟢 Lesson 1 - Binary Search, Linked Lists and Complexity 💻 Linear and Binary Search: https://jovian.ai/aakashns/python-binary-search 💻 Problem Solving Template: https://jovian.ai/aakashns/python-problem-solving-template 💻 Linked Lists in Python: https://jovian.ai/aakashns/python-classes-and-linked-lists 🟢 Assignment 1 - Binary Search Practice 💻 Starter Notebook: https://jovian.ai/aakashns/python-binary-search-assignment 🟢 Lesson 2 - Binary Search Trees, Traversals and Recursion 💻 Binary Search Trees in Python: https://jovian.ai/aakashns/python-binary-search-trees 💻 Problem Solving Template: https://jovian.ai/aakashns/python-problem-solving-template 💻 Linked Lists in Python: https://jovian.ai/aakashns/python-classes-and-linked-lists 🟢 Assignment 2 - Hash Tables and Python Dictionaries 💻 Starter Notebook: https://jovian.ai/aakashns/python-hash-tables-assignment 🟢 Lesson 3 - Sorting Algorithms and Divide & Conquer 💻 Sorting and Divide & Conquer: https://jovian.ai/aakashns/python-sorting-divide-and-conquer 💻 Problem Solving Template: https://jovian.ai/aakashns/python-problem-solving-template 🟢 Assignment 3 - Divide and Conquer Practice 💻 Starter Notebook: https://jovian.ai/aakashns/python-divide-and-conquer-assignment 🟢 Lesson 4 - Recursion and Dynamic Programming 💻 Problem-solving template: https://jovian.ai/aakashns/python-problem-solving-template 💻 Dynamic Programming problems: https://jovian.ai/aakashns/dynamic-programming-problems 🟢 Lesson 5 - Graph Algorithms (BFS, DFS & Shortest Paths) 💻 Graphs and Graph Algorithms (Starter Notebook): https://jovian.ai/aakashns/python-graph-algorithms 🟢 Project - Step-by-Step Solution to a Programming Problem 💻 Starter Notebook: https://jovian.ai/aakashns/python-problem-solving-template 🟢 Lesson 6 - Python Interview Questions, Tips & Advice 💻 Problem solving template: https://jovian.ai/aakashns/python-problem-solving-template 💻 Coding problem 1: https://jovian.ai/aakashns/python-subarray-with-given-sum 💻 Coding problem 2: https://jovian.ai/aakashns/python-minimum-edit-distance ⭐️ Course Contents ⭐️ ⌨️ (00:00:00) Introduction ⌨️ (00:01:43) Binary Search Linked Lists and Complexity ⌨️ (00:03:43) Introduction ⌨️ (00:08:35) Problem ⌨️ (00:12:17) The Method ⌨️ (00:13:55) Solution ⌨️ (00:50:52) Complexity and Big O notation ⌨️ (01:24:57) Binary Search vs Linear Search ⌨️ (01:31:40) Generic Binary Search ⌨️ (01:40:08) Summary and Conclusion ⌨️ (01:44:30) Assignment Walkthrough ⌨️ (01:45:05) Introduction ⌨️ (01:50:01) Problem- Rotated Lists ⌨️ (01:53:02) The Method ⌨️ (01:54:03) Solution ⌨️ (02:30:47) Summary and Conclusion ⌨️ (02:33:29) Binary Search Trees Python Tutorial ⌨️ (02:34:41) Introduction ⌨️ (02:37:36) Problem ⌨️ (02:38:40) The Method ⌨️ (03:13:58) Binary tree ⌨️ (03:27:16) Traversing Binary Tree ⌨️ (03:36:10) Binary Search Tree ⌨️ (04:22:37) Self-Balancing Binary Trees and AVL Trees ⌨️ (04:26:27) Summary and Conclusion ⌨️ (04:30:33) Hash Tables and Python Dictionaries ⌨️ (04:31:09) Introduction ⌨️ (04:34:00) Problem ⌨️ (04:40:28) Data List ⌨️ (04:42:52) Hash Function ⌨️ (04:54:52) Basic Hash Table Implementation ⌨️ (05:03:07) Handling Collisions with Linear Probing ⌨️ (05:09:24) Summary and Conclusion ⌨️ (05:16:47) Sorting Algorithms and Divide & Conquer ⌨️ (05:17:48) Introduction ⌨️ (05:20:19) Problem ⌨️ (05:21:27) The Method ⌨️ (06:40:49) Custom Comparison Functions ⌨️ (06:48:53) Summary and Conclusion ⌨️ (06:54:57) Recursion Memoization & Dynamic Programming ⌨️ (06:56:37) Introduction ⌨️ (07:00:04) Problem ⌨️ (07:04:28) The Method ⌨️ (07:06:21) Solution ⌨️ (08:06:13) Knapsack Problems ⌨️ (08:08:48) The Method ⌨️ (08:09:24) Solution ⌨️ (08:43:26) Summary and Conclusion ⌨️ (08:44:05) Graph Algorithms BFS, DFS & Shortest Paths ⌨️ (08:45:02) Introduction ⌨️ (08:51:00) Graph Data Structure ⌨️ (09:15:57) Graph Algorithms - Breadth-First Search ⌨️ (09:37:28) Depth-First Search ⌨️ (10:08:26) Shortest Paths ⌨️ (10:40:39) Summary and Conclusion ⌨️ (10:42:21) Python Interview Questions Tips & Advice ⌨️ (10:43:09) Introduction ⌨️ (10:44:08) The Method ⌨️ (10:47:10) Solution ⌨️ (12:30:51) Summary and Conclusion

detail
{'title': 'Data Structures and Algorithms in Python - Full Course for Beginners', 'heatmap': [{'end': 16669.008, 'start': 16215.046, 'weight': 1}], 'summary': 'A 6-week beginner-friendly course covers data structures and algorithms in python, with 12 tutorials on python programming and mathematics, each about half an hour long. it discusses problem-solving strategies, binary search techniques, binary search and algorithm complexity, binary trees, sorting algorithms, dynamic programming, and graph representation and navigation, emphasizing practical applications and problem-solving techniques.', 'chapters': [{'end': 521.894, 'segs': [{'end': 79.469, 'src': 'embed', 'start': 24.857, 'weight': 1, 'content': [{'end': 29.16, 'text': 'You can also earn a verified certificate of accomplishment by completing this course.', 'start': 24.857, 'duration': 4.303}, {'end': 32.702, 'text': 'Learn more and register at pythondsa.com.', 'start': 29.82, 'duration': 2.882}, {'end': 41.628, 'text': 'This course runs over six weeks with two hour video lectures every week with live interactive coding using the Python programming language.', 'start': 33.362, 'duration': 8.266}, {'end': 49.414, 'text': 'You will get a chance to practice and improve your coding skills with weekly programming assignments consisting of real interview questions.', 'start': 42.208, 'duration': 7.206}, {'end': 54.878, 'text': 'And you will also build a course project that you can showcase on your resume or LinkedIn profile.', 'start': 49.854, 'duration': 5.024}, {'end': 60.42, 'text': 'This is a beginner friendly course and some basic programming knowledge will help you follow along with the course.', 'start': 55.518, 'duration': 4.902}, {'end': 65.963, 'text': "Don't worry if you're new to programming, you can learn it as you work on this course with a little extra effort.", 'start': 60.92, 'duration': 5.043}, {'end': 70.785, 'text': 'You will also get to access the course community forum, where you can ask questions,', 'start': 66.563, 'duration': 4.222}, {'end': 74.507, 'text': "participate in discussions and share what you're working on during the course.", 'start': 70.785, 'duration': 3.722}, {'end': 79.469, 'text': 'This course is created by Jovian, a platform for learning, data science and machine learning,', 'start': 74.987, 'duration': 4.482}], 'summary': '6-week python course with 2-hour lectures, programming assignments, and community forum.', 'duration': 54.612, 'max_score': 24.857, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA24857.jpg'}, {'end': 227.913, 'src': 'embed', 'start': 197.291, 'weight': 0, 'content': [{'end': 200.713, 'text': 'We have coding focused hands-on video tutorials every week.', 'start': 197.291, 'duration': 3.422}, {'end': 203.975, 'text': 'So you can either follow along with this video.', 'start': 201.513, 'duration': 2.462}, {'end': 212.439, 'text': 'You can pause and run the code as we speak, and you can practice coding on the cloud, or you can watch the video right now and you can practice later.', 'start': 203.995, 'duration': 8.444}, {'end': 222.152, 'text': 'In this course, we will solve questions from real programming interviews, and you can earn a verified certificate of accomplishment.', 'start': 215.191, 'duration': 6.961}, {'end': 227.913, 'text': "So let's go to lesson one binary search link lists and complexity.", 'start': 224.193, 'duration': 3.72}], 'summary': 'Weekly coding tutorials with real interview questions, offering a verified certificate.', 'duration': 30.622, 'max_score': 197.291, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA197291.jpg'}, {'end': 312.089, 'src': 'embed', 'start': 287.85, 'weight': 4, 'content': [{'end': 294.754, 'text': 'The tutorial will take you about half an hour or so each of these, and you can learn the basic programming with Python in just a couple of hours.', 'start': 287.85, 'duration': 6.904}, {'end': 297.736, 'text': 'You will also need to know some high school mathematics.', 'start': 295.455, 'duration': 2.281}, {'end': 306.204, 'text': 'And if you want to brush up things like polynomials, vectors, matrices and probabilities, you can click through and read these,', 'start': 299.017, 'duration': 7.187}, {'end': 309.466, 'text': 'but no prior knowledge of data structures or algorithms is required.', 'start': 306.204, 'duration': 3.262}, {'end': 312.089, 'text': 'You do not need to have an extensive coding background.', 'start': 309.827, 'duration': 2.262}], 'summary': 'Learn basic python programming in a couple of hours, with no prior coding background needed.', 'duration': 24.239, 'max_score': 287.85, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA287850.jpg'}, {'end': 375.709, 'src': 'embed', 'start': 347.429, 'weight': 6, 'content': [{'end': 350.472, 'text': "I'm going to use free online resources provided by Jovian.", 'start': 347.429, 'duration': 3.043}, {'end': 356.578, 'text': 'So we just scroll up here at the top of this page and click run, and then click run on binder.', 'start': 351.193, 'duration': 5.385}, {'end': 359.854, 'text': 'So this will take a second or two.', 'start': 358.393, 'duration': 1.461}, {'end': 365.8, 'text': "And what we're doing here essentially is setting up a machine for you on the cloud using a software called binder.", 'start': 360.335, 'duration': 5.465}, {'end': 367.001, 'text': "It's an open source software.", 'start': 365.92, 'duration': 1.081}, {'end': 373.307, 'text': 'And now what you were looking at here, this was actually not a blog post.', 'start': 367.842, 'duration': 5.465}, {'end': 375.709, 'text': 'This is actually something called a Jupiter notebook.', 'start': 373.407, 'duration': 2.302}], 'summary': "Using jovian's free online resources, setting up a cloud machine with binder and utilizing jupyter notebook.", 'duration': 28.28, 'max_score': 347.429, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA347429.jpg'}, {'end': 430.807, 'src': 'embed', 'start': 405.839, 'weight': 5, 'content': [{'end': 413.261, 'text': 'Now we will be using Jupyter notebooks extensively throughout this course, because Jupyter notebooks are a great way to do interactive programming.', 'start': 405.839, 'duration': 7.422}, {'end': 414.322, 'text': 'You can change the code.', 'start': 413.301, 'duration': 1.021}, {'end': 421.524, 'text': 'For example, instead of the mat mat dot square root, you can use mat dot seal and you can change the value here.', 'start': 415.942, 'duration': 5.582}, {'end': 425.385, 'text': 'So Jupyter notebooks are great for experimenting with code.', 'start': 422.924, 'duration': 2.461}, {'end': 430.807, 'text': 'Now, just a couple of tips that you want to do as soon as you run a Jupyter notebook.', 'start': 426.786, 'duration': 4.021}], 'summary': 'Jupyter notebooks allow interactive programming, enabling code experimentation and modification.', 'duration': 24.968, 'max_score': 405.839, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA405839.jpg'}], 'start': 0.129, 'title': 'Python dsa & intro to python programming', 'summary': 'Introduces a beginner-friendly online course on common data structures and algorithms in python, with a 6-week duration, and a 12-part tutorial on python programming and mathematics, each requiring about half an hour.', 'chapters': [{'end': 249.958, 'start': 0.129, 'title': 'Python dsa introduction', 'summary': 'Introduces a beginner-friendly online course on common data structures and algorithms in python, taught by akash ns, the co-founder and ceo of jovian, which runs over six weeks with two-hour video lectures every week, offers programming assignments and a course project, and allows participants to earn a verified certificate of accomplishment by completing the course.', 'duration': 249.829, 'highlights': ['The course runs over six weeks with two-hour video lectures every week', 'Participants can earn a verified certificate of accomplishment by completing the course', 'Participants can practice and improve coding skills with weekly programming assignments consisting of real interview questions', 'The course is created by Jovian, a platform with a global community of tens of thousands of learners from over 150 countries']}, {'end': 521.894, 'start': 252.419, 'title': 'Intro to python programming & mathematics', 'summary': 'Introduces a 12-part tutorial on python programming and mathematics, requiring about half an hour for each, with emphasis on jupyter notebooks and running the code using free online resources.', 'duration': 269.475, 'highlights': ['The course contains 12 tutorials on Python programming and mathematics, each taking about half an hour.', 'Emphasis on using Jupyter notebooks for interactive programming and code experimentation.', 'Instructions on running the code using free online resources like Jovian and Binder.']}], 'duration': 521.765, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA129.jpg', 'highlights': ['The course runs over six weeks with two-hour video lectures every week', 'Participants can earn a verified certificate of accomplishment by completing the course', 'Participants can practice and improve coding skills with weekly programming assignments consisting of real interview questions', 'The course is created by Jovian, a platform with a global community of tens of thousands of learners from over 150 countries', 'The course contains 12 tutorials on Python programming and mathematics, each taking about half an hour', 'Emphasis on using Jupyter notebooks for interactive programming and code experimentation', 'Instructions on running the code using free online resources like Jovian and Binder']}, {'end': 3535.4, 'segs': [{'end': 749.696, 'src': 'embed', 'start': 720.656, 'weight': 0, 'content': [{'end': 722.057, 'text': 'You may solve the problem.', 'start': 720.656, 'duration': 1.401}, {'end': 724.46, 'text': 'and still not clear the interview.', 'start': 723.178, 'duration': 1.282}, {'end': 731.028, 'text': 'So in this course, we will focus on the skills to both solve the problem and to clear interview successfully.', 'start': 724.82, 'duration': 6.208}, {'end': 735.053, 'text': "So that's why you need to learn data structures and algorithms.", 'start': 732.069, 'duration': 2.984}, {'end': 742.27, 'text': "So, coming back to the problem at hand now you've read the problem and you may have been thinking about it,", 'start': 737.526, 'duration': 4.744}, {'end': 744.272, 'text': 'and maybe you have some ideas on how to solve it.', 'start': 742.27, 'duration': 2.002}, {'end': 749.696, 'text': 'And your first instinct might be to just start writing the code for it, but that is not the optimal strategy.', 'start': 744.412, 'duration': 5.284}], 'summary': 'Focus on skills to solve problems and clear interviews by learning data structures and algorithms.', 'duration': 29.04, 'max_score': 720.656, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA720656.jpg'}, {'end': 853.783, 'src': 'embed', 'start': 821.998, 'weight': 2, 'content': [{'end': 827.721, 'text': 'So this is the technique that we will apply over and over for the course of six weeks to many different problems.', 'start': 821.998, 'duration': 5.723}, {'end': 833.205, 'text': 'And applying the right technique is where the knowledge of common data structures and algorithms comes in handy.', 'start': 828.741, 'duration': 4.464}, {'end': 835.447, 'text': "So this is the method we'll be using.", 'start': 834.206, 'duration': 1.241}, {'end': 837.289, 'text': "So let's jump into the solution.", 'start': 835.988, 'duration': 1.301}, {'end': 839.871, 'text': 'Step one, state the problem clearly.', 'start': 838.089, 'duration': 1.782}, {'end': 844.415, 'text': 'Now you will often encounter detailed word problems and coding challenges and interviews.', 'start': 840.572, 'duration': 3.843}, {'end': 846.196, 'text': 'They will go on for paragraphs and paragraphs.', 'start': 844.455, 'duration': 1.741}, {'end': 853.783, 'text': "For instance, here we're talking about Alice having a deck of cards and then shuffling them, putting them out on a table, talking to Bob, et cetera,", 'start': 846.236, 'duration': 7.547}], 'summary': 'Applying technique to various problems over 6 weeks, using data structures, and algorithms, solving detailed word problems and coding challenges.', 'duration': 31.785, 'max_score': 821.998, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA821998.jpg'}, {'end': 1151.79, 'src': 'embed', 'start': 1116.17, 'weight': 4, 'content': [{'end': 1120.591, 'text': "then discuss the problem with the interviewer if you're unsure how to frame it in abstract terms.", 'start': 1116.17, 'duration': 4.421}, {'end': 1122.491, 'text': 'So keep that in mind.', 'start': 1121.731, 'duration': 0.76}, {'end': 1129.694, 'text': 'And this is really the first and most important step, which is stating the clarifying the problem statement and stating it clearly.', 'start': 1122.591, 'duration': 7.103}, {'end': 1132.875, 'text': 'Do not start coding before you have done this.', 'start': 1130.674, 'duration': 2.201}, {'end': 1137.636, 'text': 'Otherwise you may get halfway into the code and realize that you have not understood the problem at all.', 'start': 1133.035, 'duration': 4.601}, {'end': 1151.79, 'text': 'So step two, now we will come up with some examples, some example inputs and outputs, and our goal will be to cover all the edge cases.', 'start': 1140.103, 'duration': 11.687}], 'summary': 'The first step is clarifying the problem statement before coding, followed by defining examples and edge cases.', 'duration': 35.62, 'max_score': 1116.17, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA1116170.jpg'}, {'end': 2303.25, 'src': 'embed', 'start': 2276.842, 'weight': 3, 'content': [{'end': 2280.464, 'text': 'So the Jovian platform also offers a Python helper library.', 'start': 2276.842, 'duration': 3.622}, {'end': 2283.006, 'text': 'That contains some utility functions.', 'start': 2281.545, 'duration': 1.461}, {'end': 2289.27, 'text': "So we've put together a small function for you called evaluate test case, and you can write it on your own as well,", 'start': 2283.666, 'duration': 5.604}, {'end': 2290.951, 'text': 'but you can use this library version.', 'start': 2289.27, 'duration': 1.681}, {'end': 2292.692, 'text': "So let's install the library.", 'start': 2291.471, 'duration': 1.221}, {'end': 2298.316, 'text': 'We will install the Jovian library using pip install Jovian minus minus upgrade.', 'start': 2292.872, 'duration': 5.444}, {'end': 2301.749, 'text': 'And then from Jovian dot Python DSA.', 'start': 2299.628, 'duration': 2.121}, {'end': 2303.25, 'text': 'So Jovian is the name of the library.', 'start': 2301.929, 'duration': 1.321}], 'summary': "Jovian platform offers python helper library with utility functions. install using 'pip install jovian --upgrade'.", 'duration': 26.408, 'max_score': 2276.842, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA2276842.jpg'}, {'end': 2810.549, 'src': 'embed', 'start': 2787.299, 'weight': 1, 'content': [{'end': 2794.382, 'text': 'Every time you make a change to the code, you want to go back and test all the test cases, because what ha what may happen is while fixing one error,', 'start': 2787.299, 'duration': 7.083}, {'end': 2795.763, 'text': 'you may introduce another error.', 'start': 2794.382, 'duration': 1.381}, {'end': 2800.365, 'text': 'And that is where having a good set of test cases is very important.', 'start': 2796.163, 'duration': 4.202}, {'end': 2802.346, 'text': "So let's run evaluate test cases.", 'start': 2800.665, 'duration': 1.681}, {'end': 2805.607, 'text': 'Once again, you can see here this time that all the test cases are passing.', 'start': 2802.406, 'duration': 3.201}, {'end': 2810.549, 'text': "And it's just nice to, it just makes you feel good as well.", 'start': 2807.488, 'duration': 3.061}], 'summary': 'Testing code changes is crucial to catch and prevent errors. having a good set of test cases is important for successful evaluation.', 'duration': 23.25, 'max_score': 2787.299, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA2787299.jpg'}], 'start': 521.894, 'title': 'Problem solving strategies and test cases', 'summary': 'Focuses on problem-solving strategies, particularly for the given cards problem and the importance of learning data structures and algorithms. it also discusses the importance of using test cases to reduce the risk of going wrong, creating deterministic test cases, and debugging functions using the python dsa library. additionally, it covers understanding complexity, big o notation, and the significance of testing all test cases.', 'chapters': [{'end': 1174.124, 'start': 521.894, 'title': 'Problem solving strategies', 'summary': 'Focuses on problem-solving strategies, particularly for the given cards problem, and emphasizes the importance of learning data structures and algorithms for coding interviews and assessments.', 'duration': 652.23, 'highlights': ["The chapter emphasizes the importance of learning data structures and algorithms for coding interviews or assessments, as it's almost certain to encounter programming problems like reversing a linked list or balancing a binary tree, which demonstrate important traits for a programmer.", "The strategy for solving problems systematically is outlined, including steps such as stating the problem clearly, identifying input and output formats, coming up with example inputs and outputs, and analyzing algorithms' complexity to overcome inefficiencies.", 'The importance of properly framing the problem in abstract terms and naming functions and variables descriptively is stressed, as it helps in clarifying the problem statement and maintaining code clarity and understanding.']}, {'end': 1716.399, 'start': 1174.524, 'title': 'Test cases for function testing', 'summary': 'Discusses the importance of using test cases to reduce the risk of going wrong, and it provides a detailed approach for listing and testing various scenarios with examples and explanations.', 'duration': 541.875, 'highlights': ['The chapter discusses the importance of using test cases to reduce the risk of going wrong.', 'It provides a detailed approach for listing and testing various scenarios with examples and explanations.', 'The chapter also emphasizes the need to list out all the scenarios that can be found in the input.']}, {'end': 2237.363, 'start': 1716.479, 'title': 'Creating deterministic test cases for coding problems', 'summary': 'Emphasizes the importance of creating deterministic test cases to ensure the function returns the first occurrence of a query, recommends creating at least five test cases to cover edge cases, and highlights the significance of expressing the algorithm in plain english before implementing it.', 'duration': 520.884, 'highlights': ['The chapter emphasizes the importance of creating deterministic test cases to ensure the function returns the first occurrence of a query.', 'Recommends creating at least five test cases to cover edge cases.', 'Highlights the significance of expressing the algorithm in plain English before implementing it.']}, {'end': 2678.392, 'start': 2237.744, 'title': 'Debugging functions with python dsa library', 'summary': "Explains how to use the python dsa library to debug functions, evaluating test cases, and adding print statements for error detection, thereby emphasizing the importance of testing and debugging, especially when encountering an error like 'list index out of range'.", 'duration': 440.648, 'highlights': ['The Jovian platform offers a Python helper library containing some utility functions, including a function called evaluate test case.', 'The evaluate test case function prints out the input, expected output, actual output, execution time, and whether the test has passed or not.', "The chapter emphasizes the importance of testing and debugging, especially when encountering an error like 'list index out of range'."]}, {'end': 3535.4, 'start': 2678.833, 'title': 'Understanding complexity and big o notation', 'summary': 'Discusses the importance of print statements in debugging, the solution to accessing elements in a list, the significance of testing all test cases, the need to implement brute force solutions, and the analysis of algorithms and algorithm design, including the explanation of complexity and big o notation.', 'duration': 856.567, 'highlights': ['The importance of testing all test cases is emphasized, as fixing one error may introduce another, and having a good set of test cases is crucial.', 'The solution to accessing elements in a list is explained, emphasizing the need to check the length of the list before accessing any element, and the implementation of a while loop to handle the case of an empty list.', 'The significance of implementing and testing brute force solutions is discussed, as it provides a fallback in case the optimal solution cannot be figured out, especially in coding interviews.', 'The explanation of complexity and big O notation is provided, emphasizing that complexity of an algorithm is a measure of the amount of time or space required by the algorithm to process an input of a given size.']}], 'duration': 3013.506, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA521894.jpg', 'highlights': ['The chapter emphasizes the importance of learning data structures and algorithms for coding interviews or assessments.', 'The importance of testing all test cases is emphasized, as fixing one error may introduce another.', "The strategy for solving problems systematically is outlined, including steps such as stating the problem clearly and analyzing algorithms' complexity.", 'The Jovian platform offers a Python helper library containing some utility functions, including a function called evaluate test case.', 'The importance of properly framing the problem in abstract terms and naming functions and variables descriptively is stressed.']}, {'end': 4634.14, 'segs': [{'end': 3812.843, 'src': 'embed', 'start': 3784.898, 'weight': 0, 'content': [{'end': 3788.399, 'text': 'And then if six comes at any of the other positions, we will guess it in three checks.', 'start': 3784.898, 'duration': 3.501}, {'end': 3790.059, 'text': "So that's pretty good.", 'start': 3789.439, 'duration': 0.62}, {'end': 3801.255, 'text': 'And now the idea if you, if you read this part, it says apply the right technique to overcome the inefficiency and then repeat the steps three to six.', 'start': 3792.748, 'duration': 8.507}, {'end': 3806.619, 'text': "So now we're going to go back to step three, which was come up with a correct solution for the problem and stated in plain English.", 'start': 3801.275, 'duration': 5.344}, {'end': 3808.24, 'text': 'And we have come up with a solution already.', 'start': 3806.719, 'duration': 1.521}, {'end': 3809.161, 'text': 'We just need to state it.', 'start': 3808.26, 'duration': 0.901}, {'end': 3812.843, 'text': 'So here is how this technique called binary search is applied to the problem.', 'start': 3809.681, 'duration': 3.162}], 'summary': 'Using binary search, a solution is found in three checks, improving efficiency.', 'duration': 27.945, 'max_score': 3784.898, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA3784898.jpg'}, {'end': 3853.947, 'src': 'embed', 'start': 3827.135, 'weight': 3, 'content': [{'end': 3831.46, 'text': 'And if it is less than the query number, then we search the first half of the list.', 'start': 3827.135, 'duration': 4.325}, {'end': 3835.363, 'text': "And if it's greater than the query number, then we search the second half of the list.", 'start': 3832.22, 'duration': 3.143}, {'end': 3838.587, 'text': 'So the exact thing that we saw here, we apply it here.', 'start': 3835.383, 'duration': 3.204}, {'end': 3843.071, 'text': 'And finally, if no more elements remain, we simply return minus one.', 'start': 3839.788, 'duration': 3.283}, {'end': 3845.921, 'text': "So let's just save our work.", 'start': 3845, 'duration': 0.921}, {'end': 3850.024, 'text': "Now let's, from this point on, we'll keep saving our work from time to time using Jovian.com.", 'start': 3845.981, 'duration': 4.043}, {'end': 3853.947, 'text': "Uh so, now we've come up with the algorithm and you can again.", 'start': 3850.044, 'duration': 3.903}], 'summary': 'Search algorithm divides list and returns -1 if no elements remain.', 'duration': 26.812, 'max_score': 3827.135, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA3827135.jpg'}, {'end': 3896.896, 'src': 'embed', 'start': 3866.637, 'weight': 1, 'content': [{'end': 3870.14, 'text': "So let's implement the solution now and test it using the example inputs.", 'start': 3866.637, 'duration': 3.503}, {'end': 3871.782, 'text': "So here's the implementation.", 'start': 3870.721, 'duration': 1.061}, {'end': 3873.283, 'text': "So what we'll do is.", 'start': 3872.122, 'duration': 1.161}, {'end': 3880.682, 'text': "We will look at once again, let's go back to this visual representation and we will keep a track of our search space.", 'start': 3874.617, 'duration': 6.065}, {'end': 3883.545, 'text': 'So current initially our search space is the entire area.', 'start': 3880.903, 'duration': 2.642}, {'end': 3886.527, 'text': 'So that means we have an area of seven numbers.', 'start': 3884.005, 'duration': 2.522}, {'end': 3888.89, 'text': 'So our search space goes from position zero to position six.', 'start': 3886.547, 'duration': 2.343}, {'end': 3892.453, 'text': "And slowly we'll keep reducing our search space over time.", 'start': 3889.73, 'duration': 2.723}, {'end': 3896.896, 'text': 'So to keep track of the search space, we will create two variables, low and high.', 'start': 3892.813, 'duration': 4.083}], 'summary': 'Implementing solution, tracking search space using low and high variables.', 'duration': 30.259, 'max_score': 3866.637, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA3866637.jpg'}, {'end': 4109.83, 'src': 'embed', 'start': 4084.127, 'weight': 5, 'content': [{'end': 4090.29, 'text': 'decrease the search space from the beginning to the position just before the middle number right?', 'start': 4084.127, 'duration': 6.163}, {'end': 4094.713, 'text': 'So what we can do is we can simply set high to mid minus one.', 'start': 4091.191, 'duration': 3.522}, {'end': 4098.76, 'text': 'On the other hand, if mid number is greater than query.', 'start': 4095.797, 'duration': 2.963}, {'end': 4103.144, 'text': 'So that means, because of the decreasing order of the area, the query lies to the right.', 'start': 4099.56, 'duration': 3.584}, {'end': 4107.468, 'text': 'Now we need to move the starting of the search space to beyond the middle number.', 'start': 4103.684, 'duration': 3.784}, {'end': 4109.83, 'text': 'So we simply said low to mid plus one.', 'start': 4107.648, 'duration': 2.182}], 'summary': 'Algorithm halves search space to improve efficiency.', 'duration': 25.703, 'max_score': 4084.127, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA4084127.jpg'}, {'end': 4159.962, 'src': 'embed', 'start': 4127.725, 'weight': 2, 'content': [{'end': 4131.707, 'text': "but sometimes it's nice to list out all possibilities just to make it super clear.", 'start': 4127.725, 'duration': 3.982}, {'end': 4135.111, 'text': 'And it makes it easy for you while debugging, fixing issues as well.', 'start': 4132.129, 'duration': 2.982}, {'end': 4140.857, 'text': "Okay So that's our binary search based algorithm.", 'start': 4135.371, 'duration': 5.486}, {'end': 4146.919, 'text': "And finally, when we exit out of the loop if you have not returned the middle number, if you've not exited the function yet,", 'start': 4140.977, 'duration': 5.942}, {'end': 4149.198, 'text': 'then we return minus one that the number was not formed.', 'start': 4146.919, 'duration': 2.279}, {'end': 4152.359, 'text': "So let's test it out using our test cases.", 'start': 4150.3, 'duration': 2.059}, {'end': 4159.962, 'text': 'And we have our handy evaluate test cases function here, but you can also test it manually if you want, by passing individual test cases.', 'start': 4153.2, 'duration': 6.762}], 'summary': 'The transcript discusses binary search algorithm and testing it with test cases.', 'duration': 32.237, 'max_score': 4127.725, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA4127725.jpg'}, {'end': 4367.667, 'src': 'embed', 'start': 4339.807, 'weight': 4, 'content': [{'end': 4342.789, 'text': "So as such, it's kind of a pseudo random kind of order.", 'start': 4339.807, 'duration': 2.982}, {'end': 4348.453, 'text': 'And so we need an additional condition condition to keep track of it.', 'start': 4345.211, 'duration': 3.242}, {'end': 4354.756, 'text': 'Right So how do we fix it? So the way to fix it is actually quite simple.', 'start': 4348.713, 'duration': 6.043}, {'end': 4362.563, 'text': 'When we find that the middle position in a particular range is equal to the query,', 'start': 4356.618, 'duration': 5.945}, {'end': 4367.667, 'text': 'we simply need to check whether it is the first occurrence of the query in the list.', 'start': 4362.563, 'duration': 5.104}], 'summary': 'To fix pseudo-random order, check for first occurrence in list.', 'duration': 27.86, 'max_score': 4339.807, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA4339807.jpg'}, {'end': 4455.412, 'src': 'embed', 'start': 4430.281, 'weight': 6, 'content': [{'end': 4436.286, 'text': 'you have to cover these special cases and your function may start to get slightly longer and slightly more complicated.', 'start': 4430.281, 'duration': 6.005}, {'end': 4439.729, 'text': 'What you may want to do is create a helper function.', 'start': 4436.727, 'duration': 3.002}, {'end': 4445.89, 'text': 'And a good rule of thumb is not to have functions that are more than 10 lines of code or so.', 'start': 4440.689, 'duration': 5.201}, {'end': 4450.411, 'text': 'I try to keep my functions below seven lines of code, because seven,', 'start': 4446.31, 'duration': 4.101}, {'end': 4455.412, 'text': 'eight lines is approximately the amount of information that you can hold in your head at once.', 'start': 4450.411, 'duration': 5.001}], 'summary': 'Functions should be kept under 10 lines, with a limit of 7 for better comprehension.', 'duration': 25.131, 'max_score': 4430.281, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA4430281.jpg'}], 'start': 3536.081, 'title': 'Binary search technique', 'summary': 'Discusses the implementation of binary search technique to reduce the number of checks to find the target number to a maximum of three, with an example of finding the number six in an array of seven elements. it also covers the implementation of a binary search algorithm using the concept of search space, middle position, and iterative approach, along with testing and evaluation for correctness. additionally, it addresses the failure of the binary search algorithm in a specific test case and provides a detailed explanation of the issue, along with a proposed solution, emphasizing the importance of creating helper functions and writing concise, understandable code.', 'chapters': [{'end': 3845.921, 'start': 3536.081, 'title': 'Binary search technique', 'summary': 'Discusses the implementation of binary search technique to overcome the inefficiency of linear search, reducing the number of checks to find the target number to a maximum of three, with an example of finding the number six in an array of seven elements.', 'duration': 309.84, 'highlights': ['Binary search technique reduces the number of checks to find the target number to a maximum of three, with an example of finding the number six in an array of seven elements.', 'Picking a random card and using the fact that the cards are in sorted order to eliminate half of the cards with just one check.', 'Explanation of the binary search technique, including finding the middle element, searching based on comparison with the query number, and the return value if no more elements remain.']}, {'end': 4230.102, 'start': 3845.981, 'title': 'Binary search algorithm implementation', 'summary': 'Discusses the implementation of a binary search algorithm to search for a query in a sorted array, using the concept of search space, middle position, and iterative approach, where the algorithm is tested with example inputs and evaluated for correctness.', 'duration': 384.121, 'highlights': ['The search space is initially the entire area with seven numbers, going from position zero to position six, and is gradually reduced over time, tracked using two variables, low and high.', 'The algorithm efficiently handles the search space using an iterative approach, where the search continues as long as there is at least one element in the search space, and the search space is updated based on the comparison of the middle number with the query, demonstrating the effectiveness of the algorithm.', 'The implementation addresses potential issues such as handling the middle position calculation and utilizing print statements for debugging, emphasizing the importance of error handling and thorough testing for code reliability.', "The algorithm returns the index of the query if found, and if not, returns -1, exemplifying the completion of the binary search process and the evaluation of the algorithm's correctness through test cases."]}, {'end': 4634.14, 'start': 4230.142, 'title': 'Binary search algorithm', 'summary': 'Discusses the binary search algorithm, pointing out its failure in a specific test case and providing a detailed explanation of the issue, along with a proposed solution. the chapter also emphasizes the importance of creating helper functions and writing concise, understandable code.', 'duration': 403.998, 'highlights': ['The binary search algorithm fails in a specific test case where the function should return the first position of a number within the list, but it returns the middle position instead, due to the nature of binary search accessing elements in a pseudo-random order.', 'The proposed solution involves adding an additional condition to check whether the middle element is the first occurrence of the query in the list, allowing the algorithm to adjust the search accordingly.', 'Emphasizes the importance of creating helper functions to handle special cases and keep the main functions concise and understandable, with a suggested limit of around 7-8 lines of code per function.']}], 'duration': 1098.059, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA3536081.jpg', 'highlights': ['Binary search technique reduces checks to find target number to max of three', 'Search space is initially entire area with seven numbers, gradually reduced', 'Binary search algorithm fails in specific test case, returns middle position instead', 'Algorithm returns index of query if found, -1 if not, exemplifying completion of binary search process', 'Proposed solution involves adding additional condition to check whether middle element is first occurrence of query', 'Algorithm handles search space using iterative approach, updating based on comparison of middle number with query', 'Importance of creating helper functions to handle special cases and keep main functions concise']}, {'end': 5528.423, 'segs': [{'end': 5048.338, 'src': 'embed', 'start': 5023.157, 'weight': 0, 'content': [{'end': 5028.221, 'text': 'But what I will argue is that you can change the base of the logarithm and that will simply add a constant.', 'start': 5023.157, 'duration': 5.064}, {'end': 5033.125, 'text': "So that will simply, if you're taking the natural log, then that will simply add a constant here.", 'start': 5028.902, 'duration': 4.223}, {'end': 5037.789, 'text': 'And remember when we talk about core time complexity, we ignore constants.', 'start': 5034.166, 'duration': 3.623}, {'end': 5046.616, 'text': 'So we can just generally say that our algorithm binary search has the time complexity of order of log N.', 'start': 5038.37, 'duration': 8.246}, {'end': 5048.338, 'text': 'That means as the input grows.', 'start': 5046.616, 'duration': 1.722}], 'summary': 'Changing the logarithm base adds a constant; binary search has time complexity of log n.', 'duration': 25.181, 'max_score': 5023.157, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA5023157.jpg'}, {'end': 5131.979, 'src': 'embed', 'start': 5108.522, 'weight': 3, 'content': [{'end': 5115.107, 'text': 'because you start to see the benefits of the difference between the order and algorithm and the order log and algorithm.', 'start': 5108.522, 'duration': 6.585}, {'end': 5120.531, 'text': 'Only when you have larger test cases because small test cases, everything runs instantly.', 'start': 5116.287, 'duration': 4.244}, {'end': 5122.972, 'text': "So it's not really that much of a hassle.", 'start': 5120.571, 'duration': 2.401}, {'end': 5131.979, 'text': 'So here we have a locate card linear, and this is the linear version of the algorithm where we simply go through each of the cards one by one.', 'start': 5124.033, 'duration': 7.946}], 'summary': 'The benefits of using the linear algorithm become apparent with larger test cases, while smaller cases run instantly.', 'duration': 23.457, 'max_score': 5108.522, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA5108522.jpg'}, {'end': 5351.309, 'src': 'embed', 'start': 5321.587, 'weight': 1, 'content': [{'end': 5329.812, 'text': "So that's a lot of time saved and you can increase the size of the array by a factor of 10 and increase this by a factor of 10 as well.", 'start': 5321.587, 'duration': 8.225}, {'end': 5338.476, 'text': 'And then you will see far bigger difference where for a 10 times larger array linear search would run for 10 times longer.', 'start': 5330.252, 'duration': 8.224}, {'end': 5341.518, 'text': 'Whereas binary search would only require three additional operations.', 'start': 5338.636, 'duration': 2.882}, {'end': 5351.309, 'text': 'So the linear search would go from 10 million operations to a hundred million operations by a research would go from 20 operations to 23.', 'start': 5343.106, 'duration': 8.203}], 'summary': 'Increasing array size by factor of 10 shows linear search time increase from 10m to 100m while binary search only requires 3 additional operations.', 'duration': 29.722, 'max_score': 5321.587, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA5321587.jpg'}, {'end': 5400.185, 'src': 'embed', 'start': 5359.672, 'weight': 4, 'content': [{'end': 5367.295, 'text': 'another way to look at it is that if you just divide the complexities, binary search runs N by login times faster than linear search.', 'start': 5359.672, 'duration': 7.623}, {'end': 5370.617, 'text': "for some fixed constant, because there's always some constants involved.", 'start': 5367.975, 'duration': 2.642}, {'end': 5376.421, 'text': 'And as the size of the input grows larger, the difference only gets bigger, the difference in performance.', 'start': 5370.957, 'duration': 5.464}, {'end': 5384.107, 'text': 'And that is what algorithm analysis of algorithms and optimization of algorithms is all about.', 'start': 5378.903, 'duration': 5.204}, {'end': 5391.933, 'text': "It's about overcoming the limitations of computers by devising clever techniques to solve problems.", 'start': 5385.348, 'duration': 6.585}, {'end': 5398.925, 'text': "And it's something that you can actually apply in real life as well.", 'start': 5396.644, 'duration': 2.281}, {'end': 5400.185, 'text': 'In a lot of cases.', 'start': 5399.425, 'duration': 0.76}], 'summary': 'Binary search runs n by login times faster than linear search, as input size grows larger.', 'duration': 40.513, 'max_score': 5359.672, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA5359672.jpg'}, {'end': 5514.602, 'src': 'embed', 'start': 5488.666, 'weight': 2, 'content': [{'end': 5494.149, 'text': 'But I hope you see now why we ignore constants and lower order terms while expressing the complexity of the big O notation.', 'start': 5488.666, 'duration': 5.483}, {'end': 5500.133, 'text': "So we've covered binary search, but we've seen it in the context of a problem.", 'start': 5495.47, 'duration': 4.663}, {'end': 5507.918, 'text': 'And now we can step away one more step and abstract it out further and identify the general strategy behind binary search.', 'start': 5501.194, 'duration': 6.724}, {'end': 5511.901, 'text': 'And this general strategy is actually applicable to a wide variety of problems.', 'start': 5508.338, 'duration': 3.563}, {'end': 5514.602, 'text': 'And this is what you want to keep doing as a programmer.', 'start': 5512.301, 'duration': 2.301}], 'summary': 'Ignoring constants and lower order terms in big o notation, understanding binary search strategy applicable to a wide variety of problems.', 'duration': 25.936, 'max_score': 5488.666, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA5488666.jpg'}], 'start': 4634.16, 'title': 'Binary search algorithm', 'summary': 'Explains a simplified binary search algorithm, emphasizing the process of locating a card, testing its position, and the importance of thorough testing and debugging. it also covers the analysis of binary search algorithm, demonstrating the time complexity as order of log n and comparing its performance with linear search, showing a significant difference in execution time and number of operations.', 'chapters': [{'end': 4784.305, 'start': 4634.16, 'title': 'Binary search algorithm explanation', 'summary': 'Explains a simplified binary search algorithm, emphasizing the process of locating a card, testing its position, and the importance of thorough testing and debugging, ensuring code correctness and effectiveness.', 'duration': 150.145, 'highlights': ['The chapter explains the process of locating a card using a simplified binary search algorithm, emphasizing the steps of printing low and high values, obtaining the mid position, and adjusting the search space based on the test results.', 'It highlights the significance of thorough testing and debugging when implementing algorithms, stressing the importance of creating and evaluating various test cases to ensure code correctness and effectiveness.', 'The chapter discusses the challenges of handling special cases in binary search problems and the potential complexity that arises when managing them within nested loops and if statements.']}, {'end': 5528.423, 'start': 4784.805, 'title': 'Binary search algorithm analysis', 'summary': 'Covers the analysis of binary search algorithm, demonstrating the time complexity as order of log n and comparing its performance with linear search, showing a significant difference in execution time and number of operations.', 'duration': 743.618, 'highlights': ['Binary search has a time complexity of order of log N, where the time taken is proportional to the logarithm of the number of elements in the list passed to it.', 'Binary search is 55,000 times faster than linear search, as demonstrated by the significant difference in execution time and the number of operations required for large test cases.', 'The performance difference between binary search and linear search grows larger as the size of the input increases, with binary search running N by log N times faster than linear search.', 'The general strategy of binary search is applicable to a wide variety of problems, emphasizing the importance of abstracting away specific details and finding general techniques as a programmer.']}], 'duration': 894.263, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA4634160.jpg', 'highlights': ['Binary search has a time complexity of order of log N', 'Binary search is 55,000 times faster than linear search', 'The general strategy of binary search is applicable to a wide variety of problems', 'The chapter explains the process of locating a card using a simplified binary search algorithm', 'The performance difference between binary search and linear search grows larger as the size of the input increases', 'It highlights the significance of thorough testing and debugging when implementing algorithms', 'The chapter discusses the challenges of handling special cases in binary search problems']}, {'end': 6577.969, 'segs': [{'end': 5603.423, 'src': 'embed', 'start': 5569.756, 'weight': 1, 'content': [{'end': 5572.577, 'text': 'If the answer lies before it, repeat the search.', 'start': 5569.756, 'duration': 2.821}, {'end': 5578.94, 'text': 'So repeat the process with the first half of the list or the first half of the search space.', 'start': 5572.697, 'duration': 6.243}, {'end': 5583.523, 'text': 'And if the answer lies after it, repeat the search with the second half of the search space.', 'start': 5579.781, 'duration': 3.742}, {'end': 5588.92, 'text': 'So here is the generic algorithm for binary search implemented in Python.', 'start': 5584.679, 'duration': 4.241}, {'end': 5595.561, 'text': 'And you can see a classic detail documentation here.', 'start': 5591.661, 'duration': 3.9}, {'end': 5603.423, 'text': 'So while, so here you have the binary search is going to take a search space low and high.', 'start': 5597.582, 'duration': 5.841}], 'summary': 'The generic algorithm for binary search in python involves repeating the search with the first or second half of the search space based on the position of the answer.', 'duration': 33.667, 'max_score': 5569.756, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA5569756.jpg'}, {'end': 5651.92, 'src': 'embed', 'start': 5621.374, 'weight': 4, 'content': [{'end': 5622.895, 'text': 'Sometimes these could just be numbers.', 'start': 5621.374, 'duration': 1.521}, {'end': 5632.503, 'text': 'For example, if I ask you to find a number between 1 million and 10 million, that is a perfect square.', 'start': 5623.916, 'duration': 8.587}, {'end': 5635.005, 'text': 'Then you can use binary search to do that.', 'start': 5633.524, 'duration': 1.481}, {'end': 5641.208, 'text': 'Uh, then it takes a condition.', 'start': 5639.406, 'duration': 1.802}, {'end': 5644.372, 'text': 'So what it does is it starts a loop.', 'start': 5642.029, 'duration': 2.343}, {'end': 5648.056, 'text': 'So while low less than equals high, we get the midpoint.', 'start': 5644.472, 'duration': 3.584}, {'end': 5651.92, 'text': 'So low plus high divided by two that gives us a midpoint.', 'start': 5648.156, 'duration': 3.764}], 'summary': 'Use binary search to find perfect square between 1m and 10m.', 'duration': 30.546, 'max_score': 5621.374, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA5621374.jpg'}, {'end': 5862.923, 'src': 'embed', 'start': 5833.178, 'weight': 0, 'content': [{'end': 5838.963, 'text': "So we're looking for both the start index and the end index of a particular number, because the number can repeat.", 'start': 5833.178, 'duration': 5.785}, {'end': 5843.947, 'text': "No, like we saw one example, and there's a very simple way to solve this.", 'start': 5839.163, 'duration': 4.784}, {'end': 5848.691, 'text': 'A simple strategy is do binary search once to find the first position.', 'start': 5844.147, 'duration': 4.544}, {'end': 5850.473, 'text': "And that's what this function does.", 'start': 5849.292, 'duration': 1.181}, {'end': 5852.575, 'text': "I'll let you read through it.", 'start': 5850.993, 'duration': 1.582}, {'end': 5856.76, 'text': 'The only changes here are this variable.', 'start': 5854.119, 'duration': 2.641}, {'end': 5862.923, 'text': 'This has changed this order because now the, now the elements are in increasing order.', 'start': 5857.461, 'duration': 5.462}], 'summary': 'Utilize binary search to find start and end index of repeating numbers.', 'duration': 29.745, 'max_score': 5833.178, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA5833178.jpg'}, {'end': 5936.324, 'src': 'embed', 'start': 5911.388, 'weight': 2, 'content': [{'end': 5918.373, 'text': "We were able to reuse most of the code that we have written, and that's a benefit benefit of making generic functions like binary search.", 'start': 5911.388, 'duration': 6.985}, {'end': 5921.635, 'text': 'And in fact, we can test a solution by making a submission here.', 'start': 5918.873, 'duration': 2.762}, {'end': 5924.177, 'text': "So let's go to leadcode.com.", 'start': 5922.636, 'duration': 1.541}, {'end': 5936.324, 'text': "Let us hear what I've done is I have already copied over the binary search function, the first position function and the last position function.", 'start': 5925.64, 'duration': 10.684}], 'summary': 'Code reuse benefits from generic functions like binary search.', 'duration': 24.936, 'max_score': 5911.388, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA5911388.jpg'}, {'end': 6085.025, 'src': 'embed', 'start': 6057.64, 'weight': 5, 'content': [{'end': 6060.401, 'text': 'Now in interviews and in coding assessments.', 'start': 6057.64, 'duration': 2.761}, {'end': 6062.441, 'text': "maybe you know where there's a time limit.", 'start': 6060.401, 'duration': 2.04}, {'end': 6065.962, 'text': 'you may not want to implement a brute force solution,', 'start': 6062.441, 'duration': 3.521}, {'end': 6071.403, 'text': 'because then you may get stuck in fixing issues with the brute force and you can directly jump ahead to step five.', 'start': 6065.962, 'duration': 5.441}, {'end': 6074.203, 'text': "But while you're practicing, always implement brute force.", 'start': 6071.723, 'duration': 2.48}, {'end': 6077.264, 'text': 'Then step five, analyze the algorithms complexity.', 'start': 6074.843, 'duration': 2.421}, {'end': 6080.904, 'text': 'And most of the time, it is simply a matter of counting the number of iterations.', 'start': 6077.424, 'duration': 3.48}, {'end': 6085.025, 'text': 'How many times a while loop, or maybe a loop within a loop is getting executed.', 'start': 6080.924, 'duration': 4.101}], 'summary': 'In coding assessments, implement brute force initially, then analyze algorithm complexity by counting iterations.', 'duration': 27.385, 'max_score': 6057.64, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA6057640.jpg'}, {'end': 6249.607, 'src': 'embed', 'start': 6219.817, 'weight': 3, 'content': [{'end': 6222.98, 'text': 'you will easily be able to solve most questions that are asked in interviews.', 'start': 6219.817, 'duration': 3.163}, {'end': 6228.307, 'text': 'Because questions asked in interviews are fairly simple in terms of the data structures or algorithms they test.', 'start': 6223.962, 'duration': 4.345}, {'end': 6235.675, 'text': "But the intention that is more to test your approach, look at the quality of your code and see how clearly you're expressing yourself.", 'start': 6228.727, 'duration': 6.948}, {'end': 6240.2, 'text': 'Right And this is what is exactly what this method teaches you to do.', 'start': 6235.695, 'duration': 4.505}, {'end': 6249.607, 'text': 'Now to encourage you to do this, to encourage you to try it out, and you can take problems from places like lead code, um, code chef code forces.', 'start': 6241.181, 'duration': 8.426}], 'summary': 'Prepare for interviews by focusing on problem-solving and coding quality.', 'duration': 29.79, 'max_score': 6219.817, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA6219817.jpg'}, {'end': 6390.499, 'src': 'embed', 'start': 6345.801, 'weight': 7, 'content': [{'end': 6352.245, 'text': 'modify the code within it and record a new version, which you can then submit to see your score.', 'start': 6345.801, 'duration': 6.444}, {'end': 6354.527, 'text': "So let's start reading through it.", 'start': 6353.346, 'duration': 1.181}, {'end': 6359.925, 'text': 'As you go through the notebook, you will find three question marks in certain places.', 'start': 6356.064, 'duration': 3.861}, {'end': 6364.086, 'text': 'To complete the assignment, you have to replace the question marks with appropriate values,', 'start': 6360.145, 'duration': 3.941}, {'end': 6368.487, 'text': 'expressions or statements to ensure that the notebook runs properly, end to end.', 'start': 6364.086, 'duration': 4.401}, {'end': 6371.948, 'text': 'Now keep in mind that you need to run all the cells.', 'start': 6369.208, 'duration': 2.74}, {'end': 6376.049, 'text': 'Otherwise you may get errors like name error or undefined variables.', 'start': 6372.809, 'duration': 3.24}, {'end': 6381.891, 'text': 'You should not be changing any variable names or deleting any cells or disturb any existing code.', 'start': 6377.29, 'duration': 4.601}, {'end': 6385.352, 'text': 'You can add new code cells or new statements.', 'start': 6382.671, 'duration': 2.681}, {'end': 6390.499, 'text': 'But do not redefine or do not change some of the existing variables.', 'start': 6386.977, 'duration': 3.522}], 'summary': 'Modify code in the notebook to complete assignment and ensure it runs properly.', 'duration': 44.698, 'max_score': 6345.801, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA6345801.jpg'}, {'end': 6482.548, 'src': 'embed', 'start': 6457.316, 'weight': 9, 'content': [{'end': 6463.3, 'text': 'The recommended way to run this code is by clicking the run button at the top of the page and selecting run on binder,', 'start': 6457.316, 'duration': 5.984}, {'end': 6470.385, 'text': 'but you can also run it using some other options, like Google, Colab or Kaggle, or you can run it on your computer locally.', 'start': 6463.3, 'duration': 7.085}, {'end': 6476.609, 'text': "So we're going to use the recommended method run on binder.", 'start': 6473.687, 'duration': 2.922}, {'end': 6482.548, 'text': 'Now we have the notebook running in front of us.', 'start': 6480.686, 'duration': 1.862}], 'summary': 'The code can be run on binder, google colab, kaggle, or locally on a computer.', 'duration': 25.232, 'max_score': 6457.316, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA6457316.jpg'}, {'end': 6543.356, 'src': 'embed', 'start': 6516.055, 'weight': 6, 'content': [{'end': 6521.54, 'text': "let's save a snapshot of the assignment to our Jovian profile so that we can access it later and continue our work.", 'start': 6516.055, 'duration': 5.485}, {'end': 6523.962, 'text': "I'm going to run pip install Jovian.", 'start': 6522.12, 'duration': 1.842}, {'end': 6526.444, 'text': 'This is going to install the Jovian library.', 'start': 6524.742, 'duration': 1.702}, {'end': 6533.09, 'text': 'Then run import Jovian to import the library and set a project name.', 'start': 6527.867, 'duration': 5.223}, {'end': 6537.813, 'text': "Here I'm just calling it binary search assignment and run jovian.commit.", 'start': 6534.071, 'duration': 3.742}, {'end': 6543.356, 'text': "Now you've taken a starter notebook, which was hosted on my profile, and then you've run it on binder.", 'start': 6538.393, 'duration': 4.963}], 'summary': 'Saving assignment snapshot on jovian profile and running it on binder.', 'duration': 27.301, 'max_score': 6516.055, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA6516055.jpg'}], 'start': 5529.724, 'title': 'Binary search and jovian assignment', 'summary': 'Covers the generic binary search algorithm in python, its flexibility, practice for finding positions in sorted arrays, systematic problem-solving approach, algorithmic complexity analysis, and an assignment on jovian platform for accessing, modifying, saving, and submitting work.', 'chapters': [{'end': 5806.066, 'start': 5529.724, 'title': 'Binary search algorithm', 'summary': 'Explains the generic algorithm for binary search, implemented in python, including the condition to determine the position of the answer, retrieving the midpoint, and using a function closure for the condition. it also highlights the flexibility of using binary search for problems that are not based on arrays.', 'duration': 276.342, 'highlights': ['The chapter explains the generic algorithm for binary search, implemented in Python, including the condition to determine the position of the answer, retrieving the midpoint, and using a function closure for the condition.', 'It highlights the flexibility of using binary search for problems that are not based on arrays, such as finding a number between 1 million and 10 million that is a perfect square.', 'The binary search function is tested and proven, allowing its reuse to solve other problems efficiently.']}, {'end': 6324.267, 'start': 5806.897, 'title': 'Binary search practice', 'summary': 'Explains the process of finding the starting and ending position of a given number in a sorted array using binary search, and emphasizes the importance of systematic problem-solving approach and algorithmic complexity analysis in interviews and coding assessments.', 'duration': 517.37, 'highlights': ['The chapter emphasizes the importance of systematic problem-solving approach and algorithmic complexity analysis in interviews and coding assessments, and encourages practicing on platforms like leadcode, codechef, and codeforces.', 'The process of finding the starting and ending position of a given number in a sorted array using binary search is explained, with a strategy involving two binary searches for first and last position, resulting in a complexity of order log₂n.', 'The approach of implementing a brute force solution, analyzing algorithmic complexity, identifying inefficiencies, and applying the right technique to overcome inefficiencies is discussed, emphasizing the importance of learning and applying different techniques in interviews.']}, {'end': 6577.969, 'start': 6325.79, 'title': 'Assignment starter notebook on jovian', 'summary': 'Introduces an assignment on jovian platform, explaining the process of accessing and running the starter notebook, modifying code, saving work, and making submissions, while emphasizing the importance of running all cells and using jovian library for saving and tracking work.', 'duration': 252.179, 'highlights': ['The chapter introduces an assignment on Jovian platform', 'Emphasizes the importance of running all cells and using Jovian library for saving and tracking work', 'Explains the necessity of replacing the question marks with appropriate values in the notebook', 'Mentions the use of temporary online service for code execution and the option to run on Binder, Google Colab, Kaggle, or locally']}], 'duration': 1048.245, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA5529724.jpg', 'highlights': ['The process of finding the starting and ending position of a given number in a sorted array using binary search is explained, with a strategy involving two binary searches for first and last position, resulting in a complexity of order log₂n.', 'The chapter explains the generic algorithm for binary search, implemented in Python, including the condition to determine the position of the answer, retrieving the midpoint, and using a function closure for the condition.', 'The binary search function is tested and proven, allowing its reuse to solve other problems efficiently.', 'The chapter emphasizes the importance of systematic problem-solving approach and algorithmic complexity analysis in interviews and coding assessments, and encourages practicing on platforms like leadcode, codechef, and codeforces.', 'The flexibility of using binary search for problems that are not based on arrays, such as finding a number between 1 million and 10 million that is a perfect square is highlighted.', 'The approach of implementing a brute force solution, analyzing algorithmic complexity, identifying inefficiencies, and applying the right technique to overcome inefficiencies is discussed, emphasizing the importance of learning and applying different techniques in interviews.', 'The chapter introduces an assignment on Jovian platform.', 'Emphasizes the importance of running all cells and using Jovian library for saving and tracking work.', 'Explains the necessity of replacing the question marks with appropriate values in the notebook.', 'Mentions the use of temporary online service for code execution and the option to run on Binder, Google Colab, Kaggle, or locally.']}, {'end': 8405.26, 'segs': [{'end': 6828.284, 'src': 'embed', 'start': 6800.374, 'weight': 1, 'content': [{'end': 6804.72, 'text': 'number three come up with a correct solution for the problem and state it in plain english.', 'start': 6800.374, 'duration': 4.346}, {'end': 6817.233, 'text': 'Number four implement the solution and test it using some example inputs and having test cases and then implementing a solution allows you to test them using the example inputs and fix any bugs.', 'start': 6805.641, 'duration': 11.592}, {'end': 6819.835, 'text': "That's why it's very important to have some test cases.", 'start': 6817.693, 'duration': 2.142}, {'end': 6824.58, 'text': "Number five, analyze the algorithm's complexity and identify any inefficiencies.", 'start': 6820.396, 'duration': 4.184}, {'end': 6828.284, 'text': 'And number six, apply the right technique to overcome the inefficiency.', 'start': 6824.68, 'duration': 3.604}], 'summary': 'Solve problem, test solution, analyze complexity, apply technique for efficiency.', 'duration': 27.91, 'max_score': 6800.374, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA6800374.jpg'}, {'end': 7220.696, 'src': 'embed', 'start': 7192.375, 'weight': 2, 'content': [{'end': 7197.656, 'text': "So you can see here that we've organized one test case here, and we've expressed the test case as a dictionary.", 'start': 7192.375, 'duration': 5.281}, {'end': 7201.857, 'text': 'So here we have the input to the test case that is the input key.', 'start': 7198.276, 'duration': 3.581}, {'end': 7203.857, 'text': 'And then we have the output to the test case.', 'start': 7202.077, 'duration': 1.78}, {'end': 7206.998, 'text': 'Now, because a function can take many arguments.', 'start': 7204.377, 'duration': 2.621}, {'end': 7213.105, 'text': "the input itself is going to be a dictionary and then for each argument in this case there's just one.", 'start': 7208.018, 'duration': 5.087}, {'end': 7215.328, 'text': 'so we just call it nums.', 'start': 7213.105, 'duration': 2.223}, {'end': 7220.696, 'text': 'we have the input here and this is the size of the output.', 'start': 7215.328, 'duration': 5.368}], 'summary': 'Organized one test case as a dictionary with input and output, using a size of the output.', 'duration': 28.321, 'max_score': 7192.375, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA7192375.jpg'}, {'end': 7836.074, 'src': 'embed', 'start': 7802.855, 'weight': 0, 'content': [{'end': 7810.12, 'text': 'And not only that three is the only number, which is lower than the number that precedes it, the predecessor, which is 29.', 'start': 7802.855, 'duration': 7.265}, {'end': 7819.246, 'text': 'And since three occurs at position four, well, actually three occurs at position three, zero one, two, three.', 'start': 7810.12, 'duration': 9.126}, {'end': 7829.649, 'text': 'The list was rotated exactly three times.', 'start': 7826.886, 'duration': 2.763}, {'end': 7836.074, 'text': 'Now we can use the linear search algorithm as a first attempt to solve this problem.', 'start': 7831.831, 'duration': 4.243}], 'summary': 'The list was rotated three times for a linear search algorithm.', 'duration': 33.219, 'max_score': 7802.855, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA7802855.jpg'}, {'end': 8107.881, 'src': 'embed', 'start': 8085.429, 'weight': 4, 'content': [{'end': 8096.114, 'text': "Now, if you've exhausted the entire list, then it follows that there were no rotations, or they were end rotations exactly.", 'start': 8085.429, 'duration': 10.685}, {'end': 8098.676, 'text': 'in either case, the number we return should be zero.', 'start': 8096.114, 'duration': 2.562}, {'end': 8102.257, 'text': 'Okay So keep this in mind.', 'start': 8099.216, 'duration': 3.041}, {'end': 8104.659, 'text': 'Some. you may have the doubt.', 'start': 8102.458, 'duration': 2.201}, {'end': 8107.881, 'text': 'should you be returning minus one here, or should you be returning zero here??', 'start': 8104.659, 'duration': 3.222}], 'summary': 'If the entire list is exhausted, return zero.', 'duration': 22.452, 'max_score': 8085.429, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA8085429.jpg'}, {'end': 8157.112, 'src': 'embed', 'start': 8130.629, 'weight': 3, 'content': [{'end': 8135.131, 'text': "So let's call evaluate test case for a single test case on count rotations linear.", 'start': 8130.629, 'duration': 4.502}, {'end': 8136.512, 'text': "And let's see what the test case is.", 'start': 8135.171, 'duration': 1.341}, {'end': 8146.176, 'text': 'This is the test case here, and this is the output we call evaluate test case with count rotations, linear and test.', 'start': 8140.133, 'duration': 6.043}, {'end': 8148.737, 'text': 'And that gives us a linear search result.', 'start': 8146.916, 'duration': 1.821}, {'end': 8153.95, 'text': 'And you can see here, this was the number, the list of numbers.', 'start': 8150.748, 'duration': 3.202}, {'end': 8157.112, 'text': 'This was the expected output, and this was the actual output.', 'start': 8154.07, 'duration': 3.042}], 'summary': 'Evaluating a single test case for count rotations linear search.', 'duration': 26.483, 'max_score': 8130.629, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA8130629.jpg'}], 'start': 6577.969, 'title': 'Sorted list rotation', 'summary': 'Discusses determining minimum rotations and counting rotations in a sorted, rotated list, emphasizing worst-case complexity of order log n and the importance of understanding the problem correctly, utilizing markdown features, creating and evaluating test cases, and implementing a linear search algorithm.', 'chapters': [{'end': 6879.846, 'start': 6577.969, 'title': 'Determine rotated sorted list', 'summary': 'Discusses determining the minimum number of times a sorted list was rotated to obtain a given list, with the requirement of worst-case complexity of order log n, where n is the length of the list, and the assumption that all numbers in the list are unique.', 'duration': 301.877, 'highlights': ['The chapter discusses determining the minimum number of times a sorted list was rotated to obtain a given list', 'The requirement of worst-case complexity of order log n, where n is the length of the list', 'The assumption that all numbers in the list are unique']}, {'end': 7142.038, 'start': 6881.486, 'title': 'Counting rotations in a sorted list', 'summary': "Discusses the process of counting the number of rotations in a sorted, rotated list and explains the function 'counts_rotations' which takes a list of numbers and returns the count of rotations. it also emphasizes the importance of understanding the problem correctly and utilizing markdown features for better organization in code.", 'duration': 260.552, 'highlights': ["The function 'counts_rotations' takes a list of numbers and returns the count of rotations, helping to identify the number of times the sorted list was rotated, such as in the example where the sorted list was rotated twice, resulting in 'three, five, six, seven, nine' being rotated two times.", 'The importance of understanding the problem correctly is emphasized as it helps in determining missed details and ensures a better grasp of the task, leading to improved problem-solving skills and accurate descriptions of the given problem.', 'The chapter highlights the use of Markdown features to organize descriptions and texts effectively, enabling better structuring of explanations and code within the notebook.']}, {'end': 7513.102, 'start': 7142.258, 'title': 'List rotation analysis', 'summary': 'Discusses various scenarios of list rotation, presents examples, and emphasizes the need for minimum rotations to obtain the given list, while instructing on creating and evaluating test cases.', 'duration': 370.844, 'highlights': ['The chapter discusses various scenarios of list rotation, presents examples, and emphasizes the need for minimum rotations to obtain the given list.', 'Instructs on creating and evaluating test cases using dictionaries and a provided function.', 'Guidance provided for creating specific test cases for different rotation scenarios, with examples and expected outputs.']}, {'end': 7986.641, 'start': 7513.502, 'title': 'Implementing test cases and solutions', 'summary': 'Covers defining and evaluating test cases, understanding the correct solution for the problem, and implementing a linear search algorithm to find the number of rotations in a sorted, rotated list.', 'duration': 473.139, 'highlights': ["The chapter emphasizes defining and evaluating test cases to ensure the function's correctness, with a recommendation of having at least eight test cases for evaluation.", 'The correct solution involves identifying that the smallest number in a sorted, rotated list ends up at the position of the rotations, leading to a straightforward linear search algorithm to find the number of rotations for a given list.', 'The linear search algorithm involves iteratively comparing each number in the list with its predecessor, returning the position of the first number that is smaller than its predecessor as the number of rotations.', 'The chapter concludes with an emphasis on implementing and testing the described linear search algorithm to find the number of rotations in the list.']}, {'end': 8405.26, 'start': 7986.641, 'title': 'Rotated list search', 'summary': 'Discusses the logic and implementation of a linear search algorithm to find the number of times a sorted rotated list was rotated, emphasizing the necessity of returning zero for non-rotated lists and the process of evaluating test cases.', 'duration': 418.619, 'highlights': ['The logic and implementation of a linear search algorithm to find the number of times a sorted rotated list was rotated is discussed.', 'Emphasizing the necessity of returning zero for non-rotated lists.', 'The process of evaluating test cases, ensuring that the function has passed all the test cases for count rotations linear.', 'Guidance on utilizing the forum for issue resolution and seeking assistance.']}], 'duration': 1827.291, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA6577969.jpg', 'highlights': ['The correct solution involves identifying the smallest number in a sorted, rotated list, leading to a linear search algorithm (4)', 'The importance of understanding the problem correctly for improved problem-solving skills (2)', 'Guidance on creating and evaluating test cases using dictionaries and a provided function (3)', 'The logic and implementation of a linear search algorithm to find the number of rotations (5)', 'Emphasizing the necessity of returning zero for non-rotated lists (5)']}, {'end': 9455.538, 'segs': [{'end': 8427.955, 'src': 'embed', 'start': 8405.74, 'weight': 0, 'content': [{'end': 8418.885, 'text': "What we've seen is people who are active on the forum are at least four to five times more likely to complete the course and on the certificate of accomplishment and continue working on these topics after the course as well.", 'start': 8405.74, 'duration': 13.145}, {'end': 8427.955, 'text': 'Okay So the next step is to analyze the algorithms complexity.', 'start': 8424.952, 'duration': 3.003}], 'summary': 'Active forum participants 4-5x more likely to complete course and earn certificate', 'duration': 22.215, 'max_score': 8405.74, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA8405740.jpg'}, {'end': 8672.762, 'src': 'embed', 'start': 8649.351, 'weight': 2, 'content': [{'end': 8656.88, 'text': "so always do this exercise of expressing the solution in your own words when you're practicing, when you're solving a coding challenge or something,", 'start': 8649.351, 'duration': 7.529}, {'end': 8657.861, 'text': 'even in an interview.', 'start': 8656.88, 'duration': 0.981}, {'end': 8658.862, 'text': "it's also very important,", 'start': 8657.861, 'duration': 1.001}, {'end': 8666.061, 'text': "Because the first thing you need to do is to communicate to the interviewer your thought process and how you're thinking about the problem.", 'start': 8659.639, 'duration': 6.422}, {'end': 8672.762, 'text': 'So the first thing you need to do is describe a simple solution in your, in simple words, and then they may or may not ask you to code that solution.', 'start': 8666.141, 'duration': 6.621}], 'summary': 'Practice expressing coding solutions in simple words to communicate thought process in interviews.', 'duration': 23.411, 'max_score': 8649.351, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA8649351.jpg'}, {'end': 8858.544, 'src': 'embed', 'start': 8830.503, 'weight': 4, 'content': [{'end': 8834.387, 'text': 'It is also called the edge case or the trivial case.', 'start': 8830.503, 'duration': 3.884}, {'end': 8836.41, 'text': 'So you should handle and think about this carefully.', 'start': 8834.407, 'duration': 2.003}, {'end': 8842.535, 'text': "And then once you've done that, you can evaluate the test case and you can a single test case.", 'start': 8838.092, 'duration': 4.443}, {'end': 8844.316, 'text': "You're going to evaluate multiple test cases.", 'start': 8842.555, 'duration': 1.761}, {'end': 8851.58, 'text': 'Now, if your test cases are failing, you may want to enable this print statement inside by uncommenting it,', 'start': 8844.716, 'duration': 6.864}, {'end': 8858.544, 'text': 'but make sure to comment it out at the end once again, and the print statement will help you see what the low, high and mid points were.', 'start': 8851.58, 'duration': 6.964}], 'summary': 'Handle edge cases carefully, evaluate multiple test cases, use print statement for debugging.', 'duration': 28.041, 'max_score': 8830.503, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA8830503.jpg'}, {'end': 8954.747, 'src': 'embed', 'start': 8879.513, 'weight': 1, 'content': [{'end': 8884.235, 'text': 'by adding print statements and working out the same problem side by side on paper to fix your issues.', 'start': 8879.513, 'duration': 4.722}, {'end': 8889.598, 'text': "Otherwise you may feel lost if you're not able to look into the internal workings of the function.", 'start': 8884.976, 'duration': 4.622}, {'end': 8898.265, 'text': 'Next you have to analyze the algorithms complexity and identify inefficiencies.', 'start': 8893.661, 'duration': 4.604}, {'end': 8899.906, 'text': 'This should be straightforward enough.', 'start': 8898.665, 'duration': 1.241}, {'end': 8902.448, 'text': "We've already looked at the complexity of binary search,", 'start': 8900.267, 'duration': 2.181}, {'end': 8908.474, 'text': "but all you need to do is make sure that what you're doing within the algorithm matches the analysis that we've done earlier.", 'start': 8902.448, 'duration': 6.026}, {'end': 8916.16, 'text': 'So the problem size reduces by half each time, and then we are doing constant work in each step before solving a problem of half the size.', 'start': 8909.054, 'duration': 7.106}, {'end': 8921.825, 'text': 'So that should roughly give you an answer and keep committing your work.', 'start': 8917.261, 'duration': 4.564}, {'end': 8926.838, 'text': 'Now, finally, to make a submission, you have two options.', 'start': 8924.636, 'duration': 2.202}, {'end': 8930.32, 'text': 'Now, one option is to take this link.', 'start': 8928.459, 'duration': 1.861}, {'end': 8936.485, 'text': 'So your notebook has been committed here and you can come to the assignment page.', 'start': 8930.781, 'duration': 5.704}, {'end': 8945.011, 'text': "Let's open up the assignment page, mine research practice, come down here and paste this link here and click submit.", 'start': 8936.845, 'duration': 8.166}, {'end': 8954.747, 'text': 'Now, once you click submit, the assignment will be submitted and It will go into automated evaluation.', 'start': 8946.592, 'duration': 8.155}], 'summary': 'Analyze algorithm complexity, reduce problem size, and submit assignment for automated evaluation.', 'duration': 75.234, 'max_score': 8879.513, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA8879513.jpg'}, {'end': 9278.371, 'src': 'embed', 'start': 9213.098, 'weight': 6, 'content': [{'end': 9215.96, 'text': 'This is an online certification course by Jovian.', 'start': 9213.098, 'duration': 2.862}, {'end': 9220.383, 'text': 'My name is Akash and I am the CEO and co-founder of Jovian.', 'start': 9217.401, 'duration': 2.982}, {'end': 9227.407, 'text': 'You can earn a certificate of accomplishment for this course by completing four weekly assignments and doing a course project.', 'start': 9221.704, 'duration': 5.703}, {'end': 9229.729, 'text': 'Today we are on lesson two of six.', 'start': 9227.908, 'duration': 1.821}, {'end': 9238.542, 'text': "Now, if you open up pythondsa.com, you'll end up on this course website where you will be able to find all the information for the course.", 'start': 9231.96, 'duration': 6.582}, {'end': 9241.243, 'text': 'You can view the previous lessons, which is lesson one.', 'start': 9238.782, 'duration': 2.461}, {'end': 9246.044, 'text': 'And you can also work on the previous assignment, which is assignment one.', 'start': 9241.923, 'duration': 4.121}, {'end': 9252.306, 'text': 'And you can also check out the course community forum where you can get help and have discussions.', 'start': 9246.925, 'duration': 5.381}, {'end': 9254.767, 'text': "So let's open up lesson two.", 'start': 9253.446, 'duration': 1.321}, {'end': 9258.388, 'text': 'This is the lesson page here.', 'start': 9257.068, 'duration': 1.32}, {'end': 9261.649, 'text': 'You will be able to see the video for this lesson.', 'start': 9258.448, 'duration': 3.201}, {'end': 9269.946, 'text': 'You can watch live or you can watch a recording here, and you can also see a version of this video lecture in Hindi.', 'start': 9263.502, 'duration': 6.444}, {'end': 9278.371, 'text': "And in this lesson we'll explore the use cases of binary search trees and develop a step-by-step implementation from scratch,", 'start': 9271.647, 'duration': 6.724}], 'summary': "Jovian's online course offers certification upon completing 4 assignments and a project, currently on lesson 2 of 6.", 'duration': 65.273, 'max_score': 9213.098, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA9213098.jpg'}, {'end': 9342.402, 'src': 'embed', 'start': 9309.521, 'weight': 8, 'content': [{'end': 9311.622, 'text': 'You can check out the first notebook in lesson one.', 'start': 9309.521, 'duration': 2.101}, {'end': 9319.169, 'text': "And if you're just joining us, this is a beginner, friendly course and you do not need a lot of background in programming,", 'start': 9312.903, 'duration': 6.266}, {'end': 9323.492, 'text': 'with a little bit of understanding of Python and a little bit of high school mathematics.', 'start': 9319.169, 'duration': 4.323}, {'end': 9325.514, 'text': 'You should be able to follow along just fine.', 'start': 9323.532, 'duration': 1.982}, {'end': 9332.38, 'text': 'If you do not know these, then you can follow these tutorials to learn the prerequisites in just about an hour or two.', 'start': 9326.195, 'duration': 6.185}, {'end': 9342.402, 'text': "Now, the best way to learn the material that we're covering in this course is to actually run the code and experiment with it yourself.", 'start': 9334.656, 'duration': 7.746}], 'summary': 'Beginner-friendly course, requires basic python and high school math, can learn prerequisites in 1-2 hours.', 'duration': 32.881, 'max_score': 9309.521, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA9309521.jpg'}, {'end': 9381.183, 'src': 'embed', 'start': 9349.508, 'weight': 9, 'content': [{'end': 9351.409, 'text': 'Now to run the code, you have two options.', 'start': 9349.508, 'duration': 1.901}, {'end': 9358.475, 'text': 'You can either run it using an online programming platform, or you can run it on your computer locally.', 'start': 9351.91, 'duration': 6.565}, {'end': 9367.089, 'text': 'So to run this code, we will scroll up and click on the run button and then click run on binder.', 'start': 9360.942, 'duration': 6.147}, {'end': 9371.533, 'text': 'And this is going to start executing the code that we were just looking at.', 'start': 9367.91, 'duration': 3.623}, {'end': 9381.183, 'text': 'So, once again, you can go on the course page pythondsa.com, open up lesson two And you can watch the video there.', 'start': 9372.294, 'duration': 8.889}], 'summary': 'Options to run code: online platform or locally. execute on binder via run button.', 'duration': 31.675, 'max_score': 9349.508, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA9349508.jpg'}], 'start': 8405.74, 'title': 'Binary search and algorithm complexity', 'summary': 'Discusses the impact of forum activity on course completion rates, introduces algorithm complexity analysis and binary search logic, emphasizing its importance in problem-solving and communication. it also covers the implementation of binary search solution, debugging techniques, and the use cases of binary search trees in python.', 'chapters': [{'end': 8730.191, 'start': 8405.74, 'title': 'Forum activity impact, algorithm complexity analysis and binary search logic', 'summary': "Demonstrates that active forum participation increases course completion rates by four to five times, introduces the concept of algorithm complexity analysis, including linear and binary search, and emphasizes the importance of articulating the binary search solution in one's own words to aid in problem-solving and effective communication during coding challenges and interviews.", 'duration': 324.451, 'highlights': ['Active forum participation increases course completion rates by four to five times', 'Introduces the concept of algorithm complexity analysis, including linear and binary search', "Emphasizes the importance of articulating the binary search solution in one's own words to aid in problem-solving and effective communication during coding challenges and interviews"]}, {'end': 9212.638, 'start': 8730.872, 'title': 'Implementing binary search solution', 'summary': 'Covers the implementation of the binary search solution, including logic, debugging techniques, algorithm complexity analysis, and submission options, with a focus on identifying inefficiencies and handling edge cases.', 'duration': 481.766, 'highlights': ['The chapter emphasizes the importance of handling edge cases and provides debugging techniques such as using print statements and working out the problem on paper to fix issues.', 'The chapter discusses the analysis of algorithm complexity, focusing on reducing the problem size by half each time and performing constant work in each step.', 'The chapter mentions the submission options, including pasting the link on the assignment page and using the joven submit command, and highlights the importance of having a good set of test cases for submission and error handling.']}, {'end': 9455.538, 'start': 9213.098, 'title': 'Binary search trees in python', 'summary': 'Covers an online certification course by jovian, focusing on lesson two of six, exploring the use cases of binary search trees, and providing guidance on running the code and accessing the course materials.', 'duration': 242.44, 'highlights': ['You can earn a certificate of accomplishment for this course by completing four weekly assignments and doing a course project.', 'The lesson covers the use cases of binary search trees and provides a step-by-step implementation from scratch, solving common interview questions along the way.', 'The course is beginner-friendly and does not require extensive background in programming; a little understanding of Python and high school mathematics is sufficient.', 'Guidance is provided on running the code, either using an online programming platform or locally on a computer.', 'The course materials, such as video lectures, notebooks, and code, can be accessed on the course website pythondsa.com.']}], 'duration': 1049.798, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA8405740.jpg', 'highlights': ['Active forum participation increases course completion rates by four to five times', 'Introduces the concept of algorithm complexity analysis, including linear and binary search', "Emphasizes the importance of articulating the binary search solution in one's own words to aid in problem-solving and effective communication during coding challenges and interviews", 'The chapter discusses the analysis of algorithm complexity, focusing on reducing the problem size by half each time and performing constant work in each step', 'The chapter emphasizes the importance of handling edge cases and provides debugging techniques such as using print statements and working out the problem on paper to fix issues', 'The chapter mentions the submission options, including pasting the link on the assignment page and using the joven submit command, and highlights the importance of having a good set of test cases for submission and error handling', 'The lesson covers the use cases of binary search trees and provides a step-by-step implementation from scratch, solving common interview questions along the way', 'You can earn a certificate of accomplishment for this course by completing four weekly assignments and doing a course project', 'The course is beginner-friendly and does not require extensive background in programming; a little understanding of Python and high school mathematics is sufficient', 'Guidance is provided on running the code, either using an online programming platform or locally on a computer', 'The course materials, such as video lectures, notebooks, and code, can be accessed on the course website pythondsa.com']}, {'end': 11055.977, 'segs': [{'end': 9501.759, 'src': 'embed', 'start': 9476.323, 'weight': 0, 'content': [{'end': 9483.288, 'text': 'As a senior backend engineer at Jovian, you are tasked with developing a fast in-memory data structure to manage profile information,', 'start': 9476.323, 'duration': 6.965}, {'end': 9486.67, 'text': 'which is username, name and email, for 100 million users.', 'start': 9483.288, 'duration': 3.382}, {'end': 9489.912, 'text': 'It should allow the following operations to be performed efficiently.', 'start': 9487.19, 'duration': 2.722}, {'end': 9494.154, 'text': 'You should be able to insert the profile information for a new user,', 'start': 9490.612, 'duration': 3.542}, {'end': 9501.759, 'text': 'find the profile information for a user given their username and then update the profile information of a user once again given their username,', 'start': 9494.154, 'duration': 7.605}], 'summary': "Develop a fast in-memory data structure for 100m users' profiles with efficient insert, find, and update operations.", 'duration': 25.436, 'max_score': 9476.323, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA9476323.jpg'}, {'end': 10092.982, 'src': 'embed', 'start': 10069.529, 'weight': 1, 'content': [{'end': 10078.874, 'text': 'So we can define, we can expect our final output to be a class called user database, which has four methods, insert, find, update, and list all.', 'start': 10069.529, 'duration': 9.345}, {'end': 10082.436, 'text': 'And insert takes a user and inserts it into the database.', 'start': 10079.514, 'duration': 2.922}, {'end': 10085.117, 'text': 'Find takes a username and returns the user.', 'start': 10082.796, 'duration': 2.321}, {'end': 10087.178, 'text': 'Update takes a user.', 'start': 10085.977, 'duration': 1.201}, {'end': 10090.659, 'text': 'and updates the data for that user.', 'start': 10088.937, 'duration': 1.722}, {'end': 10092.982, 'text': 'And finally list all returns a list of the users.', 'start': 10090.759, 'duration': 2.223}], 'summary': "Final output: class 'user database' with 4 methods: insert, find, update, list all.", 'duration': 23.453, 'max_score': 10069.529, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA10069529.jpg'}, {'end': 10210.529, 'src': 'embed', 'start': 10179.538, 'weight': 2, 'content': [{'end': 10183.702, 'text': "So let's list some scenarios for testing the methods of our user database class.", 'start': 10179.538, 'duration': 4.164}, {'end': 10188.927, 'text': 'So the methods are insert, find, update, and list all.', 'start': 10184.243, 'duration': 4.684}, {'end': 10195.234, 'text': "And for inserting, you may want to test that you're inserting a user into an empty database of users.", 'start': 10189.588, 'duration': 5.646}, {'end': 10196.776, 'text': "So that's what's called an edge case.", 'start': 10195.315, 'duration': 1.461}, {'end': 10205.045, 'text': 'And then the general case is to insert a user into the database, assuming that the user already does not exist.', 'start': 10197.317, 'duration': 7.728}, {'end': 10210.529, 'text': 'Then another edge case is trying to insert a user with a username that already exists right?', 'start': 10205.826, 'duration': 4.703}], 'summary': 'Testing scenarios for user database class methods: insert, find, update, list all.', 'duration': 30.991, 'max_score': 10179.538, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA10179538.jpg'}, {'end': 10729.405, 'src': 'embed', 'start': 10704.213, 'weight': 3, 'content': [{'end': 10710.836, 'text': 'You can directly jump to analyzing its complexity and then move on to optimization and implementing the optimized version.', 'start': 10704.213, 'duration': 6.623}, {'end': 10717.159, 'text': "But when you are practicing or when you're learning, it's always a good idea to implement even the brute force solutions.", 'start': 10711.376, 'duration': 5.783}, {'end': 10720.021, 'text': "So let's analyze the complexity.", 'start': 10718.42, 'duration': 1.601}, {'end': 10725.123, 'text': 'The operations insert, find, update, involve iterating over the list of users.', 'start': 10720.581, 'duration': 4.542}, {'end': 10729.405, 'text': 'And in the worst case, they may take up to N iterations to return a result.', 'start': 10725.483, 'duration': 3.922}], 'summary': 'Analyze complexity and implement brute force solutions, with operations taking up to n iterations.', 'duration': 25.192, 'max_score': 10704.213, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA10704213.jpg'}, {'end': 10892.864, 'src': 'embed', 'start': 10861.557, 'weight': 4, 'content': [{'end': 10865.019, 'text': "Now, what is the worst case scenario here? And let's run this.", 'start': 10861.557, 'duration': 3.462}, {'end': 10870.79, 'text': 'And you can already see that it is taking a while for a hundred million users.', 'start': 10866.687, 'duration': 4.103}, {'end': 10875.173, 'text': 'The loop takes about 10 seconds to complete here.', 'start': 10871.11, 'duration': 4.063}, {'end': 10883.538, 'text': 'It took about 9.45 and a 10 second delay for fetching user profiles will definitely lead to a suboptimal user experience.', 'start': 10875.193, 'duration': 8.345}, {'end': 10886.78, 'text': 'And that may cause users to stop using the platform altogether.', 'start': 10883.738, 'duration': 3.042}, {'end': 10892.864, 'text': 'Now, imagine you came to joven.ai and it took 10 or 15 seconds to load your profile.', 'start': 10886.84, 'duration': 6.024}], 'summary': 'Fetching user profiles takes 9.45-10 seconds, causing suboptimal user experience and potential user drop-off.', 'duration': 31.307, 'max_score': 10861.557, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA10861557.jpg'}], 'start': 9456.899, 'title': 'Managing user profiles and database efficiency', 'summary': 'Covers the development of a fast in-memory data structure to handle profile information for 100 million users at jovian, defining a user database class with four methods, testing scenarios, and implementation details including time complexities. it also addresses the impact of inefficient code on user experience and cloud infrastructure costs.', 'chapters': [{'end': 10014.888, 'start': 9456.899, 'title': 'Fast in-memory data structure for user profiles', 'summary': 'Discusses the development of a fast in-memory data structure to manage profile information for 100 million users at jovian, outlining a systematic problem-solving strategy and explaining the concept of python classes and methods.', 'duration': 557.989, 'highlights': ['The chapter discusses the development of a fast in-memory data structure to manage profile information for 100 million users at Jovian', 'Outlines a systematic problem-solving strategy involving stating the problem clearly, identifying input and output formats, providing example inputs and outputs, and implementing a correct solution', "Explains the concept of Python classes and methods, illustrating the creation of a class 'user' with properties and methods"]}, {'end': 10156.072, 'start': 10015.168, 'title': 'Creating user database class', 'summary': 'Discusses the process of defining the user database class with four methods: insert, find, update, and list all, and creating sample user profiles for testing.', 'duration': 140.904, 'highlights': ['The final output that we want to create for our problem is a data structure, a class called user database with four methods: insert, find, update, and list all.', 'The chapter includes creating seven sample user profiles with a username, name, and email, and storing them in variables using the user class.', 'The process involves implementing an interface and coming up with example inputs and outputs for testing the functions once they are implemented.']}, {'end': 10459.025, 'start': 10156.573, 'title': 'User database testing and implementation', 'summary': 'Discusses setting up test inputs, scenarios for testing methods, and a simple solution for implementing user database functions, including insertion, finding, updating, and listing users.', 'duration': 302.452, 'highlights': ['The methods for testing the user database class are insert, find, update, and list all, including edge cases like inserting into an empty database and inserting a user with an existing username.', 'The proposed solution involves storing user objects in a sorted list and implementing functions like insert, find, update, and list by looping through the list and maintaining sorted order.', "The implementation of the user database class involves setting the property 'users' to an empty list and defining the insertion process to find the correct position for the new user based on alphabetical order."]}, {'end': 10814.35, 'start': 10460.127, 'title': 'Simple user database implementation', 'summary': "Demonstrates the implementation of a simple user database class, allowing insertion, retrieval, updating, and listing of user information. the operations' time complexities are analyzed, revealing insert, find, and update have order n worst case time complexity, while the list function has an order one complexity.", 'duration': 354.223, 'highlights': ['The operations insert, find, update, involve iterating over the list of users and may take up to N iterations in the worst case, where N is the total number of users.', 'The list function has an order one complexity, returning the list in constant time regardless of the number of users in the database.', 'The chapter demonstrates the implementation of a simple user database class, allowing insertion, retrieval, updating, and listing of user information.']}, {'end': 11055.977, 'start': 10814.35, 'title': 'Optimizing backend efficiency', 'summary': 'Discusses the impact of inefficient code on user experience, highlighting how a 10-second delay for fetching user profiles can lead to suboptimal user experience, limiting the number of users that can access the platform, and increasing cloud infrastructure costs by millions of dollars.', 'duration': 241.627, 'highlights': ['A 10-second delay for fetching user profiles will lead to a suboptimal user experience, potentially causing users to stop using the platform altogether.', 'A 10-second processing time for each user request will significantly limit the number of users that can access the platform at a time.', 'Inefficient backend code could increase the cloud infrastructure costs for the company by millions of dollars.']}], 'duration': 1599.078, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA9456899.jpg', 'highlights': ['The chapter discusses the development of a fast in-memory data structure to manage profile information for 100 million users at Jovian', 'The final output that we want to create for our problem is a data structure, a class called user database with four methods: insert, find, update, and list all', 'The methods for testing the user database class are insert, find, update, and list all, including edge cases like inserting into an empty database and inserting a user with an existing username', 'The operations insert, find, update, involve iterating over the list of users and may take up to N iterations in the worst case, where N is the total number of users', 'A 10-second delay for fetching user profiles will lead to a suboptimal user experience, potentially causing users to stop using the platform altogether']}, {'end': 12888.971, 'segs': [{'end': 11103.31, 'src': 'embed', 'start': 11077.034, 'weight': 0, 'content': [{'end': 11082.056, 'text': 'And we can limit the number of iterations required for common operations like find,', 'start': 11077.034, 'duration': 5.022}, {'end': 11090.258, 'text': 'insert and update by ditching the linear structure that we had earlier and organizing our data in a more tree like structure.', 'start': 11082.056, 'duration': 8.202}, {'end': 11092.439, 'text': "So this is a structure that we'll use for our data.", 'start': 11090.599, 'duration': 1.84}, {'end': 11094.3, 'text': 'And we will call this a binary tree.', 'start': 11092.539, 'duration': 1.761}, {'end': 11101.107, 'text': 'Now this is called a tree because it vaguely resembles an inverted tree trunk with branches.', 'start': 11095.2, 'duration': 5.907}, {'end': 11103.31, 'text': 'So you can think of this as the root.', 'start': 11101.548, 'duration': 1.762}], 'summary': 'Organizing data in a binary tree reduces iterations and improves operations efficiency.', 'duration': 26.276, 'max_score': 11077.034, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA11077034.jpg'}, {'end': 11537.377, 'src': 'embed', 'start': 11511.474, 'weight': 1, 'content': [{'end': 11516.819, 'text': 'that the insert, find and update operations in a balanced binary search tree have complexity order of login.', 'start': 11511.474, 'duration': 5.345}, {'end': 11524.466, 'text': "So in our original implementation, our brute force implementation, they had order in, and this time we've reduced the complexity to order login,", 'start': 11517.419, 'duration': 7.047}, {'end': 11525.627, 'text': 'and that is far better.', 'start': 11524.466, 'duration': 1.161}, {'end': 11528.729, 'text': "And we'll see how that happens.", 'start': 11527.248, 'duration': 1.481}, {'end': 11533.113, 'text': "Okay So that's a quick introduction to binary search trees.", 'start': 11529.17, 'duration': 3.943}, {'end': 11535.435, 'text': "We have, we've had enough theory.", 'start': 11533.153, 'duration': 2.282}, {'end': 11537.377, 'text': "Now let's get into some implementation.", 'start': 11535.495, 'duration': 1.882}], 'summary': 'Balanced binary search tree reduced complexity to order log n.', 'duration': 25.903, 'max_score': 11511.474, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA11511474.jpg'}, {'end': 11665.993, 'src': 'embed', 'start': 11642.539, 'weight': 2, 'content': [{'end': 11649.143, 'text': "And here's a very common interview question that you might get implement a binary tree using Python and then show its usage with some examples.", 'start': 11642.539, 'duration': 6.604}, {'end': 11656.349, 'text': "So what we'll do as we implement binary trees and binary search trees is to also cover many common interview questions.", 'start': 11649.604, 'duration': 6.745}, {'end': 11658.37, 'text': "In fact, we'll cover exactly 15.", 'start': 11656.409, 'duration': 1.961}, {'end': 11659.251, 'text': "So that's a quite a few.", 'start': 11658.37, 'duration': 0.881}, {'end': 11665.993, 'text': "And the first one is to implement a binary tree and to begin, we'll create a very simple binary tree.", 'start': 11660.93, 'duration': 5.063}], 'summary': 'Implement a binary tree using python and cover 15 common interview questions.', 'duration': 23.454, 'max_score': 11642.539, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA11642539.jpg'}, {'end': 12312.078, 'src': 'embed', 'start': 12278.877, 'weight': 3, 'content': [{'end': 12281.698, 'text': 'Define a function now to convert a tree back to a tuple.', 'start': 12278.877, 'duration': 2.821}, {'end': 12286.279, 'text': 'So if you have a binary tree can work, return a tuple representing the same tree.', 'start': 12281.718, 'duration': 4.561}, {'end': 12293.44, 'text': 'For instance, for the tree created about three, two calling tree to topple should return this original tuple, which is used to create the tree.', 'start': 12286.359, 'duration': 7.081}, {'end': 12296.781, 'text': "And here's a hint on how to do this use recursion.", 'start': 12294, 'duration': 2.781}, {'end': 12303.242, 'text': 'So do fill this out and see if you can figure out how to do this.', 'start': 12298.101, 'duration': 5.141}, {'end': 12312.078, 'text': 'So now we have defined a class for a binary tree, and we also have a way for creating a binary tree from a tuple.', 'start': 12304.895, 'duration': 7.183}], 'summary': 'Define a function to convert binary tree to tuple using recursion.', 'duration': 33.201, 'max_score': 12278.877, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA12278877.jpg'}, {'end': 12464.294, 'src': 'embed', 'start': 12438.166, 'weight': 4, 'content': [{'end': 12442.787, 'text': 'One of the frequently asked questions in interviews is to traverse a binary tree.', 'start': 12438.166, 'duration': 4.621}, {'end': 12444.888, 'text': 'Binary tree traversals are very common.', 'start': 12442.867, 'duration': 2.021}, {'end': 12451.09, 'text': 'So you may face one of these three questions write a function to perform the inorder traversal of a binary tree,', 'start': 12445.388, 'duration': 5.702}, {'end': 12457.772, 'text': 'or write a function to perform the preorder traversal of a binary tree, or write a function to perform the postorder traversal of a binary tree.', 'start': 12451.09, 'duration': 6.682}, {'end': 12464.294, 'text': 'What do you mean by a traversal? A traversal refers to the process of visiting each node of a tree exactly once.', 'start': 12458.272, 'duration': 6.022}], 'summary': 'Frequent interview question: traverse binary tree; common traversals: inorder, preorder, postorder.', 'duration': 26.128, 'max_score': 12438.166, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA12438166.jpg'}], 'start': 11056.657, 'title': 'Binary trees and tree operations', 'summary': 'Covers binary search trees, their properties, implementation in python, conversion of tuple into tree, recursion, tree visualization, traversals, and operations, emphasizing efficiency, common interview questions, and practical applications.', 'chapters': [{'end': 11641.978, 'start': 11056.657, 'title': 'Binary search trees and tree properties', 'summary': 'Introduces binary search trees as an efficient data structure for organizing and retrieving data, emphasizing the properties of a binary search tree, its balanced nature, and its relationship between height and the total number of nodes. it also highlights the complexity reduction from order n to order log n for operations in a balanced binary search tree, and its common usage in programming languages and file systems.', 'duration': 585.321, 'highlights': ['Binary search trees are introduced as an efficient data structure for organizing and retrieving data', 'Properties of a binary search tree and its balanced nature are emphasized', 'The relationship between the height of the tree and the total number of nodes is discussed', 'Complexity reduction from order n to order log n for operations in a balanced binary search tree is emphasized', 'Common usage of binary search trees in programming languages and file systems is mentioned']}, {'end': 11841.635, 'start': 11642.539, 'title': 'Binary tree implementation in python', 'summary': 'Covers the implementation of a binary tree in python, including creating nodes, connecting them, and accessing their values, with the goal of covering 15 common interview questions related to binary trees and binary search trees.', 'duration': 199.096, 'highlights': ['The chapter covers the implementation of a binary tree in Python, including creating nodes, connecting them, and accessing their values, with the goal of covering 15 common interview questions related to binary trees and binary search trees.', 'The simple class representing a single node within the tree is called tree node, with a constructor function that sets self.key to the provided key and initializes self.left and self.right to none.', 'The root node, with the value 3, is connected to its left child and right child, represented by nodes 1 and 2, forming a simple binary tree structure.', 'The exercise involves creating a more complicated tree structure with specific left and right child arrangements and manually viewing the different levels of the tree.']}, {'end': 12121.55, 'start': 11841.655, 'title': 'Converting tuple into tree', 'summary': 'Discusses the conversion of a tuple into a tree structure using a recursive function, with an example of a 3-tuple representing the root node, left subtree, and right subtree, and explains how the recursion stops when it reaches a leaf node or a value of none.', 'duration': 279.895, 'highlights': ['The chapter discusses the conversion of a tuple into a tree structure using a recursive function.', 'An example of a 3-tuple representing the root node, left subtree, and right subtree is provided.', 'The recursion stops when it reaches a leaf node or a value of none.']}, {'end': 12437.064, 'start': 12123.09, 'title': 'Recursion and tree visualization', 'summary': 'Discusses the concept of recursion and its application in constructing and visualizing trees, demonstrating the power of recursion in creating trees of any size and providing exercises to convert trees to tuples and visualize trees using a tree-like structure.', 'duration': 313.974, 'highlights': ['The recursive function can now construct trees of any levels, creating a tree of any size with the right structure.', 'Providing exercises to convert trees to tuples and visualize trees using a tree-like structure, enabling the exploration of different tree structures.', 'Emphasizing the importance of spending time to create good string representations for data structures to facilitate testing different scenarios.']}, {'end': 12888.971, 'start': 12438.166, 'title': 'Binary tree traversals and operations', 'summary': 'Discusses the three common binary tree traversals - inorder, preorder, and postorder, their recursive structure, and practical applications in interviews. it also covers functions to calculate the height and count the number of nodes in a binary tree, with examples and explanations.', 'duration': 450.805, 'highlights': ['The chapter discusses the three common binary tree traversals - inorder, preorder, and postorder.', 'Functions to calculate the height and count the number of nodes in a binary tree are also covered, with examples and explanations.', 'Encapsulation technique for compiling all methods within the tree node class is discussed as a good programming practice.']}], 'duration': 1832.314, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA11056657.jpg', 'highlights': ['Binary search trees are efficient for organizing and retrieving data', 'Complexity reduction to order log n for operations in a balanced binary search tree', 'Covers implementation of binary tree in Python, including 15 common interview questions', 'Conversion of tuple into a tree structure using a recursive function', 'Discusses common binary tree traversals - inorder, preorder, and postorder']}, {'end': 14105.615, 'segs': [{'end': 12920.013, 'src': 'embed', 'start': 12888.991, 'weight': 4, 'content': [{'end': 12895.435, 'text': "Okay So we've now added the methods, height, size, traverse and order display keys to tuple.", 'start': 12888.991, 'duration': 6.444}, {'end': 12898.157, 'text': "And we've also added these methods, STR and wrapper.", 'start': 12895.956, 'duration': 2.201}, {'end': 12903.18, 'text': 'And remember quiz one, or you can go on LinkedIn and post an answer to what these functions do.', 'start': 12898.577, 'duration': 4.603}, {'end': 12905.742, 'text': 'And finally parse tuple as well.', 'start': 12904.281, 'duration': 1.461}, {'end': 12911.186, 'text': 'Okay So all of these functions are now added within the class and you can try it out here.', 'start': 12905.762, 'duration': 5.424}, {'end': 12920.013, 'text': 'So for instance, here we have a tree tuple and we can call tree node dot pass tuple to convert this tree tuple into a tree.', 'start': 12911.807, 'duration': 8.206}], 'summary': 'New methods added to tuple class for height, size, traverse, order display, str, wrapper, and parse tuple.', 'duration': 31.022, 'max_score': 12888.991, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA12888991.jpg'}, {'end': 13142.968, 'src': 'embed', 'start': 13116.062, 'weight': 0, 'content': [{'end': 13121.343, 'text': 'Is by actually looking at the left subtree and the right subtree recursively.', 'start': 13116.062, 'duration': 5.281}, {'end': 13128.025, 'text': 'So we call is BST on the left subtree of the node and we call is BST on the right subtree of the node.', 'start': 13121.443, 'duration': 6.582}, {'end': 13135.266, 'text': 'So we get back three values, which is, is the left subtree of binary search tree is the right subtree binary search tree.', 'start': 13128.985, 'duration': 6.281}, {'end': 13138.287, 'text': 'The minimum key in the left subtree,', 'start': 13136.507, 'duration': 1.78}, {'end': 13142.968, 'text': 'the minimum key in the right subtree and then the maximum key in the left subtree and the maximum key in the right subtree.', 'start': 13138.287, 'duration': 4.681}], 'summary': 'Recursively determine if left and right subtrees are bsts, obtaining minimum and maximum keys.', 'duration': 26.906, 'max_score': 13116.062, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA13116062.jpg'}, {'end': 13583.218, 'src': 'embed', 'start': 13557.358, 'weight': 2, 'content': [{'end': 13564.044, 'text': "Okay So now we have this tree and let's say we want to insert a new user with the username Tanya into this tree.", 'start': 13557.358, 'duration': 6.686}, {'end': 13569.769, 'text': 'So first we started the root and then we compare the key to be inserted with the current nodes T keys.', 'start': 13564.104, 'duration': 5.665}, {'end': 13570.729, 'text': 'The current node is the root.', 'start': 13569.809, 'duration': 0.92}, {'end': 13576.734, 'text': 'So we compare Tanya with Jadesh and we see that Tanya is greater than Jadesh because T comes after J.', 'start': 13570.889, 'duration': 5.845}, {'end': 13583.218, 'text': 'So obviously Tanya should not be inserted into the left subtree rather Tanya should be inserted into the right subtree.', 'start': 13577.535, 'duration': 5.683}], 'summary': 'Insert a new user tanya into the tree, comparing keys at each node.', 'duration': 25.86, 'max_score': 13557.358, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA13557358.jpg'}, {'end': 13924.782, 'src': 'embed', 'start': 13898.961, 'weight': 1, 'content': [{'end': 13903.483, 'text': "So maintaining the balance of a binary search tree is very important and we'll see how to do that.", 'start': 13898.961, 'duration': 4.522}, {'end': 13907.764, 'text': "So we've seen how to insert a node.", 'start': 13906.121, 'duration': 1.643}, {'end': 13913.073, 'text': 'Now the next thing is to find the value associated with a given key in a binary search tree.', 'start': 13908.104, 'duration': 4.969}, {'end': 13917.38, 'text': 'So once again, we can follow a recursive strategy here, similar to insertion.', 'start': 13913.293, 'duration': 4.087}, {'end': 13918.642, 'text': 'So we check.', 'start': 13918.161, 'duration': 0.481}, {'end': 13920.38, 'text': 'We start from the top.', 'start': 13919.58, 'duration': 0.8}, {'end': 13922.301, 'text': "Let's say we want to find the key Hemanth.", 'start': 13920.56, 'duration': 1.741}, {'end': 13924.782, 'text': 'We start from the top and we compare it with the root node.', 'start': 13922.321, 'duration': 2.461}], 'summary': 'Maintaining balance in binary search tree is crucial for insertion and finding values.', 'duration': 25.821, 'max_score': 13898.961, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA13898961.jpg'}], 'start': 12888.991, 'title': 'Binary search trees', 'summary': "Covers tuple methods for tree node class, enabling manipulation of binary trees, discusses binary search trees' properties, and functions, creation of bst node, and operations such as inserting, finding, and updating values with insights into recursive strategies.", 'chapters': [{'end': 12957.505, 'start': 12888.991, 'title': 'Tuple methods for tree node class', 'summary': 'Introduces the addition of methods like height, size, traverse, order display, str, and wrapper to the tuple, enabling the representation and manipulation of binary trees with these functions.', 'duration': 68.514, 'highlights': ['The addition of methods like height, size, traverse, order display, STR, and wrapper to the tuple, enabling the representation and manipulation of binary trees with these functions.', 'The process of converting a tree tuple into a tree by calling tree node dot pass tuple, demonstrating the representation of a binary tree using a tuple-like structure, and the display of the hierarchical structure using display keys.', 'The ability to check the height and size of the tree using tree dot height and tree dot size, respectively, providing means for quantifying the characteristics of the binary tree.']}, {'end': 13320.036, 'start': 12957.666, 'title': 'Binary search trees overview', 'summary': 'Discusses binary search trees (bsts), their properties, and the functions to check if a binary tree is a bst, find the maximum key, and find the minimum key, emphasizing the conditions and recursive approach to verify and calculate the properties.', 'duration': 362.37, 'highlights': ["The chapter discusses the properties of a binary search tree (BST) and the conditions that each node's left subtree should only contain nodes with keys less than the current node's key, and the right subtree should only contain nodes with keys greater than the current node's key.", 'It introduces functions to check if a binary tree is a BST, find the maximum key in a binary tree, and find the minimum key in a binary tree, all addressed by a single function called isBST, which returns whether the node and the tree under that node is a BST, the minimum key, and the maximum key.', 'The chapter explains the recursive approach to calculate if the entire tree is a binary search tree by analyzing the left and right subtrees and verifying the maximum and minimum keys, ultimately determining if the entire tree is a BST.']}, {'end': 13550.818, 'start': 13320.376, 'title': 'Bst node and binary search tree', 'summary': 'Discusses the creation of a binary search tree (bst) node with key-value pairs, where a new class called bst node represents the nodes of the bst, and the process of inserting values into the bst automatically using the insert function is explained.', 'duration': 230.442, 'highlights': ['Creation of BST node with key-value pairs', 'Inserting values into the BST automatically using the insert function', 'Dynamic nature of Python functions']}, {'end': 14105.615, 'start': 13557.358, 'title': 'Binary search tree operations', 'summary': 'Explains the process of inserting, finding, and updating values in a binary search tree, emphasizing the impact of structure on performance and the importance of maintaining balance, with examples and insights into the recursive strategies used to execute these operations.', 'duration': 548.257, 'highlights': ['The process of inserting a new user, Tanya, into the binary search tree is explained, highlighting the recursive nature of the insertion process and the importance of maintaining the binary search tree property.', 'The significance of maintaining balance in a binary search tree is discussed, emphasizing the impact of the order of node insertion on the resulting tree structure and its implications on tree height and performance.', 'The process of finding a value associated with a given key in a binary search tree is outlined, with emphasis on the recursive strategy and the efficiency of the search operation in a balanced tree.', 'Insights into updating a value in a binary search tree, utilizing the find function for node retrieval and emphasizing the importance of code reusability and generic functions.']}], 'duration': 1216.624, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA12888991.jpg', 'highlights': ['The recursive approach to calculate if the entire tree is a binary search tree by analyzing the left and right subtrees and verifying the maximum and minimum keys, ultimately determining if the entire tree is a BST.', 'The process of finding a value associated with a given key in a binary search tree is outlined, with emphasis on the recursive strategy and the efficiency of the search operation in a balanced tree.', 'The process of inserting a new user, Tanya, into the binary search tree is explained, highlighting the recursive nature of the insertion process and the importance of maintaining the binary search tree property.', 'The significance of maintaining balance in a binary search tree is discussed, emphasizing the impact of the order of node insertion on the resulting tree structure and its implications on tree height and performance.', 'The addition of methods like height, size, traverse, order display, STR, and wrapper to the tuple, enabling the representation and manipulation of binary trees with these functions.']}, {'end': 15721.251, 'segs': [{'end': 14182.78, 'src': 'embed', 'start': 14127.761, 'weight': 2, 'content': [{'end': 14136.143, 'text': 'Now the value of the node was successfully updated and you can edit and you can easily check that the time complexity of update is same as that of fine.', 'start': 14127.761, 'duration': 8.382}, {'end': 14145.178, 'text': 'Now, finally, we have the last operation that was required,', 'start': 14140.356, 'duration': 4.822}, {'end': 14151.802, 'text': 'and this was to write a function to retrieve all the key value pairs stored in a binary search tree in the sorted order of keys.', 'start': 14145.178, 'duration': 6.624}, {'end': 14162.23, 'text': 'This is a question that you might face once again, and this is simply the inorder traversal.', 'start': 14156.024, 'duration': 6.206}, {'end': 14164.333, 'text': "It's a different way of stating the inorder traversal.", 'start': 14162.351, 'duration': 1.982}, {'end': 14176.045, 'text': 'Now what you will have to figure out or reason about is why the inorder traversal of a binary search tree produces a sorted array of our sorted list of keys.', 'start': 14164.873, 'duration': 11.172}, {'end': 14178.267, 'text': 'Think about it.', 'start': 14177.766, 'duration': 0.501}, {'end': 14182.78, 'text': "So here's the list all function.", 'start': 14181.539, 'duration': 1.241}], 'summary': 'Node value updated, time complexity same as find. function to retrieve key value pairs in sorted order via inorder traversal.', 'duration': 55.019, 'max_score': 14127.761, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA14127761.jpg'}, {'end': 14302.15, 'src': 'embed', 'start': 14260.523, 'weight': 6, 'content': [{'end': 14264.466, 'text': 'Now, the next thing is to look at balanced binary trees.', 'start': 14260.523, 'duration': 3.943}, {'end': 14271.271, 'text': 'And this is once again, a very common question that gets asked, write a function to determine if a binary tree is balanced.', 'start': 14264.866, 'duration': 6.405}, {'end': 14274.294, 'text': "And here's a recursive strategy to do this.", 'start': 14272.612, 'duration': 1.682}, {'end': 14279.758, 'text': 'In fact, this is really the definition of balanced binary trees.', 'start': 14277.136, 'duration': 2.622}, {'end': 14281.819, 'text': 'The left subtree should be balanced.', 'start': 14280.458, 'duration': 1.361}, {'end': 14283.961, 'text': 'The right subtree should be balanced.', 'start': 14282.4, 'duration': 1.561}, {'end': 14289.485, 'text': 'And the difference between the heights of the left and right subtree should not be more than one.', 'start': 14285.743, 'duration': 3.742}, {'end': 14291.225, 'text': 'Okay So this is an important thing.', 'start': 14289.505, 'duration': 1.72}, {'end': 14294.707, 'text': "Now, when we're looking for balance, we're not always looking for perfect balance,", 'start': 14291.265, 'duration': 3.442}, {'end': 14302.15, 'text': 'because it may not always be possible to create a tree with perfect balance, because to have a perfectly balanced tree where, for every node,', 'start': 14294.707, 'duration': 7.443}], 'summary': 'Recursive function to check balanced binary trees based on height difference.', 'duration': 41.627, 'max_score': 14260.523, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA14260523.jpg'}, {'end': 14344.649, 'src': 'embed', 'start': 14320.51, 'weight': 8, 'content': [{'end': 14327.756, 'text': 'or you can have a tree with seven nodes which satisfies this property, but you may not be able to get a tree with six nodes to satisfy that property.', 'start': 14320.51, 'duration': 7.246}, {'end': 14335.581, 'text': 'For instance, if you remove Vishal here, you will see that The left subtree and right subtree of this node Sonaksh will not be of equal height.', 'start': 14327.836, 'duration': 7.745}, {'end': 14338.744, 'text': "That's why for balancing, we relax the criteria slightly.", 'start': 14336.002, 'duration': 2.742}, {'end': 14344.649, 'text': 'We simply need to ensure that the difference between the heights of the left and the right subtrees is not more than one.', 'start': 14339.004, 'duration': 5.645}], 'summary': 'Balancing trees by ensuring height difference not more than one.', 'duration': 24.139, 'max_score': 14320.51, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA14320510.jpg'}, {'end': 14579.309, 'src': 'embed', 'start': 14534.585, 'weight': 9, 'content': [{'end': 14539.388, 'text': "So there's another concept called complete binary trees, which is slightly similar to balanced binary trees, but.", 'start': 14534.585, 'duration': 4.803}, {'end': 14542.533, 'text': "It's a slightly stricter criteria.", 'start': 14540.911, 'duration': 1.622}, {'end': 14547.599, 'text': 'So you can check out this problem here and you simply need to modify the is balanced.', 'start': 14542.733, 'duration': 4.866}, {'end': 14552.005, 'text': 'The code for is balanced slightly to get the code for complete binary trees.', 'start': 14547.7, 'duration': 4.305}, {'end': 14554.248, 'text': 'So do check out this problem on leadcode.com.', 'start': 14552.025, 'duration': 2.223}, {'end': 14560.819, 'text': "All right, so we've looked at binary search trees and we've looked at balanced binary trees.", 'start': 14556.758, 'duration': 4.061}, {'end': 14564.961, 'text': "Now let's bring them both together into balanced binary search trees.", 'start': 14560.899, 'duration': 4.062}, {'end': 14569.463, 'text': "And here's one question that you will face at some point.", 'start': 14565.701, 'duration': 3.762}, {'end': 14572.964, 'text': 'Write a function to create a balanced binary search tree.', 'start': 14569.983, 'duration': 2.981}, {'end': 14576.707, 'text': 'from a sorted list of key value pairs.', 'start': 14573.684, 'duration': 3.023}, {'end': 14579.309, 'text': 'So you have a sorted list of key value pairs.', 'start': 14577.688, 'duration': 1.621}], 'summary': 'Introduction to complete binary trees and creating balanced binary search trees from sorted key-value pairs.', 'duration': 44.724, 'max_score': 14534.585, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA14534585.jpg'}, {'end': 14667.981, 'src': 'embed', 'start': 14642.794, 'weight': 11, 'content': [{'end': 14649.496, 'text': 'So if you take the right half and you create a balanced BST out of it, and then make it the right child of the middle element.', 'start': 14642.794, 'duration': 6.702}, {'end': 14653.257, 'text': "So that's the idea here.", 'start': 14652.237, 'duration': 1.02}, {'end': 14662.96, 'text': "And how do you make a balanced BST for the left or right child? Recursion, right? So once again, here's a recursive solution.", 'start': 14654.117, 'duration': 8.843}, {'end': 14667.981, 'text': 'So make balance BST takes data, which is a list of key value pairs.', 'start': 14664.48, 'duration': 3.501}], 'summary': 'Create a balanced bst using recursion for data list.', 'duration': 25.187, 'max_score': 14642.794, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA14642794.jpg'}, {'end': 14855.093, 'src': 'embed', 'start': 14830.381, 'weight': 12, 'content': [{'end': 14836.365, 'text': 'And this is kind of a trick question because if you were given this question directly, you may not be able to think about what to do.', 'start': 14830.381, 'duration': 5.984}, {'end': 14841.569, 'text': 'How do you balance an unbalanced binary search tree? But now that we have, we have a way to.', 'start': 14836.585, 'duration': 4.984}, {'end': 14855.093, 'text': 'create a balanced binary search tree from a sorted array of key value pairs, and we have a way to get a sorted area of key value pairs.', 'start': 14843.206, 'duration': 11.887}], 'summary': 'Method for balancing binary search trees from sorted arrays is explained.', 'duration': 24.712, 'max_score': 14830.381, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA14830381.jpg'}, {'end': 15071.233, 'src': 'embed', 'start': 15036.751, 'weight': 0, 'content': [{'end': 15040.252, 'text': 'So looping through a hundred million numbers rather than 26.', 'start': 15036.751, 'duration': 3.501}, {'end': 15042.393, 'text': 'And that obviously takes far, far longer.', 'start': 15040.252, 'duration': 2.141}, {'end': 15047.495, 'text': 'And we saw that it took about 10 seconds, right? About 9.98 seconds.', 'start': 15043.333, 'duration': 4.162}, {'end': 15058.499, 'text': 'So to find an update, finding and updating a node in a balanced binary search tree is 300, 000 times faster than our original solution.', 'start': 15048.015, 'duration': 10.484}, {'end': 15061.34, 'text': "And all we've changed here is the data structure.", 'start': 15058.979, 'duration': 2.361}, {'end': 15071.233, 'text': "And that's the importance of data structures because now each user will be able to view their profile in just 19.1 microseconds.", 'start': 15062.768, 'duration': 8.465}], 'summary': 'Balanced binary search tree is 300,000 times faster than original solution, reducing profile view time to 19.1 microseconds.', 'duration': 34.482, 'max_score': 15036.751, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA15036751.jpg'}, {'end': 15117.564, 'src': 'embed', 'start': 15089.082, 'weight': 1, 'content': [{'end': 15095.363, 'text': 'And finally, your hardware cost will also be far lower because now your CPU is busy for a lesser time.', 'start': 15089.082, 'duration': 6.281}, {'end': 15103.445, 'text': 'So you do not need to use a very large machine, or you do not need to use too many machines to support hundreds of millions of users.', 'start': 15095.383, 'duration': 8.062}, {'end': 15106.746, 'text': 'And that is the benefit of choosing the right data structure.', 'start': 15104.486, 'duration': 2.26}, {'end': 15109.007, 'text': "Now there's one tip here.", 'start': 15107.946, 'duration': 1.061}, {'end': 15117.564, 'text': 'How do you speed up insertions? So what we may do is we may choose to perform the balancing periodically instead of at every insertions.', 'start': 15109.127, 'duration': 8.437}], 'summary': 'Choosing the right data structure lowers hardware cost, reducing cpu usage and machine needs, benefiting hundreds of millions of users.', 'duration': 28.482, 'max_score': 15089.082, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA15089082.jpg'}, {'end': 15435.818, 'src': 'embed', 'start': 15412.312, 'weight': 4, 'content': [{'end': 15419.515, 'text': 'So the reason is these are special methods that are treated specially in Python.', 'start': 15412.312, 'duration': 7.203}, {'end': 15421.436, 'text': "So here's how you can use them.", 'start': 15420.295, 'duration': 1.141}, {'end': 15426.511, 'text': "Let's first get a list of users that we'll later insert into a tree.", 'start': 15422.768, 'duration': 3.743}, {'end': 15428.132, 'text': "Let's get a tree map.", 'start': 15427.272, 'duration': 0.86}, {'end': 15431.735, 'text': 'So we instantiate the tree map function or the tree Mac class.', 'start': 15428.312, 'duration': 3.423}, {'end': 15433.717, 'text': 'And that gives us a new tree map inside it.', 'start': 15431.775, 'duration': 1.942}, {'end': 15434.958, 'text': 'There is no binary tree.', 'start': 15433.957, 'duration': 1.001}, {'end': 15435.818, 'text': 'You can check.', 'start': 15435.298, 'duration': 0.52}], 'summary': 'Python special methods for tree map instantiation.', 'duration': 23.506, 'max_score': 15412.312, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA15412312.jpg'}, {'end': 15674.434, 'src': 'embed', 'start': 15644.842, 'weight': 13, 'content': [{'end': 15646.382, 'text': 'We simply create a new tree map.', 'start': 15644.842, 'duration': 1.54}, {'end': 15648.083, 'text': 'Adding values is very easy.', 'start': 15646.943, 'duration': 1.14}, {'end': 15649.764, 'text': 'We simply use the indexing notation.', 'start': 15648.123, 'duration': 1.641}, {'end': 15651.285, 'text': 'Removing elements is very easy.', 'start': 15649.964, 'duration': 1.321}, {'end': 15653.686, 'text': 'Well, not removing a finding elements is very easy.', 'start': 15651.425, 'duration': 2.261}, {'end': 15656.127, 'text': 'We simply use the indexing notation.', 'start': 15654.246, 'duration': 1.881}, {'end': 15658.308, 'text': 'Updating elements is the same as inserting.', 'start': 15656.267, 'duration': 2.041}, {'end': 15662.851, 'text': 'We can also check the size of the tree quite easily using the land function.', 'start': 15659.169, 'duration': 3.682}, {'end': 15669.254, 'text': 'And then we can also use iterate over the keys, iterate over all the users in a for loop quite easily.', 'start': 15662.951, 'duration': 6.303}, {'end': 15674.434, 'text': 'And we can also update values as you see here, values have been updated.', 'start': 15671.331, 'duration': 3.103}], 'summary': 'Creating, updating, and iterating through a tree map is straightforward and efficient.', 'duration': 29.592, 'max_score': 15644.842, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA15644842.jpg'}, {'end': 15730.196, 'src': 'embed', 'start': 15703.036, 'weight': 15, 'content': [{'end': 15709.602, 'text': "So that's why I always think carefully about the interface or the API of your functions or of your modules or of your classes.", 'start': 15703.036, 'duration': 6.566}, {'end': 15712.644, 'text': 'Try to make them as Python friendly as possible.', 'start': 15710.603, 'duration': 2.041}, {'end': 15718.609, 'text': 'This was something that will be appreciated that will be appreciated in interviews and by coworkers.', 'start': 15713.145, 'duration': 5.464}, {'end': 15721.251, 'text': 'So make them Python friendly so that.', 'start': 15719.87, 'duration': 1.381}, {'end': 15730.196, 'text': "When people want to use something you've created, it is extremely intuitive and they do not need to really understand the underlying details.", 'start': 15722.492, 'duration': 7.704}], 'summary': 'Make interfaces python-friendly for better user experience and appreciation in interviews and by coworkers.', 'duration': 27.16, 'max_score': 15703.036, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA15703036.jpg'}], 'start': 14106.716, 'title': 'Binary search tree operations and balanced binary trees', 'summary': 'Covers updating values in a binary search tree with time complexity comparable to finding operations, and discusses the time and space complexity of determining if a binary tree is balanced, with an emphasis on recursive strategies and relaxation of criteria for perfect balance.', 'chapters': [{'end': 14227.59, 'start': 14106.716, 'title': 'Binary search tree operations', 'summary': 'Covers updating values in a binary search tree, with time complexity comparable to finding operations, and retrieving all key value pairs in sorted order using the inorder traversal method.', 'duration': 120.874, 'highlights': ['The update operation in a binary search tree is achieved by finding the node and setting its value, with a demonstrated example of updating a specific node to a new value.', 'The time complexity of the update operation is equated to that of the find operation, ensuring efficient performance.', "The chapter concludes with the implementation of a function to retrieve all key value pairs in sorted order using the inorder traversal method, explaining the reasoning behind why this produces a sorted list of keys and providing a detailed breakdown of the list all function's recursive process."]}, {'end': 14485.804, 'start': 14231.138, 'title': 'Balanced binary trees', 'summary': 'Discusses the time complexity and space complexity of determining if a binary tree is balanced, with an emphasis on the recursive strategy and the relaxation of criteria for perfect balance.', 'duration': 254.666, 'highlights': ['The definition of balanced binary trees is that the left subtree and the right subtree should be balanced, with the height difference not exceeding one.', 'The code for determining if a binary tree is balanced is implemented using a recursive function, checking the balance and height of each subtree.', 'The relaxation of criteria for perfect balance is necessary as it may not always be possible to create a perfectly balanced tree for all numbers of nodes.']}, {'end': 14804.579, 'start': 14486.725, 'title': 'Balanced binary search trees', 'summary': 'Introduces the concept of balanced binary trees and complete binary trees, discusses creating a balanced binary search tree from a sorted list, and presents a recursive solution for building a balanced bst from key-value pairs, emphasizing the importance of implementing a terminating condition when low becomes less than high.', 'duration': 317.854, 'highlights': ['The chapter introduces the concept of balanced binary trees and complete binary trees', 'Creating a balanced binary search tree from a sorted list', 'Recursive solution for building a balanced BST from key-value pairs']}, {'end': 15373.455, 'start': 14805.12, 'title': 'Balancing binary search trees', 'summary': 'Discusses the process of balancing an unbalanced binary search tree using a sorted array, highlighting the benefits of balanced bst in terms of time complexity for insertion, finding, and updating nodes, and the efficiency gain in serving large numbers of users per second.', 'duration': 568.335, 'highlights': ["Balancing an unbalanced binary search tree involves creating a balanced binary search tree from a sorted array of key-value pairs, achieved by calling the sorted array's inorder traversal and passing it into the make balanced BST function.", 'Insertion, finding, and updating nodes in a balanced binary search tree have a time complexity of order log n, significantly faster than the order n time complexity of an unbalanced binary search tree, resulting in a 300,000 times faster performance for finding and updating nodes.', 'The importance of choosing the right data structure is emphasized, as using a balanced binary search tree allows for serving hundreds of thousands of users every second and reducing hardware costs by minimizing the need for large or numerous machines to support a large user base.']}, {'end': 15721.251, 'start': 15374.355, 'title': 'Python-friendly binary tree class', 'summary': 'Introduces the implementation of a python-friendly binary tree class with methods for easy instantiation, insertion, retrieval, update, display, size checking, and iteration, aiming to simplify usage for other team members and users.', 'duration': 346.896, 'highlights': ['The chapter introduces a Python-friendly binary tree class with methods for easy instantiation, insertion, retrieval, update, display, size checking, and iteration.', 'The tree map allows easy instantiation and insertion using indexing notation, making it user-friendly.', 'The implementation facilitates easy retrieval, update, and display of values within the binary tree.', 'The chapter emphasizes the importance of designing Python-friendly interfaces to ease usage for other team members and users.']}], 'duration': 1614.535, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA14106716.jpg', 'highlights': ['Insertion, finding, and updating nodes in a balanced binary search tree have a time complexity of order log n, significantly faster than the order n time complexity of an unbalanced binary search tree, resulting in a 300,000 times faster performance for finding and updating nodes.', 'The importance of choosing the right data structure is emphasized, as using a balanced binary search tree allows for serving hundreds of thousands of users every second and reducing hardware costs by minimizing the need for large or numerous machines to support a large user base.', 'The update operation in a binary search tree is achieved by finding the node and setting its value, with a demonstrated example of updating a specific node to a new value.', 'The time complexity of the update operation is equated to that of the find operation, ensuring efficient performance.', 'The chapter introduces a Python-friendly binary tree class with methods for easy instantiation, insertion, retrieval, update, display, size checking, and iteration.', "The chapter concludes with the implementation of a function to retrieve all key value pairs in sorted order using the inorder traversal method, explaining the reasoning behind why this produces a sorted list of keys and providing a detailed breakdown of the list all function's recursive process.", 'The definition of balanced binary trees is that the left subtree and the right subtree should be balanced, with the height difference not exceeding one.', 'The code for determining if a binary tree is balanced is implemented using a recursive function, checking the balance and height of each subtree.', 'The relaxation of criteria for perfect balance is necessary as it may not always be possible to create a perfectly balanced tree for all numbers of nodes.', 'The chapter introduces the concept of balanced binary trees and complete binary trees', 'Creating a balanced binary search tree from a sorted list', 'Recursive solution for building a balanced BST from key-value pairs', "Balancing an unbalanced binary search tree involves creating a balanced binary search tree from a sorted array of key-value pairs, achieved by calling the sorted array's inorder traversal and passing it into the make balanced BST function.", 'The tree map allows easy instantiation and insertion using indexing notation, making it user-friendly.', 'The implementation facilitates easy retrieval, update, and display of values within the binary tree.', 'The chapter emphasizes the importance of designing Python-friendly interfaces to ease usage for other team members and users.']}, {'end': 17378.607, 'segs': [{'end': 15785.523, 'src': 'embed', 'start': 15738.019, 'weight': 3, 'content': [{'end': 15744.222, 'text': "And I know that it is super efficient because you have designed it and I don't, don't need to worry about the internal details.", 'start': 15738.019, 'duration': 6.203}, {'end': 15750.997, 'text': 'So encapsulation and good API is a very important skill to have to cultivate.', 'start': 15745.655, 'duration': 5.342}, {'end': 15753.457, 'text': 'So do that as you work on programming problems.', 'start': 15751.377, 'duration': 2.08}, {'end': 15756.598, 'text': "Now, once again, let's save our work before committing.", 'start': 15754.577, 'duration': 2.021}, {'end': 15763.5, 'text': 'Now I did tell you that there is a way to create self balancing binary trees.', 'start': 15757.838, 'duration': 5.662}, {'end': 15770.479, 'text': 'And a self balancing mandatory remains balanced after every insertion or deletion.', 'start': 15766.178, 'duration': 4.301}, {'end': 15777.501, 'text': 'And in fact, several decades of research has gone into creating self balancing binary trees, and not just binary trees, but other trees as well,', 'start': 15770.599, 'duration': 6.902}, {'end': 15778.822, 'text': 'which are not binary in nature.', 'start': 15777.501, 'duration': 1.321}, {'end': 15784.263, 'text': 'And many approaches have been devised for instance, red, black trees, AVL trees, and B trees.', 'start': 15779.302, 'duration': 4.961}, {'end': 15785.523, 'text': "So here's an example.", 'start': 15784.623, 'duration': 0.9}], 'summary': 'Encapsulation and good api are important skills. self-balancing trees maintain balance after every insertion or deletion, with various types such as red-black trees, avl trees, and b trees developed after decades of research.', 'duration': 47.504, 'max_score': 15738.019, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA15738019.jpg'}, {'end': 15986.532, 'src': 'embed', 'start': 15963.4, 'weight': 0, 'content': [{'end': 15971.584, 'text': "And that makes your tree very efficient, because now, when you're working with a hundred million records, inserting will also take 20 steps,", 'start': 15963.4, 'duration': 8.184}, {'end': 15977.447, 'text': 'and finding will also take 20 steps, and updating would also take 20 steps, and all of these will work in microseconds.', 'start': 15971.584, 'duration': 5.863}, {'end': 15981.049, 'text': 'So that makes your data structure very efficient.', 'start': 15978.968, 'duration': 2.081}, {'end': 15986.532, 'text': 'And with that, we conclude our discussion of binary search trees.', 'start': 15983.33, 'duration': 3.202}], 'summary': 'Binary search trees are efficient, with insert, find, and update taking 20 steps for 100 million records, working in microseconds.', 'duration': 23.132, 'max_score': 15963.4, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA15963400.jpg'}, {'end': 16104.659, 'src': 'embed', 'start': 16077.982, 'weight': 4, 'content': [{'end': 16083.625, 'text': 'For instance, maps in C++ and Java are binary search trees,', 'start': 16077.982, 'duration': 5.643}, {'end': 16089.207, 'text': 'and data storage systems like file system indexes or relational databases also use something called B trees,', 'start': 16083.625, 'duration': 5.582}, {'end': 16091.188, 'text': 'which is an extension of binary search trees.', 'start': 16089.207, 'duration': 1.981}, {'end': 16099.672, 'text': "So it's very important to know about binary search trees, even if you may not ever need to implement them.", 'start': 16094.329, 'duration': 5.343}, {'end': 16104.659, 'text': 'You may be asked about them.', 'start': 16103.419, 'duration': 1.24}], 'summary': 'Binary search trees are important in c++ and java, also used in data storage systems like file system indexes and relational databases.', 'duration': 26.677, 'max_score': 16077.982, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA16077982.jpg'}, {'end': 16669.008, 'src': 'heatmap', 'start': 16215.046, 'weight': 1, 'content': [{'end': 16219.288, 'text': 'experiment with the code yourself, then complete the assignment, hopefully.', 'start': 16215.046, 'duration': 4.242}, {'end': 16225.246, 'text': 'The next lesson is called divide and conquer and sorting algorithms.', 'start': 16221.564, 'duration': 3.682}, {'end': 16228.348, 'text': 'This is data structures and algorithms in Python.', 'start': 16225.966, 'duration': 2.382}, {'end': 16230.369, 'text': 'And I will see you next time.', 'start': 16229.148, 'duration': 1.221}, {'end': 16232.39, 'text': 'Thank you.', 'start': 16231.99, 'duration': 0.4}, {'end': 16233.03, 'text': 'And goodbye.', 'start': 16232.53, 'duration': 0.5}, {'end': 16237.432, 'text': "Let's look at assignment two of data structures and algorithms in Python.", 'start': 16233.891, 'duration': 3.541}, {'end': 16240.894, 'text': 'The topic of the assignment is hash tables and Python dictionaries.', 'start': 16237.653, 'duration': 3.241}, {'end': 16243.055, 'text': "Let's get started.", 'start': 16242.335, 'duration': 0.72}, {'end': 16247.778, 'text': "The first thing we'll do is go to the course website, pythondsa.com.", 'start': 16244.096, 'duration': 3.682}, {'end': 16254.562, 'text': 'And on the course website, you can find all the lessons and previous assignments.', 'start': 16249.341, 'duration': 5.221}, {'end': 16256.943, 'text': 'We are looking at assignment two.', 'start': 16255.723, 'duration': 1.22}, {'end': 16264.245, 'text': 'So you may want to open that up and assignment two is based on or inspired from some of the topics discussed in lesson two.', 'start': 16257.603, 'duration': 6.642}, {'end': 16268.786, 'text': 'So you may also want to watch lesson two and complete the notebook before you work on assignment two.', 'start': 16264.385, 'duration': 4.401}, {'end': 16270.107, 'text': "Let's open it up.", 'start': 16269.487, 'duration': 0.62}, {'end': 16279.131, 'text': 'Now in this assignment, you will apply some of the concepts learned in the first two lessons to implement a hash table from scratch in Python.', 'start': 16271.187, 'duration': 7.944}, {'end': 16280.412, 'text': "That's very interesting.", 'start': 16279.652, 'duration': 0.76}, {'end': 16283.954, 'text': 'You will, and hash tables are a very important data structure.', 'start': 16280.992, 'duration': 2.962}, {'end': 16291.118, 'text': 'They present in pretty much every programming language and are a common topic discussed and asked in coding interviews.', 'start': 16284.014, 'duration': 7.104}, {'end': 16293.359, 'text': "So we'll see how to implement them from scratch.", 'start': 16291.698, 'duration': 1.661}, {'end': 16297.181, 'text': 'And one of the central problems in hash tables is called collisions.', 'start': 16294.439, 'duration': 2.742}, {'end': 16298.682, 'text': "So we'll see how to handle.", 'start': 16297.581, 'duration': 1.101}, {'end': 16301.642, 'text': 'hashing collisions using linear probing.', 'start': 16299.761, 'duration': 1.881}, {'end': 16305.645, 'text': 'And we will also replicate the functionality of Python dictionary.', 'start': 16302.243, 'duration': 3.402}, {'end': 16309.168, 'text': 'So Python dictionaries are actually implemented using hash tables.', 'start': 16305.685, 'duration': 3.483}, {'end': 16318.435, 'text': 'So we see how to replicate the way Python dictionaries are created and used and modified,', 'start': 16310.829, 'duration': 7.606}, {'end': 16325.54, 'text': 'and the way we access keys and iterate over keys and set values and change values and so on.', 'start': 16318.435, 'duration': 7.105}, {'end': 16328.683, 'text': "So we'll pretty much re-implement the Python dictionary.", 'start': 16326.121, 'duration': 2.562}, {'end': 16334.647, 'text': 'Now we have an assignment starter notebook here, so we can click on view notebook to open up the notebook.', 'start': 16329.485, 'duration': 5.162}, {'end': 16338.328, 'text': 'Once again, this is a Jupyter notebook.', 'start': 16336.428, 'duration': 1.9}, {'end': 16345.311, 'text': 'And as you walk through the notebook, you will find question marks in certain places to complete the assignment.', 'start': 16339.429, 'duration': 5.882}, {'end': 16352.634, 'text': 'You have to replace all the question marks with appropriate values, expressions, or statements to ensure that your notebook runs properly end to end.', 'start': 16345.351, 'duration': 7.283}, {'end': 16357.576, 'text': 'Okay So make sure that you run all the code cells, do not change any variable names.', 'start': 16353.334, 'duration': 4.242}, {'end': 16361.138, 'text': 'And in some cases you may need to add code cells or new statements.', 'start': 16358.077, 'duration': 3.061}, {'end': 16368.442, 'text': "And since you'll be using a temporary online service for code execution, keep saving your work by running jovian.commit at regular intervals.", 'start': 16361.719, 'duration': 6.723}, {'end': 16371.024, 'text': 'There are some optional questions.', 'start': 16369.743, 'duration': 1.281}, {'end': 16374.326, 'text': 'They are not considered for evaluation, but they are for your learning.', 'start': 16371.264, 'duration': 3.062}, {'end': 16375.506, 'text': "Okay So let's run the code.", 'start': 16374.426, 'duration': 1.08}, {'end': 16385.314, 'text': 'Recommended way to run the code is using free online resources, binder specifically, but you can also run it on your computer locally.', 'start': 16377.87, 'duration': 7.444}, {'end': 16388.496, 'text': "So we're going to click run and click run on binder.", 'start': 16385.895, 'duration': 2.601}, {'end': 16395.721, 'text': 'Once again, this may take a few minutes sometimes depending on the current traffic on the platform.', 'start': 16389.616, 'duration': 6.105}, {'end': 16397.442, 'text': 'There we have it.', 'start': 16396.842, 'duration': 0.6}, {'end': 16399.023, 'text': 'Now we have the Jupyter notebook running.', 'start': 16397.482, 'duration': 1.541}, {'end': 16406.828, 'text': 'The first thing I like to do is click kernel and restart and clear output so that we can execute all the code cells and see their outputs from scratch.', 'start': 16400.103, 'duration': 6.725}, {'end': 16414.561, 'text': "i'm also going to hide the header and the toolbar and zoom in here a little bit so we can see things a little better.", 'start': 16407.768, 'duration': 6.793}, {'end': 16422.545, 'text': 'The first thing we will do is set a project name, import the Jovian library and run Jovian.commit.', 'start': 16416.124, 'duration': 6.421}, {'end': 16426.687, 'text': 'This will allow you to save a snapshot of your work to your Jovian profile.', 'start': 16422.806, 'duration': 3.881}, {'end': 16430.707, 'text': 'So now you have a copy of the assignment starter notebook.', 'start': 16427.167, 'duration': 3.54}, {'end': 16435.99, 'text': 'Any modifications that you make every time you run Jovian.commit will get saved to your personal copy.', 'start': 16431.329, 'duration': 4.661}, {'end': 16439.35, 'text': 'And it is this personal copy that you will submit at the very end.', 'start': 16436.43, 'duration': 2.92}, {'end': 16442.651, 'text': "So let's talk about the problem statement.", 'start': 16440.33, 'duration': 2.321}, {'end': 16448.98, 'text': 'In this assignment, you will recreate Python dictionaries from scratch using a data structure called hash tables.', 'start': 16443.502, 'duration': 5.478}, {'end': 16453.45, 'text': 'And dictionaries in Python are used to store key value pairs.', 'start': 16450.187, 'duration': 3.263}, {'end': 16456.651, 'text': 'So keys are used to store and retrieve values.', 'start': 16453.93, 'duration': 2.721}, {'end': 16458.151, 'text': "And here's an example.", 'start': 16457.35, 'duration': 0.801}, {'end': 16462.734, 'text': "Here's a dictionary for storing and retrieving phone numbers using people's names.", 'start': 16458.732, 'duration': 4.002}, {'end': 16469.476, 'text': 'So we have a dictionary called phone numbers, and the way you create a dictionary is using this special character, the brace or the curly bracket,', 'start': 16462.993, 'duration': 6.483}, {'end': 16470.037, 'text': "as it's called.", 'start': 16469.476, 'duration': 0.561}, {'end': 16473.519, 'text': 'And then in a dictionary, you have these key value pairs.', 'start': 16470.978, 'duration': 2.541}, {'end': 16476.06, 'text': 'So this is one key value pair where you have a key.', 'start': 16473.559, 'duration': 2.501}, {'end': 16481.761, 'text': 'The key in this case is a string Akash, and here you have a colon.', 'start': 16477.751, 'duration': 4.01}, {'end': 16484.83, 'text': 'And then here you have a value.', 'start': 16483.607, 'duration': 1.223}, {'end': 16486.374, 'text': 'The value in this case is a phone number.', 'start': 16484.89, 'duration': 1.484}, {'end': 16493.572, 'text': "So that's how you create a key value pair and comma separated key value pairs is what you need to create a dictionary.", 'start': 16487.508, 'duration': 6.064}, {'end': 16498.274, 'text': 'You can see once the dictionary is created, it is displayed in the exact same way.', 'start': 16494.452, 'duration': 3.822}, {'end': 16502.256, 'text': "And then you can access a person's phone number using their name.", 'start': 16499.175, 'duration': 3.081}, {'end': 16511.14, 'text': 'So if we have the variable phone numbers and we use the indexing notation, so this is the square bracket and we pass in a key here,', 'start': 16502.596, 'duration': 8.544}, {'end': 16511.961, 'text': 'we get back their name.', 'start': 16511.14, 'duration': 0.821}, {'end': 16515.463, 'text': 'and you may wonder what happens if the key is not present.', 'start': 16512.981, 'duration': 2.482}, {'end': 16523.349, 'text': 'the great thing about jupiter is you can insert a new cell, like you can just click insert cell below, or you can use the keyboard shortcut b,', 'start': 16515.463, 'duration': 7.886}, {'end': 16525.552, 'text': 'as i just did, and check.', 'start': 16523.349, 'duration': 2.203}, {'end': 16528.154, 'text': "maybe let's check the key vishal.", 'start': 16525.552, 'duration': 2.602}, {'end': 16534.661, 'text': 'okay, then you get back a key error and you may also wonder what happens if.', 'start': 16528.154, 'duration': 6.507}, {'end': 16536.122, 'text': 'is it case sensitive?', 'start': 16534.661, 'duration': 1.461}, {'end': 16536.842, 'text': 'does that matter?', 'start': 16536.122, 'duration': 0.72}, {'end': 16538.324, 'text': 'you can check it very easily.', 'start': 16536.842, 'duration': 1.482}, {'end': 16545.736, 'text': 'So a lot of the questions that you might get, a lot of the questions that you may want to even ask on the forum or look up online,', 'start': 16539.571, 'duration': 6.165}, {'end': 16549.038, 'text': 'can be resolved simply by creating a new cell and typing out some code.', 'start': 16545.736, 'duration': 3.302}, {'end': 16554.562, 'text': 'Like what happens if questions can all be answered by writing some code.', 'start': 16549.339, 'duration': 5.223}, {'end': 16557.655, 'text': "So now let's add some new phone numbers.", 'start': 16555.615, 'duration': 2.04}, {'end': 16560.496, 'text': 'So this is how you create an initial set of phone numbers.', 'start': 16557.756, 'duration': 2.74}, {'end': 16563.897, 'text': 'This is how you access a phone number, and this is how you add new values.', 'start': 16560.676, 'duration': 3.221}, {'end': 16570.899, 'text': 'So adding new values is like accessing them, but instead of accessing it, you put an equal to, and then you actually set the value here.', 'start': 16564.136, 'duration': 6.763}, {'end': 16581.761, 'text': 'So we can add a new value here the phone number for Vishal and we can also update an existing value in a dictionary simply by accessing that value and putting an equal to.', 'start': 16571.639, 'duration': 10.122}, {'end': 16583.801, 'text': 'and putting in a new value.', 'start': 16582.739, 'duration': 1.062}, {'end': 16593.529, 'text': 'there you can see now that the dictionary is updated to contain the new phone number 7878 and not the original phone number 948948.', 'start': 16583.801, 'duration': 9.728}, {'end': 16599.015, 'text': 'You can also view all the names and phone numbers stored in the phone number dictionary using a loop.', 'start': 16593.529, 'duration': 5.486}, {'end': 16601.478, 'text': 'So you can say for, for name in phone numbers.', 'start': 16599.055, 'duration': 2.423}, {'end': 16605.962, 'text': 'So when you put a dictionary into a for loop, you get back a key within each loop.', 'start': 16602.038, 'duration': 3.924}, {'end': 16613.429, 'text': 'You can see here that the name and the phone number is displayed for you using the print statement.', 'start': 16606.702, 'duration': 6.727}, {'end': 16621.938, 'text': 'So those are some things that you can do within a dictionary, and dictionaries in Python are implemented using a data structure called a hash table,', 'start': 16614.755, 'duration': 7.183}, {'end': 16634.086, 'text': 'and a hash table uses a list or an array to store key value pairs and uses a hashing function to determine the index for storing or retrieving the data associated with a given key.', 'start': 16621.938, 'duration': 12.148}, {'end': 16637.023, 'text': "So here's what it looks like here.", 'start': 16635.782, 'duration': 1.241}, {'end': 16648.095, 'text': 'You have the key John Smith and you have a function called hash and the function hash takes any key and it returns an index within the list.', 'start': 16637.563, 'duration': 10.532}, {'end': 16650.296, 'text': 'So why do we use a hashing function??', 'start': 16648.896, 'duration': 1.4}, {'end': 16653.38, 'text': "Well, one approach, as we've discussed in lesson two,", 'start': 16650.817, 'duration': 2.563}, {'end': 16662.044, 'text': 'is we can store or key value pairs in a list and we can simply search through the list each time we want to look up the value for a key,', 'start': 16654.481, 'duration': 7.563}, {'end': 16669.008, 'text': 'but that is inefficient because that requires looking through potentially all the keys before we get to the key that we want,', 'start': 16662.044, 'duration': 6.964}], 'summary': 'Assignment two covers hash tables and python dictionaries, implementing hash tables from scratch in python, handling hashing collisions, and replicating python dictionary functionality.', 'duration': 453.962, 'max_score': 16215.046, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA16215046.jpg'}, {'end': 16291.118, 'src': 'embed', 'start': 16264.385, 'weight': 2, 'content': [{'end': 16268.786, 'text': 'So you may also want to watch lesson two and complete the notebook before you work on assignment two.', 'start': 16264.385, 'duration': 4.401}, {'end': 16270.107, 'text': "Let's open it up.", 'start': 16269.487, 'duration': 0.62}, {'end': 16279.131, 'text': 'Now in this assignment, you will apply some of the concepts learned in the first two lessons to implement a hash table from scratch in Python.', 'start': 16271.187, 'duration': 7.944}, {'end': 16280.412, 'text': "That's very interesting.", 'start': 16279.652, 'duration': 0.76}, {'end': 16283.954, 'text': 'You will, and hash tables are a very important data structure.', 'start': 16280.992, 'duration': 2.962}, {'end': 16291.118, 'text': 'They present in pretty much every programming language and are a common topic discussed and asked in coding interviews.', 'start': 16284.014, 'duration': 7.104}], 'summary': 'Complete lesson two before working on assignment two. implement a hash table from scratch in python, a crucial data structure encountered in coding interviews.', 'duration': 26.733, 'max_score': 16264.385, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA16264385.jpg'}, {'end': 16711.006, 'src': 'embed', 'start': 16689.036, 'weight': 1, 'content': [{'end': 16697.283, 'text': 'so in that sense it gives you the index of the specific key value pair in constant time rather than ordering,', 'start': 16689.036, 'duration': 8.247}, {'end': 16700.285, 'text': 'and that is what makes hash table so efficient, right.', 'start': 16697.283, 'duration': 3.002}, {'end': 16704.293, 'text': 'so hash function does not require looping through the list.', 'start': 16700.285, 'duration': 4.008}, {'end': 16711.006, 'text': 'It simply takes a key, gives you the index, and you can simply then get the key value pair or the value from that index.', 'start': 16704.473, 'duration': 6.533}], 'summary': 'Hash table provides constant time access to key-value pairs, improving efficiency.', 'duration': 21.97, 'max_score': 16689.036, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA16689036.jpg'}, {'end': 17037.124, 'src': 'embed', 'start': 16971.922, 'weight': 6, 'content': [{'end': 16975.024, 'text': 'Okay So next up we have a list.', 'start': 16971.922, 'duration': 3.102}, {'end': 16979.166, 'text': 'Now we need a way to store or insert key value pairs into a list.', 'start': 16975.404, 'duration': 3.762}, {'end': 16982.43, 'text': "That's where the hashing function comes into picture.", 'start': 16980.529, 'duration': 1.901}, {'end': 16990.214, 'text': 'The hashing function is used to convert strings and other non-numeric data types into numbers, which can then be used as list indices.', 'start': 16982.59, 'duration': 7.624}, {'end': 17000.719, 'text': 'For example, if a hashing function converts the string Akash into the number four, then the key value pair Akash and the phone number 7, 8, 7, 8, 7,', 'start': 16990.855, 'duration': 9.864}, {'end': 17002.439, 'text': '8, 7, 8, 7, 8..', 'start': 17000.719, 'duration': 1.72}, {'end': 17010.627, 'text': "will be stored at the position 4 within the data list, and here's a simple algorithm for hashing which can convert strings into numeric list indices,", 'start': 17002.441, 'duration': 8.186}, {'end': 17015.05, 'text': 'and a hashing algorithm does not have a single definition.', 'start': 17010.627, 'duration': 4.423}, {'end': 17023.519, 'text': 'you can come up with a hashing algorithm and, in fact, coming up with a good hashing algorithm is an area of research in itself.', 'start': 17015.05, 'duration': 8.469}, {'end': 17030.983, 'text': "now, of course, python dictionaries use hashing that is inbuilt into python, and that's a fairly optimized hashing algorithm.", 'start': 17023.519, 'duration': 7.464}, {'end': 17037.124, 'text': "that's probably the result of several years of research, But here's one very simple technique.", 'start': 17030.983, 'duration': 6.141}], 'summary': 'Hashing function converts strings into list indices for efficient storage. python dictionaries use inbuilt optimized hashing algorithm.', 'duration': 65.202, 'max_score': 16971.922, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA16971922.jpg'}, {'end': 17378.607, 'src': 'embed', 'start': 17354.777, 'weight': 9, 'content': [{'end': 17366.466, 'text': 'a function which only uses its arguments and does not depend on any external global variables or constraints and things like that is called a pure function.', 'start': 17354.777, 'duration': 11.689}, {'end': 17371.336, 'text': 'of course, a pure function also does not modify any external global variables.', 'start': 17367.611, 'duration': 3.725}, {'end': 17378.607, 'text': 'So it simply takes some arguments and returns the result irrespective of anything else outside.', 'start': 17371.396, 'duration': 7.211}], 'summary': 'A pure function uses only its arguments, does not depend on external global variables, and does not modify any external global variables.', 'duration': 23.83, 'max_score': 17354.777, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA17354777.jpg'}], 'start': 15722.492, 'title': 'Data structures and algorithms', 'summary': 'Discusses the importance of encapsulation, self-balancing binary trees, binary search trees, avl trees, hash tables, python dictionaries, and hashing functions. it covers operations, balancing, applications, efficiency, and implementation in python with examples and test cases.', 'chapters': [{'end': 15900.883, 'start': 15722.492, 'title': 'Encapsulation and self balancing binary trees', 'summary': 'Discusses the importance of encapsulation and good api in programming, as well as the concept and implementation of self-balancing binary trees, including examples of rotations and balance factor tracking.', 'duration': 178.391, 'highlights': ["Encapsulation and good API design are essential for creating intuitive and efficient software, where users don't need to understand the underlying details.", 'Self-balancing binary trees, such as red-black trees, AVL trees, and B-trees, require rotations to maintain balance, with multiple cases to handle during insertion and deletion.', 'Tracking balance factor and performing rotations are crucial in maintaining the balance of self-balancing binary trees, with the need for helper functions like left and right rotations.']}, {'end': 16328.683, 'start': 15901.966, 'title': 'Binary search trees & avl trees', 'summary': 'Introduces binary search trees, covering their operations, balancing, applications, and efficiency, highlighting how they form the basis of modern programming language features, and concludes with a discussion on implementing hash tables and python dictionaries in python.', 'duration': 426.717, 'highlights': ['Binary search trees form the basis of many modern programming languages and data storage systems like file system indexes or relational databases.', 'Efficiency of binary search trees allows for operations like insertion, finding, and updating to work in microseconds, even with a hundred million records.', 'The chapter concludes with a discussion on implementing hash tables and Python dictionaries in Python, addressing concepts like hashing collisions and replicating the functionality of Python dictionaries.']}, {'end': 16971.902, 'start': 16329.485, 'title': 'Implementing hash tables in python', 'summary': 'Introduces how to complete an assignment using jupyter notebook, focusing on recreating python dictionaries using hash tables, implementing a hash table class with insert, find, update, and list operations and using python test cases to validate the implementation.', 'duration': 642.417, 'highlights': ['The chapter introduces how to complete an assignment using Jupyter notebook, focusing on recreating Python dictionaries using hash tables, implementing a hash table class with insert, find, update, and list operations and using Python test cases to validate the implementation.', 'The Jupyter notebook guides students to replace question marks with appropriate values, expressions, or statements to ensure the notebook runs properly, emphasizing the importance of running all code cells and not changing variable names.', 'The recommended way to run the code is through free online resources like Binder, ensuring regular saving of work using jovian.commit, and acknowledging the presence of optional questions for learning.', 'The chapter explains the process of creating and accessing dictionaries in Python, including adding new values and updating existing ones, with the demonstration of loop usage and the implementation of dictionaries using a hash table data structure.', 'The chapter details the use of hashing functions to efficiently store and retrieve key-value pairs in a hash table, highlighting the constant time complexity of the hash function compared to the inefficient linear search through a list.', 'The objective of the assignment is to implement a hash table class supporting insert, find, update, and list operations using Python classes, with an emphasis on the self argument and the role of methods within the class.', 'The implementation of a hash table class is demonstrated step by step, starting with creating a Python list to hold key-value pairs and emphasizing the use of test cases to validate the implementation.', 'The chapter encourages the use of assert statements to create custom test cases for validating the functionality of the hash table implementation and emphasizes the importance of adding more test cases for comprehensive validation.']}, {'end': 17378.607, 'start': 16971.922, 'title': 'Hashing functions for storing key-value pairs', 'summary': 'Covers the concept of hashing functions for converting non-numeric data types into numbers to store key-value pairs in a list, with a simple hashing algorithm provided for converting strings into numeric list indices and the importance of ensuring functions are generic and not dependent on global variables for flexibility and scalability.', 'duration': 406.685, 'highlights': ['The hashing function converts non-numeric data types into numbers to be used as list indices.', 'Python dictionaries use an optimized hashing algorithm built into Python.', 'A simple hashing algorithm is provided for converting strings into numeric list indices.', 'The importance of ensuring functions are generic and not dependent on global variables is emphasized.', 'Testing the hashing function with custom test cases is demonstrated.']}], 'duration': 1656.115, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA15722492.jpg', 'highlights': ['Efficiency of binary search trees allows for operations like insertion, finding, and updating to work in microseconds, even with a hundred million records.', 'The chapter details the use of hashing functions to efficiently store and retrieve key-value pairs in a hash table, highlighting the constant time complexity of the hash function compared to the inefficient linear search through a list.', 'The chapter introduces how to complete an assignment using Jupyter notebook, focusing on recreating Python dictionaries using hash tables, implementing a hash table class with insert, find, update, and list operations and using Python test cases to validate the implementation.', "Encapsulation and good API design are essential for creating intuitive and efficient software, where users don't need to understand the underlying details.", 'Binary search trees form the basis of many modern programming languages and data storage systems like file system indexes or relational databases.', 'Self-balancing binary trees, such as red-black trees, AVL trees, and B-trees, require rotations to maintain balance, with multiple cases to handle during insertion and deletion.', 'The hashing function converts non-numeric data types into numbers to be used as list indices.', 'Python dictionaries use an optimized hashing algorithm built into Python.', 'A simple hashing algorithm is provided for converting strings into numeric list indices.', 'The importance of ensuring functions are generic and not dependent on global variables is emphasized.']}, {'end': 18968.86, 'segs': [{'end': 17406.365, 'src': 'embed', 'start': 17380.089, 'weight': 1, 'content': [{'end': 17385.418, 'text': 'So now we can To insert a key value pair into hash table, we can simply get a hash of the key.', 'start': 17380.089, 'duration': 5.329}, {'end': 17391.484, 'text': 'So here we have a key value pair, and we simply get a hash of the key by calling get index for data list and key.', 'start': 17385.778, 'duration': 5.706}, {'end': 17393.887, 'text': 'And we get back the index 585.', 'start': 17391.805, 'duration': 2.082}, {'end': 17400.895, 'text': 'And then inside the data list at the given index, we can simply set the key value pair as the element stored at that index.', 'start': 17393.887, 'duration': 7.008}, {'end': 17406.365, 'text': 'And the same operation can be expressed in a single line of code.', 'start': 17402.782, 'duration': 3.583}], 'summary': 'To insert a key value pair into a hash table, we get a hash of the key and store the pair at the corresponding index, resulting in index 585.', 'duration': 26.276, 'max_score': 17380.089, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA17380089.jpg'}, {'end': 17458.865, 'src': 'embed', 'start': 17430.023, 'weight': 2, 'content': [{'end': 17435.691, 'text': 'we can simply get a hash of the element, the value associated with the key.', 'start': 17430.023, 'duration': 5.668}, {'end': 17439.835, 'text': 'we can simply get a hash of the key and look up that index within the data list.', 'start': 17435.691, 'duration': 4.144}, {'end': 17445.521, 'text': 'so here we have the key akash and we have the data list and we call get index.', 'start': 17439.835, 'duration': 5.686}, {'end': 17458.865, 'text': 'so we get the index of the key akash and that gives us the index here and we can then call data list and pass in the position idx and that should give us a key value pair.', 'start': 17445.521, 'duration': 13.344}], 'summary': 'Retrieve key-value pair by hashing key and looking up index.', 'duration': 28.842, 'max_score': 17430.023, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA17430023.jpg'}, {'end': 17498.823, 'src': 'embed', 'start': 17471.229, 'weight': 4, 'content': [{'end': 17477.432, 'text': 'so you get a hash for the key and then you retrieve the key value pair and from there you can get the value.', 'start': 17471.229, 'duration': 6.203}, {'end': 17479.695, 'text': 'We can also list the keys.', 'start': 17478.615, 'duration': 1.08}, {'end': 17483.537, 'text': 'To list the keys, here is some special code we are using.', 'start': 17480.156, 'duration': 3.381}, {'end': 17488.579, 'text': "So let's see, this is called list comprehension and let's take a quick look at list comprehension.", 'start': 17484.297, 'duration': 4.282}, {'end': 17491.02, 'text': 'So list comprehension works like this.', 'start': 17489.699, 'duration': 1.321}, {'end': 17498.823, 'text': "If you create a list Y from a list X, let's say, let's call this list one and list two.", 'start': 17491.88, 'duration': 6.943}], 'summary': 'Using hash to retrieve key-value pairs and list comprehension for creating new lists.', 'duration': 27.594, 'max_score': 17471.229, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA17471229.jpg'}, {'end': 17603.622, 'src': 'embed', 'start': 17576.803, 'weight': 3, 'content': [{'end': 17584.246, 'text': "And once you put that in a bracket and you have this for here, that's going to apply that same operation to the entire list.", 'start': 17576.803, 'duration': 7.443}, {'end': 17586.627, 'text': 'And this is called list comprehension in Python.', 'start': 17584.846, 'duration': 1.781}, {'end': 17591.609, 'text': "It's a very powerful way to express complex operations on lists and dictionaries.", 'start': 17586.647, 'duration': 4.962}, {'end': 17597.119, 'text': "and there's one final thing in list operations, which is the if condition.", 'start': 17592.998, 'duration': 4.121}, {'end': 17603.622, 'text': 'so for x in list one can be followed by an if condition and the if condition can once again apply on x.', 'start': 17597.119, 'duration': 6.503}], 'summary': 'List comprehension in python allows powerful operations on lists and dictionaries.', 'duration': 26.819, 'max_score': 17576.803, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA17576803.jpg'}, {'end': 17735.467, 'src': 'embed', 'start': 17706.877, 'weight': 6, 'content': [{'end': 17712.082, 'text': 'Now the constructor takes the object self or this,', 'start': 17706.877, 'duration': 5.205}, {'end': 17716.827, 'text': 'and the self is going to point to the actual object or the actual hash table that gets created using the class.', 'start': 17712.082, 'duration': 4.745}, {'end': 17719.12, 'text': 'And then it takes a maximum size.', 'start': 17717.799, 'duration': 1.321}, {'end': 17723.462, 'text': 'What are we doing here? We want to make our hash table configurable.', 'start': 17720.04, 'duration': 3.422}, {'end': 17729.524, 'text': "We don't always want to have four zero nine six elements in our internal list.", 'start': 17723.802, 'duration': 5.722}, {'end': 17735.467, 'text': 'If we may need a hash table that can store more values, or we may need a hash table that can only store fewer values.', 'start': 17730.105, 'duration': 5.362}], 'summary': 'Constructor takes self/this, points to hash table, and takes maximum size for configurable hash table.', 'duration': 28.59, 'max_score': 17706.877, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA17706877.jpg'}, {'end': 17776.458, 'src': 'embed', 'start': 17750.834, 'weight': 7, 'content': [{'end': 17755.275, 'text': 'now you need to create a list of size max size, with all the values set to none.', 'start': 17750.834, 'duration': 4.441}, {'end': 17759.197, 'text': 'now you may be tempted to do this, but that would be wrong.', 'start': 17755.275, 'duration': 3.922}, {'end': 17762.278, 'text': 'remember that always use the arguments to a function.', 'start': 17759.197, 'duration': 3.081}, {'end': 17766.714, 'text': 'Try not to depend on an external value or external constant.', 'start': 17763.393, 'duration': 3.321}, {'end': 17768.055, 'text': 'So this would be wrong.', 'start': 17767.255, 'duration': 0.8}, {'end': 17774.638, 'text': "You may also be tempted to do this data list, self dot data list equals data list that we've already created.", 'start': 17768.635, 'duration': 6.003}, {'end': 17776.458, 'text': 'This would also be wrong.', 'start': 17775.238, 'duration': 1.22}], 'summary': 'Create a list of max size with values set to none, avoid using external values or constants.', 'duration': 25.624, 'max_score': 17750.834, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA17750834.jpg'}, {'end': 17887.864, 'src': 'embed', 'start': 17839.166, 'weight': 5, 'content': [{'end': 17845.307, 'text': 'Because now we want to use the data list that is stored inside this specific object of the class.', 'start': 17839.166, 'duration': 6.141}, {'end': 17847.248, 'text': 'We do not want to use the global data list.', 'start': 17845.407, 'duration': 1.841}, {'end': 17852.152, 'text': 'and this is something that is an mistake that we often make initially.', 'start': 17847.708, 'duration': 4.444}, {'end': 17858.498, 'text': "i've still make this mistake where i have certain global variables defined and i'm using those global variables inside my class.", 'start': 17852.152, 'duration': 6.346}, {'end': 17860.44, 'text': 'avoid doing that.', 'start': 17858.498, 'duration': 1.942}, {'end': 17866.886, 'text': "anything that you want to put inside a class object you need to put inside self, like we've done here, and then, to access it,", 'start': 17860.44, 'duration': 6.446}, {'end': 17875.155, 'text': 'you need to use self dot to access that specific property or element or even method.', 'start': 17866.886, 'duration': 8.269}, {'end': 17881.58, 'text': 'So now we have self dot data list and we pass in the key and the data list into get index.', 'start': 17876.296, 'duration': 5.284}, {'end': 17884.522, 'text': 'And that gives us the index.', 'start': 17883.461, 'duration': 1.061}, {'end': 17887.864, 'text': 'Now the get index function was defined earlier.', 'start': 17885.983, 'duration': 1.881}], 'summary': 'Avoid using global variables inside a class; use self to access class properties and methods.', 'duration': 48.698, 'max_score': 17839.166, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA17839166.jpg'}, {'end': 17938.905, 'src': 'embed', 'start': 17908.54, 'weight': 9, 'content': [{'end': 17915.689, 'text': 'Now, how do we find the value associated with a given P key? First we get the index for the key.', 'start': 17908.54, 'duration': 7.149}, {'end': 17919.735, 'text': 'So we call get index on self dot data list and key.', 'start': 17915.709, 'duration': 4.026}, {'end': 17923.617, 'text': 'then we retrieve the data stored at the index.', 'start': 17921.076, 'duration': 2.541}, {'end': 17931.761, 'text': 'so this would be simply self dot data list of idx.', 'start': 17923.617, 'duration': 8.144}, {'end': 17937.564, 'text': "and then if the key value pair is not none, if the key value pair is none, well, there's nothing at that index.", 'start': 17931.761, 'duration': 5.803}, {'end': 17938.905, 'text': 'we can return none.', 'start': 17937.564, 'duration': 1.341}], 'summary': 'To find the value for a given key, we get the index and retrieve the data stored at that index. if the key value pair is none, we return none.', 'duration': 30.365, 'max_score': 17908.54, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA17908540.jpg'}, {'end': 18313.021, 'src': 'embed', 'start': 18286.673, 'weight': 10, 'content': [{'end': 18291.338, 'text': 'So our hash table implementation is incomplete because there can be data loss and it does not handle collisions.', 'start': 18286.673, 'duration': 4.665}, {'end': 18293.98, 'text': 'And there are multiple techniques to handle collisions.', 'start': 18291.878, 'duration': 2.102}, {'end': 18298.965, 'text': 'And we, the technique we will use in this assignment is called linear probing.', 'start': 18294.141, 'duration': 4.824}, {'end': 18303.29, 'text': "And here's how it works while inserting a new key value pair.", 'start': 18299.526, 'duration': 3.764}, {'end': 18307.033, 'text': 'If the target index for key is occupied by another key.', 'start': 18303.79, 'duration': 3.243}, {'end': 18313.021, 'text': 'then we simply try the next index and if the next index is also occupied by another key, we try the next.', 'start': 18307.614, 'duration': 5.407}], 'summary': 'Incomplete hash table needs collision handling using linear probing.', 'duration': 26.348, 'max_score': 18286.673, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA18286673.jpg'}, {'end': 18709.16, 'src': 'embed', 'start': 18682.92, 'weight': 0, 'content': [{'end': 18687.143, 'text': 'Now here, the optional question is for you to implement a Python friendly interface for the hash table.', 'start': 18682.92, 'duration': 4.223}, {'end': 18693.808, 'text': 'So instead of defining functions, insert, update, and find, you will define the functions, get item, set item.', 'start': 18687.543, 'duration': 6.265}, {'end': 18697.031, 'text': 'And instead of list all, you will define the function iter.', 'start': 18694.789, 'duration': 2.242}, {'end': 18706.578, 'text': 'And also, instead of using the hash function, instead of using the custom hash function that we have defined, you will define,', 'start': 18698.932, 'duration': 7.646}, {'end': 18709.16, 'text': "you will use a function that's inbuilt into Python, called hash.", 'start': 18706.578, 'duration': 2.582}], 'summary': "Implement python-friendly interface for hash table with get, set, and iter functions using python's inbuilt hash function.", 'duration': 26.24, 'max_score': 18682.92, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA18682920.jpg'}, {'end': 18810.607, 'src': 'embed', 'start': 18782.335, 'weight': 11, 'content': [{'end': 18788.722, 'text': "If you can complete these four exercises, there's pretty much no question related to hash tables that you cannot answer.", 'start': 18782.335, 'duration': 6.387}, {'end': 18796.29, 'text': 'You will know everything about them, and each of these exercises may take another 30 minutes to 45 minutes,', 'start': 18788.762, 'duration': 7.528}, {'end': 18799.493, 'text': "but it's completely worth the time maybe spend aside.", 'start': 18796.29, 'duration': 3.203}, {'end': 18804.259, 'text': 'set aside a few hours on the weekend to work on these optional exercises.', 'start': 18799.493, 'duration': 4.766}, {'end': 18810.607, 'text': "now here's one how to track the size of the hash table instead of having to loop through the entire table to get the number of key value pairs.", 'start': 18804.259, 'duration': 6.348}], 'summary': 'Completing four exercises will make you a hash table expert.', 'duration': 28.272, 'max_score': 18782.335, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA18782335.jpg'}, {'end': 18870.47, 'src': 'embed', 'start': 18845.356, 'weight': 12, 'content': [{'end': 18852.379, 'text': 'or maybe even before, to avoid collisions, you may want to double it as soon as you reach 64 elements, like 50% of the capacity.', 'start': 18845.356, 'duration': 7.023}, {'end': 18859.203, 'text': 'So dynamic resizing is the technique that allows you to automatically grow and shrink the data list internally.', 'start': 18853.819, 'duration': 5.384}, {'end': 18863.425, 'text': "And then the here's another technique for collision resolution.", 'start': 18859.563, 'duration': 3.862}, {'end': 18864.766, 'text': 'This is called separate chaining.', 'start': 18863.466, 'duration': 1.3}, {'end': 18870.47, 'text': 'So instead of going to the next index, what you do is you maintain a linked list at each position.', 'start': 18865.067, 'duration': 5.403}], 'summary': 'Dynamic resizing allows automatic growth and shrinkage of data list. separate chaining technique maintains linked lists at each position for collision resolution.', 'duration': 25.114, 'max_score': 18845.356, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA18845356.jpg'}], 'start': 17380.089, 'title': 'Hash table implementation techniques', 'summary': 'Covers hash table operations, list comprehension, encapsulation, and implementation in python, including handling collisions, with a focus on dynamic resizing, collision resolution, and complexity analysis. it emphasizes configuring hash table size, insertion, retrieval methods, linear probing, and achieving a basic hash table with a max size of 1024.', 'chapters': [{'end': 17617.627, 'start': 17380.089, 'title': 'Hash table operations and list comprehension', 'summary': 'Explains how to insert, retrieve, and list key-value pairs in a hash table and demonstrates the use of list comprehension in python for filtering and transforming lists.', 'duration': 237.538, 'highlights': ['The chapter demonstrates inserting a key-value pair into a hash table by obtaining the hash of the key, which resulted in an index of 585, showcasing the efficient storage mechanism.', 'The process of retrieving an element associated with a key is detailed, highlighting the efficient retrieval by obtaining the hash of the key and looking up the corresponding index within the data list.', 'The explanation of list comprehension in Python provides examples of filtering and transforming lists, showcasing its powerful capabilities for expressing complex operations on lists and dictionaries.']}, {'end': 17964.263, 'start': 17617.627, 'title': 'Hash table implementation', 'summary': 'Discusses list comprehension, key-value pairs, and hash table implementation in python, emphasizing the importance of encapsulation and correct usage of class properties, with a focus on configuring the hash table size and implementing insertion and retrieval methods.', 'duration': 346.636, 'highlights': ['The chapter discusses list comprehension and key-value pairs, with an emphasis on using list comprehension to filter out non-values and retrieve key-value pairs from data lists.', "Emphasizes the importance of encapsulation and correct usage of class properties, illustrating the need to avoid using global variables and to properly encapsulate class properties within 'self'.", 'Focuses on configuring the hash table size, emphasizing the need to make the hash table size configurable and not tying the class implementation to a global variable.', "Illustrates the correct way to initialize the data list in the hash table class, emphasizing the use of 'none' multiplied by the maximum size to create a new internal data list for each hash table object.", "Explains the process of inserting key-value pairs into the hash table, highlighting the correct usage of 'self' to access class properties and the need to use the internal data list specific to each object.", "Discusses the method for retrieving the value associated with a given key in the hash table, emphasizing the retrieval of data stored at the index and the importance of handling scenarios where the key-value pair is 'none'."]}, {'end': 18591.458, 'start': 17964.323, 'title': 'Implementing hash table and handling collisions', 'summary': 'Covers implementing a basic hash table, with a max size of 1024, and handling collisions using linear probing, testing various operations like insert, update, and find, and incorporating linear probing into the hash table.', 'duration': 627.135, 'highlights': ['Implementing a basic hash table of max size 1024', 'Handling collisions using linear probing', 'Testing various operations like insert, update, and find']}, {'end': 18968.86, 'start': 18591.658, 'title': 'Hash table implementation and techniques', 'summary': "Discusses a student's performance on hash table implementation, provides guidance for optional exercises, and introduces advanced techniques like dynamic resizing, collision resolution, and complexity analysis.", 'duration': 377.202, 'highlights': ["The chapter discusses a student's performance on hash table implementation.", 'Guidance for optional exercises is provided.', 'Introduction of advanced techniques like dynamic resizing, collision resolution, and complexity analysis.']}], 'duration': 1588.771, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA17380089.jpg', 'highlights': ['The chapter covers hash table operations, list comprehension, encapsulation, and implementation in Python, emphasizing dynamic resizing, collision resolution, and complexity analysis.', 'The chapter demonstrates inserting a key-value pair into a hash table by obtaining the hash of the key, resulting in an index of 585, showcasing the efficient storage mechanism.', 'The process of retrieving an element associated with a key is detailed, highlighting the efficient retrieval by obtaining the hash of the key and looking up the corresponding index within the data list.', 'The explanation of list comprehension in Python provides examples of filtering and transforming lists, showcasing its powerful capabilities for expressing complex operations on lists and dictionaries.', 'The chapter discusses list comprehension and key-value pairs, emphasizing using list comprehension to filter out non-values and retrieve key-value pairs from data lists.', "Emphasizes the importance of encapsulation and correct usage of class properties, illustrating the need to avoid using global variables and to properly encapsulate class properties within 'self'.", 'Focuses on configuring the hash table size, emphasizing the need to make the hash table size configurable and not tying the class implementation to a global variable.', "Illustrates the correct way to initialize the data list in the hash table class, emphasizing the use of 'none' multiplied by the maximum size to create a new internal data list for each hash table object.", "Explains the process of inserting key-value pairs into the hash table, highlighting the correct usage of 'self' to access class properties and the need to use the internal data list specific to each object.", "Discusses the method for retrieving the value associated with a given key in the hash table, emphasizing the retrieval of data stored at the index and the importance of handling scenarios where the key-value pair is 'none'.", 'Implementing a basic hash table of max size 1024, handling collisions using linear probing, and testing various operations like insert, update, and find.', "The chapter discusses a student's performance on hash table implementation and provides guidance for optional exercises.", 'Introduction of advanced techniques like dynamic resizing, collision resolution, and complexity analysis.']}, {'end': 21003.785, 'segs': [{'end': 19051.11, 'src': 'embed', 'start': 19019.167, 'weight': 0, 'content': [{'end': 19021.888, 'text': "I'm the CEO of Jovian and I'm your instructor for the course.", 'start': 19019.167, 'duration': 2.721}, {'end': 19029.69, 'text': 'If you follow along with this course and complete four weekly assignments and a course project,', 'start': 19024.085, 'duration': 5.605}, {'end': 19032.552, 'text': 'you can earn a certificate of accomplishment for this course.', 'start': 19029.69, 'duration': 2.862}, {'end': 19037.316, 'text': "So let's get started.", 'start': 19036.335, 'duration': 0.981}, {'end': 19044.422, 'text': 'The first thing we do is visit the course website, pythondsa.com.', 'start': 19038.497, 'duration': 5.925}, {'end': 19051.11, 'text': 'So when you visit pythondsa.com, this will bring you to the course website here.', 'start': 19046.226, 'duration': 4.884}], 'summary': 'Complete four weekly assignments and a course project to earn a certificate from the python dsa course on pythondsa.com', 'duration': 31.943, 'max_score': 19019.167, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA19019167.jpg'}, {'end': 19136.339, 'src': 'embed', 'start': 19110.067, 'weight': 12, 'content': [{'end': 19116.35, 'text': 'You can either execute this code online using free online resources, which is what we recommend,', 'start': 19110.067, 'duration': 6.283}, {'end': 19119.091, 'text': 'or you can download it and run it on your computer locally.', 'start': 19116.35, 'duration': 2.741}, {'end': 19123.713, 'text': 'And the instructions for both of these are given here.', 'start': 19121.612, 'duration': 2.101}, {'end': 19130.997, 'text': 'We are going to use the first one, which is to click the run button at the top of this page and select run on binder.', 'start': 19124.594, 'duration': 6.403}, {'end': 19136.339, 'text': 'So let us scroll up here and let us click the run button and then click run on binder.', 'start': 19131.957, 'duration': 4.382}], 'summary': 'Execute code online or locally, recommended to run on binder.', 'duration': 26.272, 'max_score': 19110.067, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA19110067.jpg'}, {'end': 19244.051, 'src': 'embed', 'start': 19208.447, 'weight': 1, 'content': [{'end': 19210.829, 'text': "And we're talking about different data structures and algorithms.", 'start': 19208.447, 'duration': 2.382}, {'end': 19215.152, 'text': 'The topic today is sorting algorithms and divide and conquer algorithms in Python.', 'start': 19210.869, 'duration': 4.283}, {'end': 19219.435, 'text': 'So in every lecture, we focus on a specific problem.', 'start': 19216.032, 'duration': 3.403}, {'end': 19224.678, 'text': "So in this notebook, in this tutorial, we will focus on this problem, which you're looking at here.", 'start': 19220.135, 'duration': 4.543}, {'end': 19226.58, 'text': "So let's read the question.", 'start': 19225.639, 'duration': 0.941}, {'end': 19230.883, 'text': "You're working on a new feature on Jovian called top notebooks of the week.", 'start': 19227.46, 'duration': 3.423}, {'end': 19234.806, 'text': 'Write a function to sort a list of notebooks and decreasing order of likes.', 'start': 19231.563, 'duration': 3.243}, {'end': 19238.988, 'text': 'Keep in mind that up to millions of notebooks can be created every week.', 'start': 19235.646, 'duration': 3.342}, {'end': 19242.09, 'text': 'So your function needs to be as efficient as possible.', 'start': 19239.228, 'duration': 2.862}, {'end': 19244.051, 'text': 'That is the key point here.', 'start': 19242.99, 'duration': 1.061}], 'summary': 'Focus on sorting & divide/conquer algorithms in python, aiming for efficient sorting of millions of notebooks by likes.', 'duration': 35.604, 'max_score': 19208.447, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA19208447.jpg'}, {'end': 19318.053, 'src': 'embed', 'start': 19290.472, 'weight': 3, 'content': [{'end': 19294.595, 'text': 'and we will continue to follow a systematic strategy for solving programming problems.', 'start': 19290.472, 'duration': 4.123}, {'end': 19300.039, 'text': 'Step one, state the problem clearly, identify the input and output formats.', 'start': 19295.195, 'duration': 4.844}, {'end': 19305.582, 'text': 'Step two, come up with some example inputs and outputs and try to cover all the edge cases.', 'start': 19300.739, 'duration': 4.843}, {'end': 19309.986, 'text': 'And step three, come up with a correct solution for the problem stated in plain English.', 'start': 19306.083, 'duration': 3.903}, {'end': 19314.79, 'text': 'Step four, implement the solution and test it using example inputs.', 'start': 19310.766, 'duration': 4.024}, {'end': 19318.053, 'text': 'So this is very important that you implement the simple solution.', 'start': 19315.09, 'duration': 2.963}], 'summary': 'Systematic problem-solving strategy: state, test, implement solutions.', 'duration': 27.581, 'max_score': 19290.472, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA19290472.jpg'}, {'end': 19380.572, 'src': 'embed', 'start': 19350.452, 'weight': 13, 'content': [{'end': 19352.494, 'text': 'Now the problem is stated clearly enough for us.', 'start': 19350.452, 'duration': 2.042}, {'end': 19357.278, 'text': 'We need to write a function to sort a list of numbers in ascending or increasing order.', 'start': 19352.954, 'duration': 4.324}, {'end': 19359.019, 'text': "Now here's the input.", 'start': 19357.918, 'duration': 1.101}, {'end': 19364.143, 'text': 'The input is a single argument called nums and that is a list of numbers.', 'start': 19359.559, 'duration': 4.584}, {'end': 19366.685, 'text': "So for instance, here's a list of numbers.", 'start': 19364.483, 'duration': 2.202}, {'end': 19369.046, 'text': "You can see that they're not in any specific order.", 'start': 19366.745, 'duration': 2.301}, {'end': 19372.968, 'text': 'And then the output is the sorted version of the input.', 'start': 19369.927, 'duration': 3.041}, {'end': 19375.97, 'text': 'So here is the same list of numbers in sorted order.', 'start': 19373.369, 'duration': 2.601}, {'end': 19380.572, 'text': 'And based on these two, we can now write a signature of our function.', 'start': 19377.01, 'duration': 3.562}], 'summary': 'Write a function to sort a list of numbers in ascending order.', 'duration': 30.12, 'max_score': 19350.452, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA19350452.jpg'}, {'end': 19685.251, 'src': 'embed', 'start': 19659.098, 'weight': 11, 'content': [{'end': 19663.48, 'text': 'Otherwise you may spend a lot of time just creating a list and then writing the sorted version of it.', 'start': 19659.098, 'duration': 4.382}, {'end': 19664.24, 'text': "That's too much work.", 'start': 19663.52, 'duration': 0.72}, {'end': 19669.883, 'text': 'So always use a computer, always use helper functions whenever you can, even to create test cases.', 'start': 19665.04, 'duration': 4.843}, {'end': 19672.284, 'text': "So we'll use the range function.", 'start': 19670.763, 'duration': 1.521}, {'end': 19676.086, 'text': 'Now the range function takes either a single number or two numbers.', 'start': 19672.424, 'duration': 3.662}, {'end': 19681.108, 'text': 'So you can have something like this range two to 10, or just range 10.', 'start': 19676.106, 'duration': 5.002}, {'end': 19685.251, 'text': 'And if you just look at it this way, it just prints range zero to 10.', 'start': 19681.108, 'duration': 4.143}], 'summary': 'Use computer and helper functions to save time in creating and sorting lists.', 'duration': 26.153, 'max_score': 19659.098, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA19659098.jpg'}, {'end': 19822.5, 'src': 'embed', 'start': 19794.545, 'weight': 4, 'content': [{'end': 19800.787, 'text': 'On the other hand, if you check the outlist, you can see that these are all in order.', 'start': 19794.545, 'duration': 6.242}, {'end': 19808.35, 'text': "So those are our test cases, and it's very important to create good test cases, even in interviews,", 'start': 19803.206, 'duration': 5.144}, {'end': 19811.812, 'text': 'before you start coding or before you even suggest a solution.', 'start': 19808.35, 'duration': 3.462}, {'end': 19816.696, 'text': 'You should try and list out your test cases either verbally to an interviewer.', 'start': 19812.413, 'duration': 4.283}, {'end': 19822.5, 'text': 'In a coding assessment, you may create a block of comments at the top and start listing some test cases at the top,', 'start': 19817.116, 'duration': 5.384}], 'summary': 'Creating good test cases is crucial before coding, even in interviews.', 'duration': 27.955, 'max_score': 19794.545, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA19794545.jpg'}, {'end': 20557.337, 'src': 'embed', 'start': 20528.665, 'weight': 6, 'content': [{'end': 20533.627, 'text': "And that's really the power of programming that without having to look at any of the numbers.", 'start': 20528.665, 'duration': 4.962}, {'end': 20537.689, 'text': "we've just written four or five lines of code and we've sorted 10, 000 elements.", 'start': 20533.627, 'duration': 4.062}, {'end': 20540.191, 'text': 'So all our test cases passed.', 'start': 20538.91, 'duration': 1.281}, {'end': 20548.827, 'text': 'Although do look here that it took about 15 seconds for the sorting of 10, 000 elements.', 'start': 20541.178, 'duration': 7.649}, {'end': 20557.337, 'text': "Now, maybe that's not, maybe that's not that bad, but we are looking at probably millions of notebooks every week at Jovian.", 'start': 20550.208, 'duration': 7.129}], 'summary': 'Using programming, 10,000 elements were sorted in 15 seconds, passing all test cases.', 'duration': 28.672, 'max_score': 20528.665, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA20528665.jpg'}, {'end': 20681.716, 'src': 'embed', 'start': 20649.713, 'weight': 7, 'content': [{'end': 20652.334, 'text': 'We can ignore the lower order terms like two N plus one.', 'start': 20649.713, 'duration': 2.621}, {'end': 20663.576, 'text': 'So we can now conclude that the time complexity of bubble sort is order of N square.', 'start': 20654.369, 'duration': 9.207}, {'end': 20665.978, 'text': 'And this is also known as quadratic complexity.', 'start': 20663.936, 'duration': 2.042}, {'end': 20678.652, 'text': "So we can now verify that bubble sort requires order one additional space that this is an exercise for you, but here's a quick hint.", 'start': 20669.642, 'duration': 9.01}, {'end': 20681.716, 'text': 'You can see that we are not allocating any new lists.', 'start': 20679.213, 'duration': 2.503}], 'summary': 'Bubble sort time complexity is o(n^2), requires o(1) additional space.', 'duration': 32.003, 'max_score': 20649.713, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA20649713.jpg'}, {'end': 20887.889, 'src': 'embed', 'start': 20836.549, 'weight': 8, 'content': [{'end': 20839.291, 'text': 'And at that point, you can no longer use that particular algorithm.', 'start': 20836.549, 'duration': 2.742}, {'end': 20845.653, 'text': 'So we need to optimize bubble sort,', 'start': 20843.072, 'duration': 2.581}, {'end': 20851.896, 'text': 'and the inefficiency in bubble sort comes from the fact that we are shifting elements by at most one position at a time.', 'start': 20845.653, 'duration': 6.243}, {'end': 20861.881, 'text': 'So each time we go through the list, we capture some information about the list, but we are simply moving one element from left to right, so to speak.', 'start': 20852.537, 'duration': 9.344}, {'end': 20866.084, 'text': 'And each time we are just moving it one at a time by doing swaps.', 'start': 20863.202, 'duration': 2.882}, {'end': 20872.367, 'text': 'Rather, it would be nice to just place elements directly, maybe a few positions ahead.', 'start': 20866.944, 'duration': 5.423}, {'end': 20876.638, 'text': "And that's where we will look at some optimized algorithms.", 'start': 20873.755, 'duration': 2.883}, {'end': 20882.103, 'text': 'Now, another common algorithm that is used is called insertion sort.', 'start': 20877.979, 'duration': 4.124}, {'end': 20885.406, 'text': 'And this is here is the code for insertion sort.', 'start': 20882.964, 'duration': 2.442}, {'end': 20887.889, 'text': 'So you can look through the code for insertion sort here.', 'start': 20885.687, 'duration': 2.202}], 'summary': 'Optimizing bubble sort by minimizing element shifts and exploring insertion sort.', 'duration': 51.34, 'max_score': 20836.549, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA20836549.jpg'}, {'end': 20963.609, 'src': 'embed', 'start': 20936.451, 'weight': 10, 'content': [{'end': 20942.312, 'text': 'or the person who has written the code is not available or has left the company, or this is some open source library.', 'start': 20936.451, 'duration': 5.861}, {'end': 20945.694, 'text': 'So in all these cases, you will have to read and understand code.', 'start': 20943.012, 'duration': 2.682}, {'end': 20952.4, 'text': "So read it and then describe insertion sort the algorithm in plain English, then look it up online and see if it matches what you've written.", 'start': 20946.055, 'duration': 6.345}, {'end': 20955.042, 'text': 'And then, second,', 'start': 20953.761, 'duration': 1.281}, {'end': 20963.609, 'text': 'is to also determine the time and space complexity of insertion sort and see if it is any better than bubble sort and explain why or why not.', 'start': 20955.042, 'duration': 8.567}], 'summary': 'Understand and describe insertion sort algorithm, compare its time and space complexity with bubble sort.', 'duration': 27.158, 'max_score': 20936.451, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA20936451.jpg'}], 'start': 18969.94, 'title': 'Sorting algorithms & efficiency in python', 'summary': 'Discusses sorting and divide and conquer algorithms in python, emphasizing the importance of understanding common approaches for sorting, providing a certification upon completion, and testing code efficiency using jupyter notebooks and the range function, with a focus on bubble sort and insertion sort implementations.', 'chapters': [{'end': 19206.154, 'start': 18969.94, 'title': 'Data structures & algorithms: sorting & divide', 'summary': 'Discusses the walkthrough of assignment two of data structures and algorithms in python, with a focus on sorting algorithms and divide and conquer, offering a certification upon completing four weekly assignments and a course project.', 'duration': 236.214, 'highlights': ['The course provides a certification upon completing four weekly assignments and a course project.', 'Instructions on executing the code are given for both online and local environments.', "The chapter's focus is on sorting algorithms and divide and conquer."]}, {'end': 19388.495, 'start': 19208.447, 'title': 'Sorting algorithms in python', 'summary': 'Focuses on sorting algorithms and divide and conquer algorithms in python, discussing the importance of understanding common approaches for sorting, and following a systematic strategy for solving programming problems, culminating in the implementation of a function to sort a list of numbers in ascending order.', 'duration': 180.048, 'highlights': ['The chapter discusses the importance of understanding common approaches for sorting, how they work, and the trade-offs between them, emphasizing the need for an efficient function to sort a list of notebooks in decreasing order of likes, with the potential for millions of notebooks to be created every week.', 'The systematic strategy for solving programming problems involves clearly stating the problem, identifying input and output formats, providing example inputs and outputs, coming up with a correct solution, implementing and testing the solution using example inputs, analyzing its complexity, identifying inefficiencies, applying the right techniques to overcome inefficiency, and repeating the process if necessary.', 'The specific problem discussed is to write a function to sort a list of numbers in ascending or increasing order, with the input being a list of numbers and the output being the sorted version of the input.']}, {'end': 19794.125, 'start': 19391.081, 'title': 'Testing code efficiency and test cases', 'summary': 'Discusses running code in jupyter notebooks, the importance of coming up with test scenarios, creating test cases, and using the range function to create a long list for evaluating algorithm efficiency. it also emphasizes the use of helper functions and the difference between range and list in python.', 'duration': 403.044, 'highlights': ['The chapter discusses the importance of coming up with test scenarios and creating test cases to catch errors early on, emphasizing the need to think about all the different scenarios and special cases, including sorting, repeating elements, empty lists, and long lists for evaluating algorithm efficiency.', 'The chapter explains the process of creating test cases, involving setting up a dictionary for each test case with input and output keys, and using a single helper function to automate the testing of all test cases.', 'The chapter demonstrates the use of the range function to create a long list of 10,000 numbers and emphasizes the efficiency of using helper functions and the difference between range and list in Python.']}, {'end': 20460.274, 'start': 19794.545, 'title': 'Bubble sort algorithm & implementation', 'summary': 'Explains the concept of bubble sort algorithm, its step-by-step implementation, and testing with various test cases. it emphasizes creating good test cases before coding, iterating through the list to compare and swap elements, and the necessity of repeating the sorting process at most n-1 times to ensure the array is sorted.', 'duration': 665.729, 'highlights': ['Creating good test cases is important before coding or suggesting a solution, even in interviews.', 'Iterating through the list to compare and swap elements based on their order, forming the basis of bubble sort algorithm.', 'Necessity of repeating the sorting process at most n-1 times to ensure that the array is sorted, due to the largest number reaching the very end after one iteration of the process.']}, {'end': 21003.785, 'start': 20460.274, 'title': 'Bubble sort and insertion sort', 'summary': 'Covers the testing of a bubble sort algorithm with various test cases, its time and space complexity, and introduces insertion sort as an alternative algorithm, discussing the importance of understanding and analyzing code, and the usage of the jovian library for capturing snapshots.', 'duration': 543.511, 'highlights': ['Bubble sort successfully sorted 10,000 elements with all test cases passed.', 'Bubble sort has a time complexity of order N square and space complexity of order one.', 'The inefficiency of bubble sort arises from the shifting of elements by at most one position at a time.', 'Insertion sort is introduced as an alternative algorithm to bubble sort.', 'The importance of reading and understanding source code is emphasized, along with an exercise to describe insertion sort and analyze its time and space complexity.']}], 'duration': 2033.845, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA18969940.jpg', 'highlights': ['The course provides a certification upon completing four weekly assignments and a course project.', "The chapter's focus is on sorting algorithms and divide and conquer.", 'The chapter discusses the importance of understanding common approaches for sorting, how they work, and the trade-offs between them, emphasizing the need for an efficient function to sort a list of notebooks in decreasing order of likes, with the potential for millions of notebooks to be created every week.', 'The systematic strategy for solving programming problems involves clearly stating the problem, identifying input and output formats, providing example inputs and outputs, coming up with a correct solution, implementing and testing the solution using example inputs, analyzing its complexity, identifying inefficiencies, applying the right techniques to overcome inefficiency, and repeating the process if necessary.', 'The chapter discusses the importance of coming up with test scenarios and creating test cases to catch errors early on, emphasizing the need to think about all the different scenarios and special cases, including sorting, repeating elements, empty lists, and long lists for evaluating algorithm efficiency.', 'Creating good test cases is important before coding or suggesting a solution, even in interviews.', 'Bubble sort successfully sorted 10,000 elements with all test cases passed.', 'Bubble sort has a time complexity of order N square and space complexity of order one.', 'The inefficiency of bubble sort arises from the shifting of elements by at most one position at a time.', 'Insertion sort is introduced as an alternative algorithm to bubble sort.', 'The importance of reading and understanding source code is emphasized, along with an exercise to describe insertion sort and analyze its time and space complexity.', 'The chapter demonstrates the use of the range function to create a long list of 10,000 numbers and emphasizes the efficiency of using helper functions and the difference between range and list in Python.', 'Instructions on executing the code are given for both online and local environments.', 'The specific problem discussed is to write a function to sort a list of numbers in ascending or increasing order, with the input being a list of numbers and the output being the sorted version of the input.']}, {'end': 21986.568, 'segs': [{'end': 21077.953, 'src': 'embed', 'start': 21048.688, 'weight': 1, 'content': [{'end': 21054.912, 'text': 'And it has this general steps that is applied in different, different ways across different problems.', 'start': 21048.688, 'duration': 6.224}, {'end': 21059.755, 'text': 'So step one is to divide the inputs into two roughly equal parts.', 'start': 21055.912, 'duration': 3.843}, {'end': 21063.077, 'text': "Okay They don't have to be exactly equal, but two roughly equal parts.", 'start': 21059.775, 'duration': 3.302}, {'end': 21064.818, 'text': 'And the idea here is that.', 'start': 21063.837, 'duration': 0.981}, {'end': 21070.61, 'text': 'those two parts can themselves be used as inputs, as sub-problems.', 'start': 21065.848, 'duration': 4.762}, {'end': 21077.953, 'text': 'So then we use recursion, so we recursively solve the problem individually for each of the two parts.', 'start': 21071.39, 'duration': 6.563}], 'summary': 'A general approach involves dividing inputs into two roughly equal parts and solving them recursively.', 'duration': 29.265, 'max_score': 21048.688, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA21048688.jpg'}, {'end': 21166.206, 'src': 'embed', 'start': 21141.971, 'weight': 4, 'content': [{'end': 21148.677, 'text': 'You take the problem divided into two sub problems, recursively solve the sub problems, get the solutions of the sub problems and then combine them.', 'start': 21141.971, 'duration': 6.706}, {'end': 21151.82, 'text': 'So you can also call it divide, conquer, combine in some sense.', 'start': 21149.058, 'duration': 2.762}, {'end': 21161.524, 'text': 'And merge sort is the algorithm that is the classic application of divide and conquer to the sorting problem.', 'start': 21154.58, 'duration': 6.944}, {'end': 21166.206, 'text': "So let's take a look at merge sort by looking at an example visually.", 'start': 21162.184, 'duration': 4.022}], 'summary': 'Divide, solve, combine in merge sort algorithm.', 'duration': 24.235, 'max_score': 21141.971, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA21141971.jpg'}, {'end': 21336.268, 'src': 'embed', 'start': 21286.695, 'weight': 0, 'content': [{'end': 21288.676, 'text': "So let's now state it in plain English.", 'start': 21286.695, 'duration': 1.981}, {'end': 21296.922, 'text': 'So first the terminating condition, if the input list is empty or contains just one element, then it is already sorted.', 'start': 21290.337, 'duration': 6.585}, {'end': 21297.763, 'text': 'Return it.', 'start': 21297.302, 'duration': 0.461}, {'end': 21307.73, 'text': 'If it is not divide the list of numbers into two roughly equal parts, then sort each part recursively using the merge sort algorithm.', 'start': 21299.124, 'duration': 8.606}, {'end': 21313.653, 'text': 'And by the power of recursion, you will get back to sorted lists.', 'start': 21310.131, 'duration': 3.522}, {'end': 21319.457, 'text': 'Then merge the two sorted lists to get a single sorted list.', 'start': 21315.795, 'duration': 3.662}, {'end': 21321.058, 'text': 'And this is the key operation here.', 'start': 21319.757, 'duration': 1.301}, {'end': 21327.882, 'text': "And this is why it's called a merge sort, because we are always merging sorted list and making bigger and bigger sorted lists out of them.", 'start': 21321.098, 'duration': 6.784}, {'end': 21334.386, 'text': 'And the merge operation is something that you may be asked to write in an interview or a coding challenge,', 'start': 21329.723, 'duration': 4.663}, {'end': 21336.268, 'text': 'apart from the whole merge sort operation itself.', 'start': 21334.386, 'duration': 1.882}], 'summary': 'Merge sort algorithm recursively divides and merges lists to achieve sorting.', 'duration': 49.573, 'max_score': 21286.695, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA21286695.jpg'}, {'end': 21930.398, 'src': 'embed', 'start': 21896.894, 'weight': 3, 'content': [{'end': 21899.496, 'text': 'So now we have the merge operation and we have the merge sort operation.', 'start': 21896.894, 'duration': 2.602}, {'end': 21901.899, 'text': 'So we can now test out the merge sort function.', 'start': 21899.517, 'duration': 2.382}, {'end': 21907.244, 'text': 'So we get the first set of inputs and outputs from test zero.', 'start': 21902.92, 'duration': 4.324}, {'end': 21915.431, 'text': 'And you can see here that this is the input and this was the expected output.', 'start': 21910.627, 'duration': 4.804}, {'end': 21917.053, 'text': 'And this was the actual output as well.', 'start': 21915.531, 'duration': 1.522}, {'end': 21924.076, 'text': "Now let's test all the cases using the evaluate test cases function from Jovian.", 'start': 21920.154, 'duration': 3.922}, {'end': 21930.398, 'text': 'So here we are simply going to call evaluate test cases on the entire list of test cases.', 'start': 21924.956, 'duration': 5.442}], 'summary': 'Testing merge sort function with multiple test cases.', 'duration': 33.504, 'max_score': 21896.894, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA21896894.jpg'}], 'start': 21004.185, 'title': 'Merge sort algorithm', 'summary': 'Explores the merge sort algorithm, involving recursive calls and the merge operation, providing insights into its application and functionality, and validating its performance with test cases.', 'chapters': [{'end': 21524.969, 'start': 21004.185, 'title': 'Divide and conquer strategy for sorting', 'summary': "Explores the 'divide and conquer' strategy for sorting algorithms, detailing the steps and application of the technique, with a focus on merge sort, and provides insights into the implementation of the merge sort algorithm using recursion and the merge operation.", 'duration': 520.784, 'highlights': ["The 'divide and conquer' strategy involves dividing the inputs into two roughly equal parts, recursively solving the sub-problems individually, and then combining the results to solve the problem for the original inputs.", "Merge sort is a classic application of 'divide and conquer' to the sorting problem, involving the division of the problem into two subproblems, recursive sorting, and combining the results to get a fully sorted list.", 'The merge operation in merge sort involves merging sorted lists to create bigger and bigger sorted lists, with the merge operation being a crucial aspect of the merge sort algorithm.', 'The merge sort algorithm implementation includes a terminating condition for empty or single-element input lists, splitting the list into two halves, and using the merge operation to merge the sorted sublists.', "The use of the 'divide and conquer' strategy and the merge sort algorithm is demonstrated through a step-by-step example of sorting a list, emphasizing the recursive sorting and merging process."]}, {'end': 21713.147, 'start': 21525.029, 'title': 'Merge sort algorithm', 'summary': 'Explains the merge sort algorithm, involving recursive calls to merge sort function, the merge operation to combine sorted halves, and the process of comparing and merging two sorted arrays to achieve the final sorted list.', 'duration': 188.118, 'highlights': ['The chapter explains the merge sort algorithm, involving recursive calls to merge sort function, the merge operation to combine sorted halves, and the process of comparing and merging two sorted arrays to achieve the final sorted list.', 'The merge sort function involves recursive calls, resulting in a sorted list for each half, which are then combined using the merge operation to obtain the final sorted numbers.', 'The merge operation involves comparing and merging two sorted arrays, resulting in a simple process involving comparisons and pointer manipulation to achieve the final sorted merged array.']}, {'end': 21986.568, 'start': 21718.038, 'title': 'Merge sort function explanation', 'summary': 'Explains the process of merging two sorted lists and testing the merge sort function, demonstrating its functionality with examples and validating its performance with test cases.', 'duration': 268.53, 'highlights': ['The chapter explains the process of merging two sorted lists by iterating over the lists, comparing and appending elements, and handling remaining elements, with an emphasis on pointers and indices.', 'The chapter demonstrates the functionality of the merge sort function by testing it with multiple test cases, ensuring its accurate sorting of input lists and its ability to handle various scenarios.', 'The chapter emphasizes the importance of using print statements and test cases to identify and resolve errors in the code, highlighting their effectiveness in debugging and problem-solving.']}], 'duration': 982.383, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA21004185.jpg', 'highlights': ['The merge operation in merge sort involves merging sorted lists to create bigger and bigger sorted lists, with the merge operation being a crucial aspect of the merge sort algorithm.', "The 'divide and conquer' strategy involves dividing the inputs into two roughly equal parts, recursively solving the sub-problems individually, and then combining the results to solve the problem for the original inputs.", 'The merge sort algorithm implementation includes a terminating condition for empty or single-element input lists, splitting the list into two halves, and using the merge operation to merge the sorted sublists.', 'The chapter demonstrates the functionality of the merge sort function by testing it with multiple test cases, ensuring its accurate sorting of input lists and its ability to handle various scenarios.', "The use of the 'divide and conquer' strategy and the merge sort algorithm is demonstrated through a step-by-step example of sorting a list, emphasizing the recursive sorting and merging process."]}, {'end': 24285.495, 'segs': [{'end': 22038.397, 'src': 'embed', 'start': 22010.843, 'weight': 0, 'content': [{'end': 22017.326, 'text': "So that's more sort is much, much faster, right? A millisecond is 0.0001, 10 to the power minus three seconds.", 'start': 22010.843, 'duration': 6.483}, {'end': 22024.308, 'text': 'So in a second, you can probably sort 200 of 200 lists of size 10, 000.', 'start': 22017.786, 'duration': 6.522}, {'end': 22026.53, 'text': "and that's what makes merge sort so much more powerful.", 'start': 22024.309, 'duration': 2.221}, {'end': 22028.051, 'text': 'and because it is so much more efficient.', 'start': 22026.53, 'duration': 1.521}, {'end': 22038.397, 'text': 'and as we analyze the complexity, you will learn that merge sort is in fact more efficient in terms of the bigger notation as well.', 'start': 22028.051, 'duration': 10.346}], 'summary': 'Merge sort can sort 200 lists of size 10,000 in a second, making it much more efficient.', 'duration': 27.554, 'max_score': 22010.843, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA22010843.jpg'}, {'end': 22492.681, 'src': 'embed', 'start': 22459.25, 'weight': 1, 'content': [{'end': 22463.534, 'text': 'So since we said that there are N times H comparisons and H is log N plus one.', 'start': 22459.25, 'duration': 4.284}, {'end': 22471.361, 'text': 'So it follows that the complexity of merge sort is N log N.', 'start': 22464.275, 'duration': 7.086}, {'end': 22473.403, 'text': "And that's a big improvement from N square.", 'start': 22471.361, 'duration': 2.042}, {'end': 22475.305, 'text': 'It may not seem like much, but it is.', 'start': 22473.503, 'duration': 1.802}, {'end': 22488.744, 'text': 'So N square for 10, 000 is 10, 000 times 10, 000, but N log N for 10, 000 is 10, 000 times 12 or 13 locked to the base two.', 'start': 22475.545, 'duration': 13.199}, {'end': 22492.681, 'text': "So that's about a few hundred times faster.", 'start': 22489.898, 'duration': 2.783}], 'summary': 'Merge sort complexity is n log n, a few hundred times faster than n square for 10,000 items.', 'duration': 33.431, 'max_score': 22459.25, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA22459250.jpg'}, {'end': 22670.68, 'src': 'embed', 'start': 22639.2, 'weight': 4, 'content': [{'end': 22640.823, 'text': "But here we'll go one step further.", 'start': 22639.2, 'duration': 1.623}, {'end': 22646.252, 'text': "What we'll do is we will apply another technique to overcome the inefficiency in merge sort.", 'start': 22641.103, 'duration': 5.149}, {'end': 22649.012, 'text': 'The time complexity is pretty good.', 'start': 22647.591, 'duration': 1.421}, {'end': 22655.194, 'text': 'You can actually sort millions or even tens of millions of elements with merge sort quite reliably,', 'start': 22649.392, 'duration': 5.802}, {'end': 22661.476, 'text': "but it's a space complexity that causes a problem now, because merge sort requires allocating additional space.", 'start': 22655.194, 'duration': 6.282}, {'end': 22670.68, 'text': 'And that is additional spaces as large as the input itself that makes it somewhat slow in practice because memory allocation is more expensive than.', 'start': 22662.036, 'duration': 8.644}], 'summary': 'Merge sort has efficient time complexity, able to sort millions of elements, but space complexity causes issues due to requiring large additional space.', 'duration': 31.48, 'max_score': 22639.2, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA22639200.jpg'}, {'end': 22937.375, 'src': 'embed', 'start': 22895.416, 'weight': 5, 'content': [{'end': 22901.802, 'text': 'Okay So as he said, the key observation here is that after the partition, the pivot element is at its right place in the sorted array.', 'start': 22895.416, 'duration': 6.386}, {'end': 22904.983, 'text': 'The two parts of the array can be sorted independently in place.', 'start': 22902.302, 'duration': 2.681}, {'end': 22910.784, 'text': 'Now, maybe once again, take pen and paper and try to work it out yourself.', 'start': 22905.623, 'duration': 5.161}, {'end': 22918.626, 'text': 'Again, all of this makes a lot more sense when you actually put it down and solve a real problem as a real example.', 'start': 22911.404, 'duration': 7.222}, {'end': 22921.709, 'text': "So here's an implementation of quicksort.", 'start': 22920.188, 'duration': 1.521}, {'end': 22929.932, 'text': 'And once again, we will assume that we already have a helper function called partition, which can pick a pivot partition, the array,', 'start': 22922.449, 'duration': 7.483}, {'end': 22933.533, 'text': 'and return the position of the pivot element for the next quicksort step.', 'start': 22929.932, 'duration': 3.601}, {'end': 22937.375, 'text': 'Okay, So this entire process going from here to here.', 'start': 22933.873, 'duration': 3.502}], 'summary': 'After partition, pivot is at right place in sorted array, allowing independent sorting of array parts.', 'duration': 41.959, 'max_score': 22895.416, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA22895416.jpg'}, {'end': 23882.519, 'src': 'embed', 'start': 23849.884, 'weight': 3, 'content': [{'end': 23858.888, 'text': 'So that in this case the time complexity is roughly n times n minus one by two.', 'start': 23849.884, 'duration': 9.004}, {'end': 23863.89, 'text': 'So the time complexity is about order n square.', 'start': 23860.889, 'duration': 3.001}, {'end': 23867.932, 'text': "And that's bad because that's as bad as bubble sort.", 'start': 23865.831, 'duration': 2.101}, {'end': 23876.098, 'text': 'But despite the quadratic worst case time complexity, Quicksort is still preferred in many situations.', 'start': 23870.296, 'duration': 5.802}, {'end': 23882.519, 'text': 'Now it really depends on what kind of algorithm you need to use and what kind of memory constraints you have.', 'start': 23876.678, 'duration': 5.841}], 'summary': 'Quicksort has a time complexity of about o(n^2), but is still preferred in many situations.', 'duration': 32.635, 'max_score': 23849.884, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA23849884.jpg'}, {'end': 24000.025, 'src': 'embed', 'start': 23970.788, 'weight': 2, 'content': [{'end': 23977.29, 'text': 'But it also has a space complexity of, or the additional space requirement of ordering, which can be avoided using quicksort.', 'start': 23970.788, 'duration': 6.502}, {'end': 23989.399, 'text': 'Which uses order one additional space but can have order in square complexity in the worst case time complexity.', 'start': 23979.21, 'duration': 10.189}, {'end': 23992.001, 'text': 'but with the right choice of a pivot it is closer to N log N.', 'start': 23989.399, 'duration': 2.602}, {'end': 24000.025, 'text': "So that's sorting, and you can see that Python is such an expressive language that all these sorting algorithms,", 'start': 23993.482, 'duration': 6.543}], 'summary': 'Quicksort has o(1) space, n log n time complexity in python.', 'duration': 29.237, 'max_score': 23970.788, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA23970788.jpg'}, {'end': 24099.807, 'src': 'embed', 'start': 24071.607, 'weight': 8, 'content': [{'end': 24074.689, 'text': 'So first we need to sort objects this time and not just numbers.', 'start': 24071.607, 'duration': 3.082}, {'end': 24080.013, 'text': 'And second, we also want to sort them in the decreasing order of likes for each notebook.', 'start': 24075.55, 'duration': 4.463}, {'end': 24094.283, 'text': "Okay. So all we need to do to use our merge sort or quick sort techniques that we've already discussed is to define a custom comparison function to compare two notebooks.", 'start': 24080.253, 'duration': 14.03}, {'end': 24099.807, 'text': "Okay But before we do that, we let's create a class that can capture some basic information about notebooks.", 'start': 24094.543, 'duration': 5.264}], 'summary': 'Sort objects by likes in decreasing order using custom comparison function.', 'duration': 28.2, 'max_score': 24071.607, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA24071607.jpg'}], 'start': 21986.568, 'title': 'Sorting algorithms efficiency and complexity', 'summary': "Delves into the efficiency and complexity of merge sort, highlighting its execution speed of 50 milliseconds compared to 15 seconds for bubble sort with 10,000 numbers, and its time complexity of n log n. it also discusses the quick sort algorithm's in-place sorting strategy, pivot selection, partitioning technique, and the process of quick sort and partitioning, emphasizing understanding the code and using print statements for better comprehension. additionally, it explains the time and space complexity of quicksort and the creation of a custom comparison function for sorting objects.", 'chapters': [{'end': 22701.462, 'start': 21986.568, 'title': 'Merge sort efficiency and complexity', 'summary': 'Explains the efficiency and complexity of merge sort, highlighting its speed of 50 milliseconds for execution compared to 15 seconds for bubble sort with 10,000 numbers, and its time complexity of n log n, making it a few hundred times faster than n square for 10,000 elements and allowing reliable sorting of millions of elements.', 'duration': 714.894, 'highlights': ["Merge sort executes in about 50 milliseconds, much faster than bubble sort's 15 seconds for 10,000 numbers.", "Merge sort's time complexity is N log N, making it a few hundred times faster than N square for 10,000 elements.", 'Merge sort allows reliable sorting of millions of elements.']}, {'end': 23041.563, 'start': 22701.542, 'title': 'Quick sort algorithm', 'summary': 'Discusses the quick sort algorithm, emphasizing its in-place sorting strategy, pivot selection, and partitioning technique, enabling independent sorting of array parts, avoiding additional space and maintaining the n log n time complexity.', 'duration': 340.021, 'highlights': ['Quick sort uses in-place sorting, avoiding additional space, and maintaining the n log n time complexity.', 'Pivot selection and partitioning technique enable independent sorting of array parts.', "Emphasis on the pivot's correct position after partitioning, leading to independent sorting of array parts."]}, {'end': 23654.582, 'start': 23041.583, 'title': 'Quick sort and partitioning', 'summary': 'Explains the process of quick sort and partitioning, including the identification of pivot element, the partition operation, and the recursive calls for sorting, with an emphasis on the importance of understanding the code and using print statements for better comprehension.', 'duration': 612.999, 'highlights': ['The chapter explains the process of quick sort and partitioning', 'the identification of pivot element', 'the partition operation', 'recursive calls for sorting', 'importance of understanding the code and using print statements for better comprehension']}, {'end': 24285.495, 'start': 23655.965, 'title': 'Quicksort time and space complexity', 'summary': 'Explains the time complexity of quicksort and its worst-case scenario, highlighting that quicksort has an average time complexity of nlogn and a worst-case time complexity of n^2, while also discussing its space complexity of order n. additionally, it covers the process of creating a custom comparison function for sorting objects in decreasing order of likes.', 'duration': 629.53, 'highlights': ['Quicksort has an average time complexity of nlogn and a worst-case time complexity of n^2.', 'The space complexity of quicksort is order N.', 'Creating a custom comparison function for sorting objects in decreasing order of likes.']}], 'duration': 2298.927, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA21986568.jpg', 'highlights': ["Merge sort executes in about 50 milliseconds, much faster than bubble sort's 15 seconds for 10,000 numbers.", "Merge sort's time complexity is N log N, making it a few hundred times faster than N square for 10,000 elements.", 'Quick sort uses in-place sorting, avoiding additional space, and maintaining the n log n time complexity.', 'Quicksort has an average time complexity of nlogn and a worst-case time complexity of n^2.', 'Merge sort allows reliable sorting of millions of elements.', 'Pivot selection and partitioning technique enable independent sorting of array parts.', 'The space complexity of quicksort is order N.', 'The chapter explains the process of quick sort and partitioning.', 'Creating a custom comparison function for sorting objects in decreasing order of likes.', "Emphasis on the pivot's correct position after partitioning, leading to independent sorting of array parts."]}, {'end': 25784.286, 'segs': [{'end': 24312.764, 'src': 'embed', 'start': 24286.536, 'weight': 0, 'content': [{'end': 24290.4, 'text': 'So now here is an implementation of merge sort, which accepts a custom comparison function.', 'start': 24286.536, 'duration': 3.864}, {'end': 24292.202, 'text': "So let's see the merge sort function.", 'start': 24290.92, 'duration': 1.282}, {'end': 24294.584, 'text': 'So the merge sort function uses.', 'start': 24292.882, 'duration': 1.702}, {'end': 24299.015, 'text': 'It takes a list of objects this time, not a list of numbers.', 'start': 24296.593, 'duration': 2.422}, {'end': 24306.179, 'text': 'And it also takes a compare function, which by default, we also provide a default comparison so that we can still use it with numbers.', 'start': 24299.915, 'duration': 6.264}, {'end': 24312.764, 'text': 'Now with numbers and default assumption is if you want sorting, you want sorting in increasing order.', 'start': 24306.64, 'duration': 6.124}], 'summary': 'Implementation of merge sort with custom comparison function for a list of objects and default comparison for numbers.', 'duration': 26.228, 'max_score': 24286.536, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA24286536.jpg'}, {'end': 24884.989, 'src': 'embed', 'start': 24857.708, 'weight': 2, 'content': [{'end': 24863.493, 'text': 'and then participate in forum discussions and join or start a study group.', 'start': 24857.708, 'duration': 5.785}, {'end': 24865.515, 'text': 'So this is a great way to learn.', 'start': 24864.054, 'duration': 1.461}, {'end': 24869.578, 'text': 'get together with some friends, maybe watch the lecture together over a zoom call.', 'start': 24865.515, 'duration': 4.063}, {'end': 24871.22, 'text': 'pause the video.', 'start': 24869.578, 'duration': 1.642}, {'end': 24872.921, 'text': 'have discussions wherever you have doubts.', 'start': 24871.22, 'duration': 1.701}, {'end': 24876.925, 'text': 'Discussion is a great way to solve the specific doubts that you may have.', 'start': 24873.462, 'duration': 3.463}, {'end': 24884.989, 'text': 'And it will also help you to articulate your understanding better, because you, when you explain to others,', 'start': 24878.326, 'duration': 6.663}], 'summary': 'Engage in forum discussions, study groups, and video discussions to enhance learning and understanding.', 'duration': 27.281, 'max_score': 24857.708, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA24857708.jpg'}, {'end': 25006.679, 'src': 'embed', 'start': 24975.643, 'weight': 1, 'content': [{'end': 24977.765, 'text': 'In this lecture we will cover recursion,', 'start': 24975.643, 'duration': 2.122}, {'end': 24986.012, 'text': 'memoization and dynamic programming by looking at two common problems in dynamic programming the longest common subsequence problem and then the knapsack problem.', 'start': 24977.765, 'duration': 8.247}, {'end': 24998.17, 'text': "And we'll do this by coding these problems live using the problem solving template that we have been using one in one way or another since lesson one.", 'start': 24988.294, 'duration': 9.876}, {'end': 25000.492, 'text': "So let's open up the problem solving template.", 'start': 24998.31, 'duration': 2.182}, {'end': 25006.679, 'text': 'This is a template that you can use to solve any coding problem.', 'start': 25003.976, 'duration': 2.703}], 'summary': 'Covered recursion, memoization, and dynamic programming by solving longest common subsequence and knapsack problems.', 'duration': 31.036, 'max_score': 24975.643, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA24975643.jpg'}, {'end': 25072.54, 'src': 'embed', 'start': 25042.511, 'weight': 4, 'content': [{'end': 25057.946, 'text': 'start a Jupyter notebook server and you will be able to then execute the code and modify the notebook and save a version of it to your own profile so that you can continue working on it.', 'start': 25042.511, 'duration': 15.435}, {'end': 25060.048, 'text': 'So there we have it.', 'start': 25059.307, 'duration': 0.741}, {'end': 25063.051, 'text': 'Now we have a running Jupyter hub server.', 'start': 25060.528, 'duration': 2.523}, {'end': 25069.539, 'text': "So I'm just going to zoom in here a bit so that you can see things clearly.", 'start': 25066.257, 'duration': 3.282}, {'end': 25072.54, 'text': 'Okay So this is the problem solving template.', 'start': 25070.779, 'duration': 1.761}], 'summary': 'Start jupyter notebook server to execute, modify, and save code in profile.', 'duration': 30.029, 'max_score': 25042.511, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA25042511.jpg'}, {'end': 25501.464, 'src': 'embed', 'start': 25471.552, 'weight': 3, 'content': [{'end': 25477.896, 'text': 'So this is the systematic strategy that we will apply, and nothing about this method has changed since the first lesson,', 'start': 25471.552, 'duration': 6.344}, {'end': 25484.861, 'text': "even though we've covered a whole variety of topics like binary search and binary search trees, and then sorting algorithms and divide and conquer.", 'start': 25477.896, 'duration': 6.965}, {'end': 25486.782, 'text': 'This method has remained the same.', 'start': 25485.662, 'duration': 1.12}, {'end': 25492.707, 'text': 'The first step is to state the problem clearly and identify the input and output formats.', 'start': 25487.323, 'duration': 5.384}, {'end': 25501.464, 'text': 'Then the second step is to come up with some example inputs and outputs, and these will be used to test our solution.', 'start': 25493.777, 'duration': 7.687}], 'summary': 'Systematic strategy remains unchanged. steps: problem statement, input/output identification, example testing.', 'duration': 29.912, 'max_score': 25471.552, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA25471552.jpg'}], 'start': 24286.536, 'title': 'Sorting algorithms and problem solving', 'summary': 'Covers the implementation of merge sort with custom comparison, generic sorting algorithms like bubble sort and quick sort, and recursion and dynamic programming for solving common problems. it emphasizes the importance of daily practice, participation in discussions, and problem-solving techniques, such as identifying input and output formats and implementing solutions. the content provides examples and instructions for practical application, including running code on jupyter notebook server and internalizing concepts.', 'chapters': [{'end': 24495.489, 'start': 24286.536, 'title': 'Merge sort implementation with custom comparison', 'summary': 'Explains the implementation of a merge sort function that accepts a custom comparison function, allowing for sorting of various data types and criteria, such as sorting notebooks by likes and titles, and provides an example of sorting notebooks by titles.', 'duration': 208.953, 'highlights': ['The merge sort function is demonstrated with support for custom comparison function, enabling sorting of diverse data types and criteria, such as notebooks by likes and titles.', 'The example showcases the sorting of notebooks by titles using a custom comparison function, demonstrating the versatility of the merge sort implementation.', 'The function also allows for potential hybrid sorting, enabling the sorting of notebooks by multiple criteria, such as username and title, providing a comprehensive sorting capability.']}, {'end': 24952.06, 'start': 24496.954, 'title': 'Implementing and testing generic sorting algorithms', 'summary': 'Introduces the task of implementing and testing generic versions of bubble sort, insertion sort, and quick sort, while also emphasizing the importance of daily practice, participation in forum discussions, and attempting optional questions to improve understanding and internalize concepts.', 'duration': 455.106, 'highlights': ['Participants are advised to start writing code and solving one problem every day to practice and internalize concepts.', 'Instructions are provided on creating new notebooks and saving them to jovian.commit for sharing and collaboration.', 'Encouragement to participate in forum discussions, ask questions, and create new topics for discussion, along with a reminder to support others taking part in the course.', 'Emphasis on attempting optional questions to improve understanding and internalizing concepts better.', 'Details about the course website pythondsa.com, and the reminder to review lecture videos, execute Jupyter notebooks, complete assignments, and join or start a study group for better learning experience.']}, {'end': 25215.486, 'start': 24953.841, 'title': 'Recursion and dynamic programming', 'summary': 'Covers recursion, memoization, and dynamic programming to solve two common problems - the longest common subsequence and the knapsack problem, using a problem-solving template, and provides instructions on running the code on a jupyter notebook server and saving a copy for further work.', 'duration': 261.645, 'highlights': ['The chapter covers recursion, memoization, and dynamic programming to solve two common problems - the longest common subsequence and the knapsack problem, using a problem-solving template.', 'Instructions on running the code on a Jupyter notebook server and saving a copy for further work are provided.', 'The lecture will cover recursion, memoization, and dynamic programming by coding the longest common subsequence problem and the knapsack problem live.', 'The chapter provides a problem-solving template that can be used to solve any coding problem and illustrates this by solving two problems using the template.', 'The lecture focuses on the topic of recursion and dynamic programming, with a recording available in Hindi as well.']}, {'end': 25784.286, 'start': 25215.606, 'title': 'Understanding sequences and subsequences', 'summary': 'Explains the concept of sequences and subsequences, illustrating the definitions with examples, and emphasizes the importance of clear communication and asking questions. it also introduces the concept of common subsequences and longest common subsequences, with a focus on finding the length of the longest common subsequence between two sequences and the systematic problem-solving approach, including identifying input and output formats, coming up with example inputs and outputs, and implementing and testing the solution.', 'duration': 568.68, 'highlights': ['The chapter explains the concept of sequences and subsequences, illustrating the definitions with examples, and emphasizes the importance of clear communication and asking questions.', 'Introduces the concept of common subsequences and longest common subsequences, with a focus on finding the length of the longest common subsequence between two sequences.', 'Emphasizes the systematic problem-solving approach, including identifying input and output formats, coming up with example inputs and outputs, and implementing and testing the solution.']}], 'duration': 1497.75, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA24286536.jpg', 'highlights': ['The merge sort function supports custom comparison for diverse data types and criteria.', 'The chapter covers recursion, memoization, and dynamic programming for problem-solving.', 'Participants are encouraged to practice daily coding and engage in forum discussions.', 'Emphasis on systematic problem-solving approach and clear communication.', 'Instructions provided for running code on Jupyter notebook server and saving for further work.']}, {'end': 27003.299, 'segs': [{'end': 25830.667, 'src': 'embed', 'start': 25785.867, 'weight': 0, 'content': [{'end': 25789.789, 'text': 'So I have written out a few test cases here already.', 'start': 25785.867, 'duration': 3.922}, {'end': 25794.141, 'text': 'Now the most common case is a general case of a string.', 'start': 25791.198, 'duration': 2.943}, {'end': 25796.803, 'text': 'Like we had serendipitous and precipitation.', 'start': 25794.601, 'duration': 2.202}, {'end': 25798.064, 'text': "That's a common case.", 'start': 25797.283, 'duration': 0.781}, {'end': 25799.585, 'text': 'There is one of them.', 'start': 25798.284, 'duration': 1.301}, {'end': 25806.171, 'text': "Both of them have some common elements and there's a common subsequence of length seven.", 'start': 25800.726, 'duration': 5.445}, {'end': 25809.874, 'text': 'But we may also want to test out another type of data.', 'start': 25806.992, 'duration': 2.882}, {'end': 25816.88, 'text': 'And this is one of the nice things about Python, where you can write functions that operate not just on a particular class and its subclasses,', 'start': 25810.374, 'duration': 6.506}, {'end': 25821.483, 'text': 'but on any kind of data, as long as it satisfies certain criteria.', 'start': 25816.88, 'duration': 4.603}, {'end': 25829.647, 'text': 'For instance, strings and lists both allow indexing into them and picking out the ith element or the nth element from the sequence.', 'start': 25821.523, 'duration': 8.124}, {'end': 25830.667, 'text': "So they're both sequences.", 'start': 25829.667, 'duration': 1}], 'summary': 'Testing general and specific cases using python functions on different data types.', 'duration': 44.8, 'max_score': 25785.867, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA25785867.jpg'}, {'end': 26163.862, 'src': 'embed', 'start': 26135.07, 'weight': 3, 'content': [{'end': 26139.153, 'text': "Let's create two counters IDX one and IDX two, both starting at zero.", 'start': 26135.07, 'duration': 4.083}, {'end': 26152.624, 'text': 'So IDX one will be a pointer which will start tracking elements in the first sequence and IDX two will be a pointer which will start tracking elements in the second sequence.', 'start': 26139.793, 'duration': 12.831}, {'end': 26157.538, 'text': 'And what we do is we will write a recursive function.', 'start': 26153.976, 'duration': 3.562}, {'end': 26163.862, 'text': "So we'll write a recursive function, which will compute the LCS of sequence one.", 'start': 26157.998, 'duration': 5.864}], 'summary': 'Create two counters idx one and idx two to track elements in two sequences and write a recursive function to compute the lcs of sequence one.', 'duration': 28.792, 'max_score': 26135.07, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA26135070.jpg'}, {'end': 26482.586, 'src': 'embed', 'start': 26455.932, 'weight': 4, 'content': [{'end': 26459.959, 'text': 'So in this case, we know that L occurs in the longest common subsequence of these two elements.', 'start': 26455.932, 'duration': 4.027}, {'end': 26465.118, 'text': 'So now we can get the LCS of O G Y and C H E M Y.', 'start': 26461.516, 'duration': 3.602}, {'end': 26470.8, 'text': 'Okay And then as these recursive calls complete, you can see that this entire tree pans out.', 'start': 26465.118, 'duration': 5.682}, {'end': 26475.042, 'text': 'You can see that each time you either get one child or you get two children.', 'start': 26471.04, 'duration': 4.002}, {'end': 26482.586, 'text': 'And if you go all the way down and then you go back up and simply count the number of matches for each path you will key and you take,', 'start': 26475.162, 'duration': 7.424}], 'summary': 'Finding the longest common subsequence in a recursive tree.', 'duration': 26.654, 'max_score': 26455.932, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA26455932.jpg'}], 'start': 25785.867, 'title': 'Python function testing and handling subsequences', 'summary': 'Discusses testing python functions for various data types and the importance of handling special cases when finding common subsequences in strings and lists. it emphasizes the significance of creating comprehensive test cases and provides a recursive approach to finding the longest common subsequence (lcs) along with a recursive solution.', 'chapters': [{'end': 25830.667, 'start': 25785.867, 'title': 'Python function testing', 'summary': 'Discusses testing python functions, highlighting the ability to test different data types such as strings and lists, emphasizing the versatility of python in handling various data types and its ability to operate on any data as long as it satisfies certain criteria.', 'duration': 44.8, 'highlights': ['Python functions can operate not only on specific classes and their subclasses, but also on any type of data that satisfies certain criteria, such as strings and lists, which both allow indexing and picking out elements from the sequence.', "The most common test case involves general strings, with examples being 'serendipitous' and 'precipitation', which both have a common subsequence of length seven."]}, {'end': 26134.049, 'start': 25831.048, 'title': 'Handling subsequences in strings and lists', 'summary': 'Covers the importance of handling special cases when finding common subsequences, including scenarios where one sequence is empty, both sequences are empty, and multiple subsequences have the same length. it also emphasizes the significance of creating comprehensive test cases to ensure a robust solution, with an example of converting test cases into dictionaries for easy verification. the chapter concludes with the suggestion of developing a correct solution in plain english before focusing on efficiency.', 'duration': 303.001, 'highlights': ['It emphasizes the significance of creating comprehensive test cases to ensure a robust solution, with an example of converting test cases into dictionaries for easy verification.', 'The chapter covers the importance of handling special cases when finding common subsequences, including scenarios where one sequence is empty, both sequences are empty, and multiple subsequences have the same length.', 'The chapter concludes with the suggestion of developing a correct solution in plain English before focusing on efficiency.']}, {'end': 26539.253, 'start': 26135.07, 'title': 'Recursive longest common subsequence', 'summary': 'Discusses the recursive approach to finding the longest common subsequence (lcs) between two sequences, demonstrating the algorithm with an example and explaining the logic behind the recursive function and tree representation.', 'duration': 404.183, 'highlights': ['The recursive function computes the LCS of sequence one from IDX one to the end and sequence two from IDX two to the end.', 'If sequence one of IDX one and sequence two of IDX two are equal, the length of the LCS will be the length of the LCS between the remaining portions plus one.', 'If the characters at the given indices are not equal, the recursion explores both possibilities and selects the longer LCS length.', 'The recursive calls form a tree structure representing the different paths and their respective LCS lengths, with the final LCS length being determined by selecting the maximum along the paths.']}, {'end': 27003.299, 'start': 26540.219, 'title': 'Longest common subsequence recursive solution', 'summary': 'Discusses the recursive solution to find the longest common subsequence (lcs) between two sequences, emphasizing the importance of recursion in solving data structures and algorithms problems. the solution involves using two counters to compare elements, handling base cases, and utilizing recursion to compute subproblems.', 'duration': 463.08, 'highlights': ['The recursive solution for finding the LCS is discussed, emphasizing the importance of understanding recursion in solving data structures and algorithms problems.', 'The solution involves using two counters to compare elements of the sequences and handling base cases when the index reaches the end points, resulting in an empty LCS with a length of zero.', 'The approach of using recursion to compute subproblems is explained, demonstrating the utilization of subproblems to compute the final problem.']}], 'duration': 1217.432, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA25785867.jpg', 'highlights': ['Python functions can operate on any type of data satisfying certain criteria', 'The most common test case involves general strings with a common subsequence of length seven', 'The chapter covers the importance of handling special cases when finding common subsequences', 'The recursive function computes the LCS of sequence one from IDX one to the end and sequence two from IDX two to the end', 'The recursive calls form a tree structure representing the different paths and their respective LCS lengths']}, {'end': 28118.538, 'segs': [{'end': 27058.203, 'src': 'embed', 'start': 27031.511, 'weight': 4, 'content': [{'end': 27037.413, 'text': "lists and lists work too, because all we've used here is indexing and length.", 'start': 27031.511, 'duration': 5.902}, {'end': 27040.954, 'text': 'And these are both things that are available in both strings and lists.', 'start': 27037.753, 'duration': 3.201}, {'end': 27045.576, 'text': "And this is something that's very nice about Python, the dynamic nature of the functions.", 'start': 27041.354, 'duration': 4.222}, {'end': 27048.697, 'text': 'uh, once again, this worked perfectly fine.', 'start': 27046.696, 'duration': 2.001}, {'end': 27050.979, 'text': 'and then here we have another one longest in stone.', 'start': 27048.697, 'duration': 2.282}, {'end': 27054.221, 'text': 'the expected output was three and the actual output was three as well.', 'start': 27050.979, 'duration': 3.242}, {'end': 27058.203, 'text': 'here we have ads f, e, w, ad and another string.', 'start': 27054.221, 'duration': 3.982}], 'summary': "Python's dynamic functions enable indexing and length operations on strings and lists, yielding the expected output of three for a specific case.", 'duration': 26.692, 'max_score': 27031.511, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA27031511.jpg'}, {'end': 27111.834, 'src': 'embed', 'start': 27087.333, 'weight': 3, 'content': [{'end': 27094.477, 'text': "then that would tell you that you've probably not handled that empty case properly, and that is why having great test cases is very important.", 'start': 27087.333, 'duration': 7.144}, {'end': 27096.799, 'text': 'okay, and we can see the timings for these as well.', 'start': 27094.477, 'duration': 2.322}, {'end': 27097.98, 'text': 'each of these took about.', 'start': 27096.799, 'duration': 1.181}, {'end': 27101.51, 'text': 'Uh well, four 80 milliseconds was the highest.', 'start': 27098.869, 'duration': 2.641}, {'end': 27103.371, 'text': "Now that's still a bit high.", 'start': 27102.05, 'duration': 1.321}, {'end': 27111.834, 'text': 'I would say the four 80 milliseconds, because we are just looking at a sequence of serendipitous and precipitation, which are of very short length.', 'start': 27103.431, 'duration': 8.403}], 'summary': 'Test cases reveal issues, highest timing was 480 milliseconds.', 'duration': 24.501, 'max_score': 27087.333, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA27087333.jpg'}, {'end': 27863.787, 'src': 'embed', 'start': 27832.368, 'weight': 1, 'content': [{'end': 27844.495, 'text': 'you can see that it took 480 milliseconds for the for finding the longest common subsequence between precipitation and serendipitous.', 'start': 27832.368, 'duration': 12.127}, {'end': 27849.437, 'text': 'But in this case, it only took about 0.234.', 'start': 27845.035, 'duration': 4.402}, {'end': 27850.778, 'text': 'which is 0.2 milliseconds.', 'start': 27849.437, 'duration': 1.341}, {'end': 27855.201, 'text': 'So it is 2000 times faster, even for strings of length seven or eight.', 'start': 27850.798, 'duration': 4.403}, {'end': 27857.022, 'text': "And that's a huge boost.", 'start': 27856.082, 'duration': 0.94}, {'end': 27859.464, 'text': "Let's analyze the complexity here.", 'start': 27858.083, 'duration': 1.381}, {'end': 27863.787, 'text': "Let's look at the complexity.", 'start': 27861.886, 'duration': 1.901}], 'summary': 'Finding longest common subsequence took 480ms, improved to 0.234ms, 2000 times faster.', 'duration': 31.419, 'max_score': 27832.368, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA27832368.jpg'}, {'end': 28032.538, 'src': 'embed', 'start': 28002.266, 'weight': 0, 'content': [{'end': 28004.907, 'text': 'And similarly, this entire tree of computation gets eliminated.', 'start': 28002.266, 'duration': 2.641}, {'end': 28006.168, 'text': 'We are eliminating.', 'start': 28004.927, 'duration': 1.241}, {'end': 28013.477, 'text': 'from 1 billion computations, almost all except 225 computations.', 'start': 28007.268, 'duration': 6.209}, {'end': 28014.919, 'text': "So we're left with practically nothing.", 'start': 28013.497, 'duration': 1.422}, {'end': 28018.083, 'text': 'And that speeds up your algorithm by a huge, huge factor.', 'start': 28015.439, 'duration': 2.644}, {'end': 28020.855, 'text': "So that's memorization.", 'start': 28019.895, 'duration': 0.96}, {'end': 28026.776, 'text': "And, as he said, it's really easy to compute the time.", 'start': 28021.895, 'duration': 4.881}, {'end': 28027.997, 'text': 'complexity of memorization.', 'start': 28026.776, 'duration': 1.221}, {'end': 28032.538, 'text': 'just simply count the number of keys and then just track.', 'start': 28027.997, 'duration': 4.541}], 'summary': 'Memorization reduces 1 billion computations to 225, speeding up algorithm significantly.', 'duration': 30.272, 'max_score': 28002.266, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA28002266.jpg'}], 'start': 27004.379, 'title': 'Algorithm optimization', 'summary': 'Discusses testing lcs recursive function, analyzing complexity of common subsequence algorithm, and optimizing algorithms with memoization, reducing time complexity by 2000 times.', 'chapters': [{'end': 27050.979, 'start': 27004.379, 'title': 'Testing lcs recursive function', 'summary': 'Discusses evaluating test cases for the lcs recursive function, demonstrating the successful execution of test cases, and highlighting the dynamic nature of python functions.', 'duration': 46.6, 'highlights': ['The chapter discusses evaluating test cases for the LCS recursive function, demonstrating the successful execution of test cases, and highlighting the dynamic nature of Python functions.', 'The function successfully passed multiple test cases, showcasing its effectiveness.', "Python's dynamic nature allows for seamless utilization of functions and methods across different data types, facilitating efficient coding practices."]}, {'end': 27471.919, 'start': 27050.979, 'title': 'Common subsequence complexity analysis', 'summary': 'Discusses the analysis of a recursive algorithm for finding the longest common subsequence, revealing the inefficiency in terms of time complexity, which is exponential, specifically order of 2 to the power of m plus n, where m and n are the lengths of the input sequences. it also highlights the impact of inefficient test cases and the need for algorithm improvement.', 'duration': 420.94, 'highlights': ['The time complexity of the recursive algorithm for finding the longest common subsequence is order of 2 to the power of M plus N, where M and N are the lengths of the input sequences, indicating exponential growth in the number of subproblems and recursive calls.', 'Inefficient test cases can lead to identifying issues in handling specific scenarios, emphasizing the importance of comprehensive and diverse test cases for algorithm validation and error detection.', 'The discussion emphasizes the need for further improvement of the algorithm due to its inefficiency, especially when dealing with longer sequences such as DNA strands, which can result in significantly slower processing times.']}, {'end': 28118.538, 'start': 27484.204, 'title': 'Optimizing algorithms with memoization', 'summary': 'Explains the inefficiency in the recursive algorithm and introduces the technique of memoization to store intermediate results, reducing computation time by 2000 times and lowering the time complexity from 2^m+n to order of m*n, significantly optimizing the algorithm.', 'duration': 634.334, 'highlights': ['The introduction of memoization technique reduces computation time by 2000 times and lowers the time complexity from 2^M+N to order of M*N, significantly optimizing the algorithm.', 'The technique of memoization involves storing intermediate results in a dictionary called memo, preventing the need to recompute the results and eliminating a significant amount of repetition in recursive calls.', "The time taken for finding the longest common subsequence between 'precipitation' and 'serendipitous' reduces from 480 milliseconds to 0.234 milliseconds, a 2000 times speed improvement.", 'The time complexity of the memoization technique is determined by the number of keys in the memo, which in this case is M times N, significantly reducing the number of computations required.', 'The downside of memoization is the overhead of recursive calls for large problems, as each new recursive call takes more space in memory and longer execution time, leading to the introduction of another technique called dynamic programming.']}], 'duration': 1114.159, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA27004379.jpg', 'highlights': ['The introduction of memoization reduces computation time by 2000 times and lowers time complexity to order of M*N.', "The time taken for finding the longest common subsequence between 'precipitation' and 'serendipitous' reduces from 480ms to 0.234ms, a 2000 times speed improvement.", 'The time complexity of the recursive algorithm for finding the longest common subsequence is order of 2^M+N, indicating exponential growth in the number of subproblems and recursive calls.', 'Inefficient test cases can lead to identifying issues in handling specific scenarios, emphasizing the importance of comprehensive and diverse test cases for algorithm validation and error detection.', "Python's dynamic nature allows for seamless utilization of functions and methods across different data types, facilitating efficient coding practices."]}, {'end': 29157.473, 'segs': [{'end': 28159.088, 'src': 'embed', 'start': 28118.598, 'weight': 4, 'content': [{'end': 28119.939, 'text': 'And that can eat up a lot of memory.', 'start': 28118.598, 'duration': 1.341}, {'end': 28123.482, 'text': 'And sometimes that can also take up a take longer time.', 'start': 28120.039, 'duration': 3.443}, {'end': 28129.247, 'text': 'So the solution to replace recursion is iteration.', 'start': 28125.043, 'duration': 4.204}, {'end': 28133.21, 'text': 'And how do we do that? We do that using a technique called dynamic programming.', 'start': 28129.987, 'duration': 3.223}, {'end': 28135.832, 'text': "So we'll do almost the same thing.", 'start': 28133.97, 'duration': 1.862}, {'end': 28136.933, 'text': 'There are a few changes here.', 'start': 28135.872, 'duration': 1.061}, {'end': 28148.082, 'text': 'Instead of using a dictionary to track intermediate results, we will create a matrix, because we know that sequence one, the IDX one,', 'start': 28138.157, 'duration': 9.925}, {'end': 28151.824, 'text': 'can go from zero to N or zero to N one.', 'start': 28148.082, 'duration': 3.742}, {'end': 28159.088, 'text': "Let's say where N one is the length of sequence one and sequence IDX two can go from zero to N two where N two is the length of sequence two.", 'start': 28151.924, 'duration': 7.164}], 'summary': 'Replace recursion with iteration using dynamic programming and matrices for tracking intermediate results.', 'duration': 40.49, 'max_score': 28118.598, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA28118598.jpg'}, {'end': 28233.025, 'src': 'embed', 'start': 28204.336, 'weight': 6, 'content': [{'end': 28211.963, 'text': 'so you can see these are n two columns and there is an additional column here and table of i and j.', 'start': 28204.336, 'duration': 7.627}, {'end': 28214.546, 'text': "so let's say table of uh, if i and j are zero.", 'start': 28211.963, 'duration': 2.583}, {'end': 28219.812, 'text': 'so i is a pointer for The first sequence and J is a pointer for the second sequence.', 'start': 28214.546, 'duration': 5.266}, {'end': 28223.115, 'text': 'So I selects a row and J selects the column.', 'start': 28219.852, 'duration': 3.263}, {'end': 28233.025, 'text': 'So table of I and J represents the longest common subsequence of sequence one up to I, which means sequence one.', 'start': 28223.515, 'duration': 9.51}], 'summary': 'Explaining a table with pointers i and j for finding longest common subsequence.', 'duration': 28.689, 'max_score': 28204.336, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA28204336.jpg'}, {'end': 28319.731, 'src': 'embed', 'start': 28263.204, 'weight': 0, 'content': [{'end': 28266.746, 'text': 'So table one and table IJ represents the longest common subsequence of.', 'start': 28263.204, 'duration': 3.542}, {'end': 28271.469, 'text': 'these two of just a and t, which is zero.', 'start': 28268.527, 'duration': 2.942}, {'end': 28279.656, 'text': "on the other hand, if we skip ahead a little bit, if we skip ahead to, let's say, this position, you can count here i goes zero, one, two, three,", 'start': 28271.469, 'duration': 8.187}, {'end': 28281.778, 'text': 'four, five, six.', 'start': 28279.656, 'duration': 2.122}, {'end': 28289.844, 'text': 'so this is six here and here we have zero, one, zero, one, two, three.', 'start': 28281.778, 'duration': 8.066}, {'end': 28290.565, 'text': 'so this is so.', 'start': 28289.844, 'duration': 0.721}, {'end': 28293.227, 'text': 'this is table of six, comma three.', 'start': 28290.565, 'duration': 2.662}, {'end': 28307.299, 'text': 'the table of six, comma three takes the first six elements, which is TA, GTCA, and the first three elements, AGA of sequence two,', 'start': 28293.227, 'duration': 14.072}, {'end': 28311.561, 'text': 'and it stores the result of the longest common subsequence between these two.', 'start': 28307.299, 'duration': 4.262}, {'end': 28319.731, 'text': "Okay So I'll just let you look at the table and maybe even draw the table on a piece of paper and verify that the length three is right.", 'start': 28312.568, 'duration': 7.163}], 'summary': 'The longest common subsequence between two sequences is 3.', 'duration': 56.527, 'max_score': 28263.204, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA28263204.jpg'}, {'end': 28567.192, 'src': 'embed', 'start': 28537.221, 'weight': 1, 'content': [{'end': 28542.584, 'text': "If they're unequal, then we take the maximum of the element above it and the element to the left of it.", 'start': 28537.221, 'duration': 5.363}, {'end': 28544.505, 'text': 'And that way we fill out the entire table.', 'start': 28542.684, 'duration': 1.821}, {'end': 28547.426, 'text': "Okay So that's the dynamic programming solution.", 'start': 28544.905, 'duration': 2.521}, {'end': 28550.368, 'text': 'And I know this can seem a little bit complicated.', 'start': 28548.367, 'duration': 2.001}, {'end': 28552.289, 'text': 'Honestly, I still get.', 'start': 28550.948, 'duration': 1.341}, {'end': 28555.609, 'text': 'confused with dynamic programming a lot of times.', 'start': 28553.669, 'duration': 1.94}, {'end': 28559.89, 'text': "And that's why I like to just draw tables and write things out carefully.", 'start': 28555.649, 'duration': 4.241}, {'end': 28567.192, 'text': 'Okay. And and especially, you have to be specially careful with indices,', 'start': 28562.731, 'duration': 4.461}], 'summary': 'Dynamic programming solution fills table with max of element above or to the left. care needed with indices.', 'duration': 29.971, 'max_score': 28537.221, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA28537221.jpg'}, {'end': 28619.664, 'src': 'embed', 'start': 28588.476, 'weight': 2, 'content': [{'end': 28594.738, 'text': "So we'll just say DP here and we have sequence one and we have sequence two.", 'start': 28588.476, 'duration': 6.262}, {'end': 28600.52, 'text': 'And the first thing we need is we need a table of results.', 'start': 28598.119, 'duration': 2.401}, {'end': 28605.362, 'text': "Now this table for it, let's just grab N one and N two.", 'start': 28601.22, 'duration': 4.142}, {'end': 28611.524, 'text': 'So length of sequence one and length of sequence two.', 'start': 28605.502, 'duration': 6.022}, {'end': 28617.04, 'text': 'And now we need to create a table with all zeros.', 'start': 28615.157, 'duration': 1.883}, {'end': 28619.664, 'text': 'How do you create a table with all zeros?', 'start': 28618.182, 'duration': 1.482}], 'summary': 'Creating a table with all zeros for dp algorithm implementation.', 'duration': 31.188, 'max_score': 28588.476, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA28588476.jpg'}, {'end': 28899.452, 'src': 'embed', 'start': 28875.623, 'weight': 11, 'content': [{'end': 28883.175, 'text': "Oh, that's because remember we need an additional row and an additional column to track the case where either of the strings is empty.", 'start': 28875.623, 'duration': 7.552}, {'end': 28890.206, 'text': 'So we need to get range and two plus one here, and we need to get range and one plus one here.', 'start': 28884.056, 'duration': 6.15}, {'end': 28894.389, 'text': "Okay And that's why it helps to have test cases so that you can fix all of these issues.", 'start': 28890.646, 'duration': 3.743}, {'end': 28899.452, 'text': 'Now you have test case zero, it passes and test case one, two, three, all of them pass.', 'start': 28895.009, 'duration': 4.443}], 'summary': 'Additional row and column needed for empty strings. test cases 0, 1, 2, 3 passed.', 'duration': 23.829, 'max_score': 28875.623, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA28875623.jpg'}, {'end': 28949.609, 'src': 'embed', 'start': 28917.049, 'weight': 9, 'content': [{'end': 28921.371, 'text': 'Sometimes just working with indices within the table can get confusing.', 'start': 28917.049, 'duration': 4.322}, {'end': 28927.292, 'text': 'So it helps to work with it on paper and make it clear to yourself and then write it in English.', 'start': 28921.931, 'duration': 5.361}, {'end': 28929.513, 'text': "That's why we've written it in plain English here.", 'start': 28927.552, 'duration': 1.961}, {'end': 28937.587, 'text': 'And now an exercise for you is to verify that the complexity of this dynamic programming approach is order of N1 times N2.', 'start': 28931.826, 'duration': 5.761}, {'end': 28940.748, 'text': 'So, which is the same as memoization.', 'start': 28937.747, 'duration': 3.001}, {'end': 28949.609, 'text': "And it's actually more straightforward to see here, because you have two for loops and then each of these for loops.", 'start': 28941.728, 'duration': 7.881}], 'summary': 'Working with table indices can be confusing, but using plain english and exercise can help understand the complexity of the dynamic programming approach.', 'duration': 32.56, 'max_score': 28917.049, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA28917049.jpg'}, {'end': 29093.007, 'src': 'embed', 'start': 29050.635, 'weight': 7, 'content': [{'end': 29053.697, 'text': 'And we then filled out the entire table and we simply use the last value.', 'start': 29050.635, 'duration': 3.062}, {'end': 29058.98, 'text': 'Now, again, this is not very straightforward, how to come up with this.', 'start': 29054.557, 'duration': 4.423}, {'end': 29061.801, 'text': 'And the way you do that is by solving problems.', 'start': 29059.2, 'duration': 2.601}, {'end': 29067.845, 'text': 'If you solve five to 10 dynamic programming problems, you will get some intuition about how to build the tables.', 'start': 29061.862, 'duration': 5.983}, {'end': 29074.709, 'text': "And it's always very helpful to solve it on pen and paper first, especially with dynamic programming so that it's clear to you.", 'start': 29068.285, 'duration': 6.424}, {'end': 29078.612, 'text': 'what each element of the table represents.', 'start': 29076.528, 'duration': 2.084}, {'end': 29086.067, 'text': 'Otherwise you may make a lot of off by one errors, like missing the plus one here or missing the plus one here and get confused.', 'start': 29079.093, 'duration': 6.974}, {'end': 29087.67, 'text': 'Just like I did pretty much.', 'start': 29086.568, 'duration': 1.102}, {'end': 29093.007, 'text': "And that's the time, the time complexity is pretty straightforward.", 'start': 29090.646, 'duration': 2.361}], 'summary': 'Solving 5-10 dynamic programming problems provides intuition on building tables, preventing errors and confusion.', 'duration': 42.372, 'max_score': 29050.635, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA29050635.jpg'}], 'start': 28118.598, 'title': 'Dynamic programming basics and logic for memory optimization', 'summary': 'Covers the basics of dynamic programming and its efficiency, emphasizing the replacement of recursion with iteration using dynamic programming, illustrated with the example of creating a table to find the longest common subsequence between two strings. it also explains the dynamic programming logic for finding the longest common subsequence between two given sequences by comparing elements, filling out a table, and returning the bottom right element as the result.', 'chapters': [{'end': 28418.612, 'start': 28118.598, 'title': 'Dynamic programming for memory optimization', 'summary': 'Explains replacing recursion with iteration using dynamic programming, illustrated with the example of creating a table to find the longest common subsequence between two strings.', 'duration': 300.014, 'highlights': ['Using dynamic programming to replace recursion with iteration for memory optimization.', 'Illustrating the use of a matrix to track intermediate results instead of a dictionary.', 'Creating a table to find the longest common subsequence between two strings, achieving a time complexity of O(N1*N2) without recursion.']}, {'end': 28833.1, 'start': 28418.612, 'title': 'Dynamic programming logic for longest common subsequence', 'summary': 'Explains the dynamic programming solution for finding the longest common subsequence between two given sequences by comparing elements, filling out a table, and returning the bottom right element as the result.', 'duration': 414.488, 'highlights': ['The chapter explains the dynamic programming solution for finding the longest common subsequence between two given sequences by comparing elements, filling out a table, and returning the bottom right element as the result.', 'The solution involves filling out a table by comparing if the two elements are equal, adding one to the diagonally top left element if they are, and taking the maximum of the element above it and the element to the left of it if they are unequal.', 'The process starts by creating a table with all zeros and then iterating through the elements of the sequences to compare and fill out the table accordingly.', 'The final step involves returning the bottom right element of the table as the result for the longest common subsequence.']}, {'end': 29157.473, 'start': 28846.44, 'title': 'Dynamic programming basics', 'summary': 'Covers the basics of dynamic programming, including the process of solving problems, the comparison between dynamic programming and memoization, and the importance of working on pen and paper before coding. it also emphasizes the significance of test cases and the efficiency of dynamic programming in terms of time complexity.', 'duration': 311.033, 'highlights': ['The chapter covers the basics of dynamic programming, including the process of solving problems', 'the efficiency of dynamic programming in terms of time complexity', 'the comparison between dynamic programming and memoization', 'the importance of working on pen and paper before coding', 'the significance of test cases']}], 'duration': 1038.875, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA28118598.jpg', 'highlights': ['Creating a table to find the longest common subsequence between two strings, achieving a time complexity of O(N1*N2) without recursion.', 'The solution involves filling out a table by comparing if the two elements are equal, adding one to the diagonally top left element if they are, and taking the maximum of the element above it and the element to the left of it if they are unequal.', 'The process starts by creating a table with all zeros and then iterating through the elements of the sequences to compare and fill out the table accordingly.', 'The final step involves returning the bottom right element of the table as the result for the longest common subsequence.', 'Using dynamic programming to replace recursion with iteration for memory optimization.', 'Illustrating the use of a matrix to track intermediate results instead of a dictionary.', 'The chapter explains the dynamic programming solution for finding the longest common subsequence between two given sequences by comparing elements, filling out a table, and returning the bottom right element as the result.', 'The chapter covers the basics of dynamic programming, including the process of solving problems', 'the efficiency of dynamic programming in terms of time complexity', 'the comparison between dynamic programming and memoization', 'the importance of working on pen and paper before coding', 'the significance of test cases']}, {'end': 31799.396, 'segs': [{'end': 29215.6, 'src': 'embed', 'start': 29185.323, 'weight': 4, 'content': [{'end': 29186.944, 'text': "It's also called a zero one knapsack problem.", 'start': 29185.323, 'duration': 1.621}, {'end': 29194.749, 'text': "Here's there are many variations of this problem, but here's one way to state it that you might come across or something similar.", 'start': 29187.465, 'duration': 7.284}, {'end': 29199.912, 'text': 'You are in charge of selecting a football or a soccer team from a large pool of players.', 'start': 29194.969, 'duration': 4.943}, {'end': 29204.155, 'text': 'And each player has a cost and a rating.', 'start': 29201.313, 'duration': 2.842}, {'end': 29206.777, 'text': "So there's a selection going on.", 'start': 29204.735, 'duration': 2.042}, {'end': 29208.658, 'text': 'You have to come up with a team for this year.', 'start': 29206.837, 'duration': 1.821}, {'end': 29211.149, 'text': 'and you have a large pool of players.', 'start': 29209.966, 'duration': 1.183}, {'end': 29213.575, 'text': 'Each player has a cost and each player has a rating.', 'start': 29211.269, 'duration': 2.306}, {'end': 29215.6, 'text': 'Now you have a limited budget.', 'start': 29213.595, 'duration': 2.005}], 'summary': 'Solve a knapsack problem to select a team with limited budget and player ratings.', 'duration': 30.277, 'max_score': 29185.323, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA29185323.jpg'}, {'end': 30328.914, 'src': 'embed', 'start': 30303.691, 'weight': 0, 'content': [{'end': 30309.152, 'text': 'And now you can reason the complexity very easily because now we have N elements for each one, we keep making this choice.', 'start': 30303.691, 'duration': 5.461}, {'end': 30312.113, 'text': 'So that means we end up with two to the power N leaves.', 'start': 30309.552, 'duration': 2.561}, {'end': 30319.114, 'text': 'And from there it follows that the complexity of the recursive algorithm is order of two to the power N, right?', 'start': 30313.273, 'duration': 5.841}, {'end': 30327.114, 'text': "So it could be two times, or C times two to the power N, but, uh, And in the bigger notation it's order of two to the power of N.", 'start': 30319.134, 'duration': 7.98}, {'end': 30328.914, 'text': 'So it is exponential and complexity.', 'start': 30327.114, 'duration': 1.8}], 'summary': 'The complexity of the recursive algorithm is o(2^n), making it exponential.', 'duration': 25.223, 'max_score': 30303.691, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA30303691.jpg'}, {'end': 30466.027, 'src': 'embed', 'start': 30422.819, 'weight': 1, 'content': [{'end': 30429.623, 'text': "And what we'll do is we will go ahead and we will implement the dynamic programming solution.", 'start': 30422.819, 'duration': 6.804}, {'end': 30435.226, 'text': "So let's just come at our work once again, and we've analyzed the algorithms complexity in recursion.", 'start': 30430.123, 'duration': 5.103}, {'end': 30441.01, 'text': "It's order two to the power of N in memoization.", 'start': 30435.366, 'duration': 5.644}, {'end': 30442.69, 'text': "Now that's an exercise for you.", 'start': 30441.67, 'duration': 1.02}, {'end': 30446.613, 'text': "What do you think the complexity will be, but let's apply dynamic programming.", 'start': 30442.731, 'duration': 3.882}, {'end': 30448.574, 'text': "So let's look at a dynamic programming solution.", 'start': 30446.653, 'duration': 1.921}, {'end': 30452.745, 'text': 'Now, once again, for dynamic programming, you have to create a table.', 'start': 30449.704, 'duration': 3.041}, {'end': 30456.445, 'text': 'You always, almost always have to create a table for dynamic programming.', 'start': 30453.125, 'duration': 3.32}, {'end': 30462.767, 'text': 'And in this case, we can see that there are N elements.', 'start': 30457.065, 'duration': 5.702}, {'end': 30466.027, 'text': 'So there are N rows within the table because we have N elements to choose from.', 'start': 30462.807, 'duration': 3.22}], 'summary': 'Implementing dynamic programming solution, complexity is order 2^n in memoization, creating a table for n elements.', 'duration': 43.208, 'max_score': 30422.819, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA30422819.jpg'}, {'end': 30953.901, 'src': 'embed', 'start': 30915.343, 'weight': 2, 'content': [{'end': 30925.879, 'text': "It really helps to work it out in paper, but let's say We have max profit DP, the dynamic programming solution.", 'start': 30915.343, 'duration': 10.536}, {'end': 30930.382, 'text': 'We have weights, we have profits and we have a capacity.', 'start': 30926.38, 'duration': 4.002}, {'end': 30935.186, 'text': "And then let's say N is Len weights.", 'start': 30932.864, 'duration': 2.322}, {'end': 30939.108, 'text': 'So we need to create a table.', 'start': 30936.847, 'duration': 2.261}, {'end': 30942.031, 'text': 'So this is our table.', 'start': 30939.128, 'duration': 2.903}, {'end': 30943.932, 'text': 'Our table contains.', 'start': 30942.051, 'duration': 1.881}, {'end': 30946.272, 'text': 'N rows.', 'start': 30945.871, 'duration': 0.401}, {'end': 30953.901, 'text': 'So we have line N and then for each of the rows we contain, we have capacity plus one.', 'start': 30946.592, 'duration': 7.309}], 'summary': 'Using dynamic programming to solve max profit with weights, profits, and capacity.', 'duration': 38.558, 'max_score': 30915.343, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA30915343.jpg'}], 'start': 29158.433, 'title': 'Knapsack problem and recursive solutions', 'summary': 'Discusses the knapsack problem and the zero one knapsack problem, with insights into recursive solutions for maximum profit, including time complexities and challenges to implement memoized and dynamic programming solutions.', 'chapters': [{'end': 29694.115, 'start': 29158.433, 'title': 'Knapsack problem', 'summary': 'Discusses the knapsack problem, specifically the zero one knapsack problem, which involves selecting a team from a pool of players with costs and ratings while staying within a budget, and it emphasizes the systematic strategy for problem-solving.', 'duration': 535.682, 'highlights': ['The knapsack problem entails selecting a team from a pool of players with costs and ratings while staying within a budget, and it emphasizes the systematic strategy for problem-solving.', 'The chapter explains the zero one knapsack problem in the context of maximizing the total rating of a team within a given budget, with variables including rating and cost to be optimized, and introduces a simplifying assumption of no minimum or maximum team size.', 'The problem is stated in more general terms, involving N elements with weights and profits, and the goal is to determine the maximum profit by selecting a subset of elements weighing no more than a given capacity, exemplifying the problem with specific weights, profits, and a capacity of 15.', 'The systematic strategy for problem-solving is emphasized, involving stating the problem clearly, identifying input and output formats, providing example inputs and outputs, and coming up with a correct solution while covering all edge cases.', 'Several example inputs and test cases are listed, covering scenarios where all elements, none of the elements, only one of the elements, or a lower capacity with higher profit are included, and an extension of the problem to identify the chosen elements is suggested.']}, {'end': 30259.791, 'start': 29696.636, 'title': 'Recursive solution for maximum profit', 'summary': 'Explains a recursive function, max profit, to compute the maximum profit that can be obtained using a sequence of elements and a given capacity, with detailed insights into the recursive calls and base cases, demonstrated with a coding example.', 'duration': 563.155, 'highlights': ['The chapter explains the concept of a recursive function, max profit, to compute the maximum profit that can be obtained using a sequence of elements and a given capacity. It provides insights into the recursive calls and base cases, demonstrated with a coding example. (Relevance Score: 5)', 'The recursive function, max profit, takes an index within the sequence and computes the maximum profit that can be obtained using the elements from that index onwards and a given capacity, demonstrating the logic with a coding example. (Relevance Score: 4)', 'The chapter demonstrates the recursive calls and base cases for the max profit function, providing detailed explanations and insights into the decision-making process for including or excluding elements in the knapsack. (Relevance Score: 3)']}, {'end': 30914.782, 'start': 30259.791, 'title': 'Max profit recursive analysis', 'summary': 'Discusses the recursive solution for finding maximum profit, explaining its exponential time complexity of o(2^n), and challenges the audience to implement a memoized version and a dynamic programming solution with time complexity o(n*c).', 'duration': 654.991, 'highlights': ['The recursive solution for finding maximum profit has an exponential time complexity of O(2^N) due to the possibility of creating many subproblems.', 'The audience is challenged to implement a memoized version of the solution by storing computed results in a dictionary and checking for existing values before computation.', 'The chapter introduces the concept of dynamic programming, highlighting the creation of a table to store intermediate results and the time complexity of O(N*C) for the dynamic programming solution.']}, {'end': 31799.396, 'start': 30915.343, 'title': 'Max profit dynamic programming', 'summary': 'Explains the dynamic programming solution for the max profit problem with a detailed walkthrough of creating a table, filling it, and returning the final value, with a time complexity of o(n*w). it also introduces graph algorithms like bfs, dfs, and shortest paths using python.', 'duration': 884.053, 'highlights': ['The chapter explains the dynamic programming solution for the max profit problem with a detailed walkthrough of creating a table, filling it, and returning the final value.', 'The time complexity of the dynamic programming solution is O(N*W).', 'Introduction to graph algorithms like BFS, DFS, and shortest paths using Python.']}], 'duration': 2640.963, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA29158433.jpg', 'highlights': ['The recursive solution for finding maximum profit has an exponential time complexity of O(2^N).', 'The chapter introduces the concept of dynamic programming, highlighting the creation of a table to store intermediate results and the time complexity of O(N*C) for the dynamic programming solution.', 'The chapter explains the dynamic programming solution for the max profit problem with a detailed walkthrough of creating a table, filling it, and returning the final value.', 'The time complexity of the dynamic programming solution is O(N*W).', 'The chapter explains the zero one knapsack problem in the context of maximizing the total rating of a team within a given budget, with variables including rating and cost to be optimized, and introduces a simplifying assumption of no minimum or maximum team size.']}, {'end': 33231.598, 'segs': [{'end': 31854.456, 'src': 'embed', 'start': 31825.303, 'weight': 0, 'content': [{'end': 31830.507, 'text': 'You can see that from this particular course website, we have a link to IBM.', 'start': 31825.303, 'duration': 5.204}, {'end': 31833.748, 'text': 'But from IBM, you may not have a link to this course website.', 'start': 31831.147, 'duration': 2.601}, {'end': 31835.129, 'text': "Now that's an interesting thing.", 'start': 31834.128, 'duration': 1.001}, {'end': 31844.672, 'text': "There's a slight variation here, and this is called a directed graph because each connection here is, has a particular direction.", 'start': 31835.149, 'duration': 9.523}, {'end': 31854.456, 'text': 'Now this is again interesting to ask is there a way to navigate from cs.umass.edu to Ithaka weather?', 'start': 31845.973, 'duration': 8.483}], 'summary': "The course website has a link to ibm, but ibm may not have a link back. it's a directed graph with a one-way connection.", 'duration': 29.153, 'max_score': 31825.303, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA31825303.jpg'}, {'end': 31889.97, 'src': 'embed', 'start': 31867.702, 'weight': 2, 'content': [{'end': 31875.585, 'text': 'And we start with the simplest possible representation where you have certain points or what we will call nodes or vertices.', 'start': 31867.702, 'duration': 7.883}, {'end': 31878.946, 'text': 'So these are two terms that are used for these points.', 'start': 31875.785, 'duration': 3.161}, {'end': 31880.266, 'text': 'So nodes or vertices.', 'start': 31879.106, 'duration': 1.16}, {'end': 31885.268, 'text': 'So a graph has certain nodes or vertices, and just to make things easy.', 'start': 31880.946, 'duration': 4.322}, {'end': 31889.97, 'text': 'These could be cities, or these could be web pages, or these could be something else.', 'start': 31886.368, 'duration': 3.602}], 'summary': 'Introduction to graphs with nodes and vertices.', 'duration': 22.268, 'max_score': 31867.702, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA31867702.jpg'}, {'end': 32207.86, 'src': 'embed', 'start': 32178.604, 'weight': 1, 'content': [{'end': 32183.99, 'text': "Okay And we'll see what, what we mean by paths and neighbors and so on in some time.", 'start': 32178.604, 'duration': 5.386}, {'end': 32194.334, 'text': "but to work with graphs more efficiently, we will represent them using what's called an adjacency list.", 'start': 32185.566, 'duration': 8.768}, {'end': 32196.296, 'text': 'now the name.', 'start': 32194.334, 'duration': 1.962}, {'end': 32198.919, 'text': 'it explains what it contains.', 'start': 32196.296, 'duration': 2.623}, {'end': 32207.86, 'text': 'so the adjacency list contains a list for each node And it contains a list of all the nodes that are adjacent to that node.', 'start': 32198.919, 'duration': 8.941}], 'summary': 'Efficiently represent graphs using adjacency lists containing nodes and their adjacent nodes.', 'duration': 29.256, 'max_score': 32178.604, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA32178604.jpg'}, {'end': 32334.576, 'src': 'embed', 'start': 32298.276, 'weight': 3, 'content': [{'end': 32306.207, 'text': 'Okay So now the obvious next question might be to create a class to represent a graph as an adjacency list in Python.', 'start': 32298.276, 'duration': 7.931}, {'end': 32312.911, 'text': 'Okay, This is again a question that you might get asked a step, or this might be part of another question that you may get asked,', 'start': 32306.227, 'duration': 6.684}, {'end': 32317.834, 'text': "where you're asked to perform a breadth first search or depth first search or find the shortest path.", 'start': 32312.911, 'duration': 4.923}, {'end': 32320.435, 'text': 'The first step you will have to do is define a class for a graph.', 'start': 32317.954, 'duration': 2.481}, {'end': 32325.789, 'text': 'to maintain the information about the graph as the adjacency list.', 'start': 32322.366, 'duration': 3.423}, {'end': 32334.576, 'text': "okay, so here we're creating a class graph and the first thing we'll need inside the graph is a constructor function.", 'start': 32325.789, 'duration': 8.787}], 'summary': 'Creating a class for graph representation in python.', 'duration': 36.3, 'max_score': 32298.276, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA32298276.jpg'}], 'start': 31799.396, 'title': 'Graph representation and navigation', 'summary': 'Covers directed graph concepts for navigating hyperlinks, basics of graph representation with nodes and edges, adjacency list representation, and creating a graph class in python. it emphasizes efficient access to nodes, provides a simple code representation, and demonstrates the creation of a graph object with exercises for adding and removing edges.', 'chapters': [{'end': 31867.282, 'start': 31799.396, 'title': 'Graph navigation and analysis', 'summary': 'Explores the concept of directed graphs and their application in navigating hyperlinks, highlighting the need to find the shortest path between websites.', 'duration': 67.886, 'highlights': ['The concept of directed graphs and their application in navigating hyperlinks is discussed, emphasizing the need to find the shortest path between websites.', 'The example of links on websites forming a directed graph is presented, illustrating the one-way connections between different websites.', 'The need to find the shortest way to navigate from cs.umass.edu to Ithaka weather is emphasized, indicating the focus on determining optimal paths within the directed graph.']}, {'end': 32097.814, 'start': 31867.702, 'title': 'Graph representation basics', 'summary': 'Explains the basics of graph representation, emphasizing the use of nodes, edges, and their numbering, and provides a simple code representation of the graph with 5 nodes and 7 edges.', 'duration': 230.112, 'highlights': ['The representation of a graph includes nodes or vertices, which can be labeled as cities, web pages, or other entities, and edges are simply pairs denoting connections between nodes.', 'Graphs can be represented using two variables: the number of nodes and a list of pairs denoting the edges, and the example provided includes 5 nodes and 7 edges.', 'The numbering of nodes is arbitrary but crucial, spanning from 0 to n-1, facilitating the representation of graphs using data structures like adjacency lists.', 'The code representation of the graph with 5 nodes and 7 edges can accurately convey the structure of the graph to someone without the need for a visual depiction.']}, {'end': 32297.735, 'start': 32097.954, 'title': 'Graph representation with adjacency list', 'summary': 'Explains the concept of representing graphs using an adjacency list, which allows efficient access to nodes and their neighbors, reducing the need for repetitive iterations and providing a convenient way to find connected nodes.', 'duration': 199.781, 'highlights': ['Graphs can be represented using an adjacency list, containing a list for each node with the numbers of adjacent nodes, allowing direct access to connected nodes, reducing the need for repetitive iterations.', 'The adjacency list provides a convenient way to find connected nodes, as it allows direct access to the index within the list, enabling efficient information retrieval.', 'Each edge in the graph appears twice in the adjacency list, once for each of the nodes it connects, ensuring comprehensive representation of all edges.']}, {'end': 32693.545, 'start': 32298.276, 'title': 'Creating a graph class in python', 'summary': 'Covers creating a graph class in python to represent a graph as an adjacency list, highlighting the importance of defining a constructor function and demonstrating how to avoid common bugs when creating a list of empty lists using range and underscore variable naming.', 'duration': 395.269, 'highlights': ['The chapter emphasizes the importance of defining a constructor function in the graph class to maintain the information about the graph as the adjacency list.', 'It explains the process of creating a list of empty lists using range and underscores to avoid unintentional common bugs.', 'The transcript demonstrates the potential issue of using the empty list replication method and the advantage of using range and underscore variable naming in Python for creating a list of empty lists.']}, {'end': 33231.598, 'start': 32694.786, 'title': 'Graph data structure and adjacency list', 'summary': 'Discusses implementing a graph data structure using an adjacency list in python, demonstrating the creation of a list of empty lists, iterating through edges, extracting node values from pairs, creating a pythonic code, creating a graph object, defining a wrapper function, and practicing good programming practice. the adjacency list is printed in a user-friendly format, and exercises to add and remove edges from the graph are provided.', 'duration': 536.812, 'highlights': ['The chapter discusses creating a graph data structure using an adjacency list, demonstrating the creation of a list of empty lists, iterating through edges, extracting node values from pairs, and creating a Pythonic code, which is essential for impressing in interviews or coding challenges.', 'The chapter demonstrates the creation of a graph object by invoking the graph function with the number of nodes and edges. It also discusses the printing of the adjacency list in a user-friendly format using a wrapper function.', 'The chapter provides exercises to add and remove edges from the graph, encouraging practical application of the concepts learned.']}], 'duration': 1432.202, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA31799396.jpg', 'highlights': ['The concept of directed graphs and their application in navigating hyperlinks is discussed, emphasizing the need to find the shortest path between websites.', 'Graphs can be represented using an adjacency list, containing a list for each node with the numbers of adjacent nodes, allowing direct access to connected nodes, reducing the need for repetitive iterations.', 'The representation of a graph includes nodes or vertices, which can be labeled as cities, web pages, or other entities, and edges are simply pairs denoting connections between nodes.', 'The chapter discusses creating a graph data structure using an adjacency list, demonstrating the creation of a list of empty lists, iterating through edges, extracting node values from pairs, and creating a Pythonic code, which is essential for impressing in interviews or coding challenges.', 'The chapter emphasizes the importance of defining a constructor function in the graph class to maintain the information about the graph as the adjacency list.']}, {'end': 34446.555, 'segs': [{'end': 33256.286, 'src': 'embed', 'start': 33232.138, 'weight': 0, 'content': [{'end': 33241.059, 'text': 'Okay, now another common representation for graphs is called the adjacency matrix, which is slightly different from adjacency lists.', 'start': 33232.138, 'duration': 8.921}, {'end': 33246.302, 'text': 'in this case, for example, the same graph here is represented using this matrix.', 'start': 33241.059, 'duration': 5.243}, {'end': 33256.286, 'text': 'so what we do is we create a matrix of size n by n, if n is the number of, if n is the number of nodes in the graph, and then for each node,', 'start': 33246.302, 'duration': 9.984}], 'summary': 'Graphs can be represented using an adjacency matrix of size n by n, where n is the number of nodes in the graph.', 'duration': 24.148, 'max_score': 33232.138, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA33232138.jpg'}, {'end': 33522.112, 'src': 'embed', 'start': 33497.904, 'weight': 1, 'content': [{'end': 33506.811, 'text': 'For instance, if you see, you can go to castle by going this way from Wurzburg to Nuremberg to mention to castle.', 'start': 33497.904, 'duration': 8.907}, {'end': 33509.923, 'text': 'but that would not be the shortest path.', 'start': 33508.502, 'duration': 1.421}, {'end': 33512.925, 'text': 'But binary search this is called breadth first search.', 'start': 33510.243, 'duration': 2.682}, {'end': 33517.968, 'text': "breadth first search will always discover the shortest path, because we're first finding all the nodes at distance one,", 'start': 33512.925, 'duration': 5.043}, {'end': 33522.112, 'text': "and then we're finding all the nodes at distance two, and then we're finding all the nodes at distance three.", 'start': 33517.968, 'duration': 4.144}], 'summary': 'Breadth first search always discovers the shortest path by finding nodes at different distances.', 'duration': 24.208, 'max_score': 33497.904, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA33497904.jpg'}, {'end': 33631.931, 'src': 'embed', 'start': 33605.718, 'weight': 2, 'content': [{'end': 33611.304, 'text': 'No, you always access the first available value.', 'start': 33605.718, 'duration': 5.586}, {'end': 33613.327, 'text': 'okay, you access the first available value.', 'start': 33611.304, 'duration': 2.023}, {'end': 33619.555, 'text': 'in this case, what what is called the value in front, and when you access a value, it gets removed.', 'start': 33613.327, 'duration': 6.228}, {'end': 33621.067, 'text': 'Okay,', 'start': 33620.287, 'duration': 0.78}, {'end': 33625.769, 'text': 'So in this way, you can see that it implements the, the first in first out policy.', 'start': 33621.347, 'duration': 4.422}, {'end': 33631.931, 'text': 'Like if first we NQ one, and then we NQ three, and then we NQ four, and then we want to DQ.', 'start': 33625.989, 'duration': 5.942}], 'summary': 'Illustrates first in first out policy with nq1, nq3, nq4, and dq.', 'duration': 26.213, 'max_score': 33605.718, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA33605718.jpg'}, {'end': 34433.787, 'src': 'embed', 'start': 34406.567, 'weight': 3, 'content': [{'end': 34414.154, 'text': "you can look at the parent of zero, that would be one, And then you can look at the parent of one, that would be three, and we're done.", 'start': 34406.567, 'duration': 7.587}, {'end': 34416.377, 'text': 'So we can walk backwards from the target.', 'start': 34414.394, 'duration': 1.983}, {'end': 34421.143, 'text': 'We can keep checking the parent after parent of the target, and that will give us the entire path.', 'start': 34416.437, 'duration': 4.706}, {'end': 34427.491, 'text': 'So now we have the path, we have the distance and we have the order in which these nodes will be visited.', 'start': 34421.804, 'duration': 5.687}, {'end': 34433.787, 'text': 'So you may get asked bread for search in all these different variations, but roughly this is what the code looks like.', 'start': 34428.464, 'duration': 5.323}], 'summary': 'The code finds the path, distance, and order for a search algorithm.', 'duration': 27.22, 'max_score': 34406.567, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA34406567.jpg'}], 'start': 33232.138, 'title': 'Graph representation and breadth first search', 'summary': 'Discusses the representation of graphs using adjacency matrices, involving creating a matrix of size n by n, and the concept of using adjacency matrices in graph algorithms, focusing on breadth first search. it also explains the concept of breadth first search in graphs using cities in germany as an example, demonstrates implementing breadth first search in python, and explains the concept of queues and their usage in implementing the first-in-first-out policy for breadth-first search algorithm using python.', 'chapters': [{'end': 33384.349, 'start': 33232.138, 'title': 'Adjacency matrix representation', 'summary': 'Discusses the representation of graphs using adjacency matrices, which involves creating a matrix of size n by n, where n is the number of nodes, and representing edges between nodes with ones and zeros. it also introduces the concept of using adjacency matrices in graph algorithms, focusing on breadth first search.', 'duration': 152.211, 'highlights': ['The chapter discusses the representation of graphs using adjacency matrices, which involves creating a matrix of size n by n, where n is the number of nodes, and representing edges between nodes with ones and zeros. It also introduces the concept of using adjacency matrices in graph algorithms, focusing on breadth first search.', 'Adjacency matrices are a common representation for graphs, involving the creation of a matrix of size n by n, where n is the number of nodes, and the use of ones and zeros to represent edges between nodes. This can be useful for quickly checking for edges between vertices, as opposed to searching through lists in adjacency lists.']}, {'end': 33586.408, 'start': 33384.589, 'title': 'Breadth first search in graphs', 'summary': 'Explains the concept of breadth first search in graphs using cities in germany as an example, demonstrating how to find the shortest path from a source node, and provides pseudo code for implementing breadth first search in python.', 'duration': 201.819, 'highlights': ['Breadth First Search (BFS) is demonstrated using cities in Germany, showing the process of finding the shortest path from a source node.', 'Pseudo code for implementing breadth first search in Python is provided, along with a clear explanation of the approach.', 'The importance of understanding the shortest path between nodes in a graph and the application of BFS to find it is emphasized.']}, {'end': 34171.123, 'start': 33587.349, 'title': 'Understanding queues and implementing breadth first search', 'summary': 'Explains the concept of queues, their usage in implementing the first-in-first-out policy, and demonstrates the implementation of breadth-first search algorithm using python, with a detailed explanation of the process and the data structures involved.', 'duration': 583.774, 'highlights': ['Queues implement the first-in-first-out policy, where elements are inserted at the end and accessed from the front, demonstrating the NQ and DQ operations with examples.', 'The process of implementing breadth-first search (BFS) involves marking the root node as discovered, enqueuing it, and then dequeuing elements in a manner that allows for the exploration of connected nodes at increasing distances.', 'The Python implementation of BFS involves setting up a queue, marking nodes as discovered, enqueuing nodes, and dequeuing elements to explore the graph in a breadth-first manner.']}, {'end': 34446.555, 'start': 34171.643, 'title': 'Breadth-first search algorithm', 'summary': 'Explains the implementation of the breadth-first search algorithm, covering the tracking of distances and parents for each node, with the resulting code being approximately 12 to 15 lines long.', 'duration': 274.912, 'highlights': ['The chapter explains the tracking of distances for each node, where the root node is at a distance of zero from itself, and subsequent nodes are at a distance one more than the node that caused their discovery.', 'It details the tracking of parents for each node, facilitating the ability to find a path from a target node back to the root node.', "The algorithm's implementation is succinct, requiring approximately 12 to 15 lines of code and creating additional lists that are not necessary."]}], 'duration': 1214.417, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA33232138.jpg', 'highlights': ['Adjacency matrices represent graphs using a matrix of size n by n with ones and zeros.', 'Breadth First Search (BFS) is demonstrated using cities in Germany to find the shortest path.', 'Queues implement the first-in-first-out policy, enqueuing and dequeuing elements.', 'Tracking distances and parents for each node facilitates path finding and exploration.']}, {'end': 35944.278, 'segs': [{'end': 34538.162, 'src': 'embed', 'start': 34514.174, 'weight': 2, 'content': [{'end': 34521.58, 'text': 'right, so can you use breadth first search to determine if all the nodes in a graph are connected?', 'start': 34514.174, 'duration': 7.406}, {'end': 34523.021, 'text': 'i would reckon yes.', 'start': 34521.58, 'duration': 1.441}, {'end': 34524.943, 'text': 'look at this queue now.', 'start': 34523.021, 'duration': 1.922}, {'end': 34534.881, 'text': 'this queue gives you all the nodes that, starting from the source node, are connected to the source node by zero, one, two, three or so many steps.', 'start': 34524.943, 'duration': 9.938}, {'end': 34538.162, 'text': 'If something is not connected, it will not show up in the queue.', 'start': 34535.682, 'duration': 2.48}], 'summary': 'Breadth first search can determine if all nodes in a graph are connected by showing connected nodes in the queue.', 'duration': 23.988, 'max_score': 34514.174, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA34514174.jpg'}, {'end': 34607.082, 'src': 'embed', 'start': 34579.741, 'weight': 5, 'content': [{'end': 34586.344, 'text': 'you can check by drawing the graph, and then this would be one connected component and then these would form one connected component.', 'start': 34579.741, 'duration': 6.603}, {'end': 34591.706, 'text': 'so zero, one, two, three would be one connected component, four, five, six would be another and seven, eight would be another.', 'start': 34586.344, 'duration': 5.362}, {'end': 34595.149, 'text': 'can you find the number of connected components?', 'start': 34592.486, 'duration': 2.663}, {'end': 34599.954, 'text': 'or even can you list all the connected components of a graph using bfs?', 'start': 34595.149, 'duration': 4.805}, {'end': 34601.836, 'text': 'yes, you can again.', 'start': 34599.954, 'duration': 1.882}, {'end': 34607.082, 'text': 'a very simple way to do it is just pick the first node, perform bfs from the first node.', 'start': 34601.836, 'duration': 5.246}], 'summary': 'The graph has 3 connected components, with specific nodes in each component.', 'duration': 27.341, 'max_score': 34579.741, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA34579741.jpg'}, {'end': 34870.376, 'src': 'embed', 'start': 34844.245, 'weight': 4, 'content': [{'end': 34852.151, 'text': 'so you can see how depth first search is working using a stack, and roughly this is what the procedure, the process looks like.', 'start': 34844.245, 'duration': 7.906}, {'end': 34853.191, 'text': 'you start a stack.', 'start': 34852.151, 'duration': 1.04}, {'end': 34854.932, 'text': "it's empty.", 'start': 34853.191, 'duration': 1.741}, {'end': 34861.66, 'text': "push. push the current source, let's say the root node which we were starting with.", 'start': 34854.932, 'duration': 6.728}, {'end': 34862.762, 'text': 'put the root into the stack.', 'start': 34861.66, 'duration': 1.102}, {'end': 34865.868, 'text': 'Now, while the stack is not empty, pop the stack.', 'start': 34863.223, 'duration': 2.645}, {'end': 34870.376, 'text': 'So get the last in value from the stack and that gets removed as soon as we call pop.', 'start': 34865.928, 'duration': 4.448}], 'summary': 'Dfs uses a stack to process nodes, pushing the root and popping until empty.', 'duration': 26.131, 'max_score': 34844.245, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA34844245.jpg'}, {'end': 35349.89, 'src': 'embed', 'start': 35318.976, 'weight': 1, 'content': [{'end': 35322.397, 'text': "Okay That's an exercise for you.", 'start': 35318.976, 'duration': 3.421}, {'end': 35328.934, 'text': 'Another exercise that you can try is to write a function to detect a cycle in a graph.', 'start': 35323.789, 'duration': 5.145}, {'end': 35330.355, 'text': "Now, when you're performing DFS.", 'start': 35328.994, 'duration': 1.361}, {'end': 35339.504, 'text': "let's say you are going about performing DFS, starting at one and you do this and then you end up here back at one.", 'start': 35330.355, 'duration': 9.149}, {'end': 35341.325, 'text': 'right?. Because you go to from one to two.', 'start': 35339.504, 'duration': 1.821}, {'end': 35349.89, 'text': 'two to zero, and when you notice that zero points to one which is already visited, that gives you an indication that there is a cycle in the graph.', 'start': 35341.966, 'duration': 7.924}], 'summary': 'Write a function to detect a cycle in a graph using dfs.', 'duration': 30.914, 'max_score': 35318.976, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA35318976.jpg'}, {'end': 35443.21, 'src': 'embed', 'start': 35415.788, 'weight': 3, 'content': [{'end': 35421.251, 'text': 'or this could represent any other information which is of value to you, right?', 'start': 35415.788, 'duration': 5.463}, {'end': 35423.353, 'text': 'so you decide what edge weights are, what they mean.', 'start': 35421.251, 'duration': 2.102}, {'end': 35426.755, 'text': 'in the abstract representation we simply call them weights.', 'start': 35424.253, 'duration': 2.502}, {'end': 35432.38, 'text': 'so this is a weighted graph, and here is an example of how we can convey the information about a weighted graph.', 'start': 35426.755, 'duration': 5.625}, {'end': 35435.623, 'text': 'i can give you the number of nodes and then i can give you a list of edges.', 'start': 35432.38, 'duration': 3.243}, {'end': 35443.21, 'text': 'so the first two elements of each edge tell you which nodes are connected, like the nodes 0 and 1 are connected here.', 'start': 35435.623, 'duration': 7.587}], 'summary': 'Weighted graph representation with example of conveying information.', 'duration': 27.422, 'max_score': 35415.788, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA35415788.jpg'}, {'end': 35522.221, 'src': 'embed', 'start': 35495.7, 'weight': 6, 'content': [{'end': 35500.384, 'text': 'Now directed graphs can be represented just the same way as undirected graphs.', 'start': 35495.7, 'duration': 4.684}, {'end': 35507.83, 'text': 'All we need to do is we need to provide some information that this is a directed graph, right? So you can simply say, uh, directed equals true.', 'start': 35500.764, 'duration': 7.066}, {'end': 35512.634, 'text': 'And that will simply, and once you provide all these, all this information,', 'start': 35509.251, 'duration': 3.383}, {'end': 35517.598, 'text': 'that can then specify to the person who is going through this data that this is a directed graph, right?', 'start': 35512.634, 'duration': 4.964}, {'end': 35519.116, 'text': "Uh so, here's how.", 'start': 35518.234, 'duration': 0.882}, {'end': 35522.221, 'text': "it's exactly the same as a normal undirected graph.", 'start': 35519.116, 'duration': 3.105}], 'summary': "Directed graphs can be represented like undirected graphs by providing 'directed=true' to specify it as a directed graph.", 'duration': 26.521, 'max_score': 35495.7, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA35495700.jpg'}, {'end': 35579.769, 'src': 'embed', 'start': 35552.636, 'weight': 0, 'content': [{'end': 35556.418, 'text': 'And what we can do is we can even combine directed graphs and weighted graphs.', 'start': 35552.636, 'duration': 3.782}, {'end': 35559.572, 'text': "So here's the, here's what we'll do.", 'start': 35557.489, 'duration': 2.083}, {'end': 35564.339, 'text': 'We will define a class which can represent weighted and directed graphs in Python.', 'start': 35560.013, 'duration': 4.326}, {'end': 35569.046, 'text': "So we'll use it to represent undirected graphs, directed graphs, and weighted graphs, all of these.", 'start': 35564.359, 'duration': 4.687}, {'end': 35577.106, 'text': 'and we will take some information in the constructor to capture this detail.', 'start': 35570.598, 'duration': 6.508}, {'end': 35579.769, 'text': "so let's say let's create a class graph.", 'start': 35577.106, 'duration': 2.663}], 'summary': 'Define a python class to represent weighted and directed graphs.', 'duration': 27.133, 'max_score': 35552.636, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA35552636.jpg'}, {'end': 35886.552, 'src': 'embed', 'start': 35861.877, 'weight': 7, 'content': [{'end': 35868.278, 'text': 'a graph with weights or a graph with directed edges, or a graph with both a graph with both weights and directed edges,', 'start': 35861.877, 'duration': 6.401}, {'end': 35869.418, 'text': "which we'll see in just a moment.", 'start': 35868.278, 'duration': 1.14}, {'end': 35874.199, 'text': "Now, one thing that we'll also do here is create a nice representation.", 'start': 35870.879, 'duration': 3.32}, {'end': 35877.26, 'text': "So let's just create a representation here.", 'start': 35874.659, 'duration': 2.601}, {'end': 35885.371, 'text': "Now I'm not going to get into the code of this, but roughly what we want is, while showing the graph, if there is a weight,", 'start': 35879.246, 'duration': 6.125}, {'end': 35886.552, 'text': 'we also want to show the weight.', 'start': 35885.371, 'duration': 1.181}], 'summary': 'Creating a representation for a graph with weights and directed edges.', 'duration': 24.675, 'max_score': 35861.877, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA35861877.jpg'}], 'start': 34448.53, 'title': 'Graph traversal and python class representation', 'summary': 'Covers the application of bfs and dfs algorithms for graph traversal, including connected components and detecting cycles. it also details creating a python class for representing weighted and directed graphs, allowing for various graph representations and storage.', 'chapters': [{'end': 34681.697, 'start': 34448.53, 'title': 'Bfs and dfs in graphs', 'summary': 'Discusses the application of bfs and dfs algorithms in graph traversal, including checking if all nodes in a graph are connected, finding the number of connected components, and listing all connected components. it emphasizes the versatility of bfs in solving graph problems and recommends practicing with bfs problems.', 'duration': 233.167, 'highlights': ['BFS can be used to determine if all nodes in a graph are connected by checking the length of the queue obtained from BFS traversal and comparing it with the total number of nodes.', 'BFS can be used to find the number of connected components in a graph by performing BFS from each unvisited node and counting the connected components.', 'DFS is another approach to graph traversal, similar to exploring a maze, and involves systematically exploring each path until finding a dead end before backtracking and exploring the next path.']}, {'end': 35316.995, 'start': 34681.717, 'title': 'Depth first search and using a stack', 'summary': 'Explains the procedure of implementing depth first search (dfs) using a stack data structure, highlighting the process of pushing and popping nodes, marking them as discovered, and avoiding repetition to traverse a graph in a specific order, with an example of implementing dfs for a given graph.', 'duration': 635.278, 'highlights': ['The chapter explains the procedure of implementing depth first search (DFS) using a stack data structure', 'Highlighting the process of pushing and popping nodes and marking them as discovered', 'Avoiding repetition to traverse a graph in a specific order', 'Example of implementing DFS for a given graph']}, {'end': 35551.715, 'start': 35318.976, 'title': 'Detecting cycles in graphs and handling weighted and directed graphs', 'summary': 'Discusses detecting cycles in graphs using a function and understanding weighted graphs and directed graphs, including how to convey information about weighted and directed graphs and the representation of directed graphs.', 'duration': 232.739, 'highlights': ['Writing a function to detect a cycle in a graph by understanding that a cycle is a path which leads from a node to itself, and a challenge to detect the number of cycles in a graph.', 'Explaining the concept of weighted graphs and demonstrating how to convey information about a weighted graph by providing the number of nodes and a list of edges with associated weights.', 'Introducing the concept of directed graphs and how they can be represented similarly to undirected graphs by providing information that specifies the graph as directed and ensuring the proper representation in the adjacency list.']}, {'end': 35944.278, 'start': 35552.636, 'title': 'Python class for graph representation', 'summary': 'Describes the creation of a python class to represent weighted and directed graphs, allowing for the representation of undirected, directed, and weighted graphs, utilizing a constructor to capture relevant details, and demonstrating the creation of adjacency lists and weight storage.', 'duration': 391.642, 'highlights': ['Creation of Python class to represent weighted and directed graphs', 'Ability to represent undirected, directed, and weighted graphs', 'Utilizing a constructor to capture relevant details', 'Demonstration of creation of adjacency lists and weight storage']}], 'duration': 1495.748, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA34448530.jpg', 'highlights': ['Creation of Python class to represent weighted and directed graphs', 'Writing a function to detect a cycle in a graph', 'BFS can be used to determine if all nodes in a graph are connected', 'Explaining the concept of weighted graphs and demonstrating how to convey information about a weighted graph', 'The chapter explains the procedure of implementing depth first search (DFS) using a stack data structure', 'BFS can be used to find the number of connected components in a graph', 'Introducing the concept of directed graphs and how they can be represented similarly to undirected graphs', 'Ability to represent undirected, directed, and weighted graphs']}, {'end': 39761.855, 'segs': [{'end': 36436.365, 'src': 'embed', 'start': 36408.242, 'weight': 0, 'content': [{'end': 36413.285, 'text': 'we have now represented our graph properly and this is why a representation is really useful,', 'start': 36408.242, 'duration': 5.043}, {'end': 36418.689, 'text': 'because now we can check if our implementation is correct before we go on and implement any graph algorithms.', 'start': 36413.285, 'duration': 5.404}, {'end': 36420.85, 'text': 'we can check if our representation is correct.', 'start': 36418.689, 'duration': 2.161}, {'end': 36421.931, 'text': "let's try one more.", 'start': 36420.85, 'duration': 1.081}, {'end': 36424.373, 'text': 'let us also try this directed graph.', 'start': 36421.931, 'duration': 2.442}, {'end': 36428.076, 'text': "so we're going to grab this code and put it here.", 'start': 36424.373, 'duration': 3.703}, {'end': 36436.365, 'text': "let's call this num nodes three, edges three and directed three.", 'start': 36428.076, 'duration': 8.289}], 'summary': 'Proper graph representation allows for correct algorithm implementation and validation.', 'duration': 28.123, 'max_score': 36408.242, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA36408242.jpg'}, {'end': 36871.984, 'src': 'embed', 'start': 36846.704, 'weight': 5, 'content': [{'end': 36853.053, 'text': 'but suppose there was a direct edge from two to one of weight one, we would get to know that One is at a distance three.', 'start': 36846.704, 'duration': 6.349}, {'end': 36861.518, 'text': 'So each time you add a new node, as you mark a node as visited, you, you update the weights of update the distances of all its neighbors.', 'start': 36853.573, 'duration': 7.945}, {'end': 36866.301, 'text': 'And then you simply find the next node with the smallest distance right?', 'start': 36862.018, 'duration': 4.283}, {'end': 36869.963, 'text': 'So you will find that the next node with the smallest distance in this case is four.', 'start': 36866.621, 'duration': 3.342}, {'end': 36871.984, 'text': 'And then you update the neighbors of four.', 'start': 36870.603, 'duration': 1.381}], 'summary': 'Algorithm updates distances of nodes based on shortest paths', 'duration': 25.28, 'max_score': 36846.704, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA36846704.jpg'}, {'end': 38338.678, 'src': 'embed', 'start': 38311.849, 'weight': 1, 'content': [{'end': 38315.131, 'text': 'So order of N square plus M or N N plus M into N.', 'start': 38311.849, 'duration': 3.282}, {'end': 38319.212, 'text': "So that's, those are some complexities that you will see reported for shortest path.", 'start': 38315.131, 'duration': 4.081}, {'end': 38321.893, 'text': 'And a way to improve this.', 'start': 38320.752, 'duration': 1.141}, {'end': 38326.294, 'text': 'a way to improve the picking of the next node is to use what is called a min heap,', 'start': 38321.893, 'duration': 4.401}, {'end': 38331.436, 'text': "so that you don't have to look through the entire list of nodes each time to pick the next node,", 'start': 38326.294, 'duration': 5.142}, {'end': 38334.597, 'text': 'but you can simply pick the next node in a very short time.', 'start': 38331.436, 'duration': 3.161}, {'end': 38338.678, 'text': "So there's a data structure called a min heap that you can look at.", 'start': 38336.078, 'duration': 2.6}], 'summary': 'Improving shortest path algorithm by using min heap for faster node selection.', 'duration': 26.829, 'max_score': 38311.849, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA38311849.jpg'}, {'end': 38708.911, 'src': 'embed', 'start': 38680.601, 'weight': 2, 'content': [{'end': 38685.506, 'text': "Do check out the previous lessons if you haven't seen them for examples of how to apply it in detail.", 'start': 38680.601, 'duration': 4.905}, {'end': 38696.005, 'text': 'So the step one is to state the problem clearly in your own words and identify the input and output format.', 'start': 38688.021, 'duration': 7.984}, {'end': 38703.248, 'text': 'And then the second step is to come up with some example inputs and outputs and try to cover all the edge cases that you can think of.', 'start': 38696.825, 'duration': 6.423}, {'end': 38708.911, 'text': 'You want to think of all the possible scenarios and that will help you write your code properly.', 'start': 38703.428, 'duration': 5.483}], 'summary': 'Steps for problem-solving: state problem, identify input/output, provide examples, cover edge cases.', 'duration': 28.31, 'max_score': 38680.601, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA38680601.jpg'}, {'end': 38766.775, 'src': 'embed', 'start': 38739.366, 'weight': 3, 'content': [{'end': 38745.088, 'text': 'Then step five is to analyze the algorithms complexity and identify any inefficiencies in the algorithm.', 'start': 38739.366, 'duration': 5.722}, {'end': 38750.81, 'text': 'So what you can do in an interview is come up with the correct solution and describe it to the interviewer,', 'start': 38745.668, 'duration': 5.142}, {'end': 38759.933, 'text': 'and then analyze its complexity directly and start identifying inefficiencies and then move on to apply the right technique to overcome the inefficiency.', 'start': 38750.81, 'duration': 9.123}, {'end': 38763.414, 'text': 'So this is where you need to identify what.', 'start': 38760.313, 'duration': 3.101}, {'end': 38766.775, 'text': "which one of the techniques that you've learned in this course do you need to apply?", 'start': 38763.414, 'duration': 3.361}], 'summary': 'Analyze algorithm complexity, identify inefficiencies, and apply techniques to overcome them in interviews.', 'duration': 27.409, 'max_score': 38739.366, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA38739366.jpg'}, {'end': 38813.902, 'src': 'embed', 'start': 38783.128, 'weight': 4, 'content': [{'end': 38785.29, 'text': 'Is this a graph problem?', 'start': 38783.128, 'duration': 2.162}, {'end': 38787.212, 'text': 'or is this a recursion?', 'start': 38785.29, 'duration': 1.922}, {'end': 38792.016, 'text': 'or Is this a dynamic programming or a memoization problem??', 'start': 38787.212, 'duration': 4.804}, {'end': 38794.056, 'text': 'So all of these things are something that you have to think about.', 'start': 38792.036, 'duration': 2.02}, {'end': 38796.897, 'text': 'And as you practice more and more problems.', 'start': 38794.597, 'duration': 2.3}, {'end': 38802.919, 'text': 'so, for each of the lessons, if you try and practice about five to 10 problems, then you will start to recognize these patterns.', 'start': 38796.897, 'duration': 6.022}, {'end': 38808.66, 'text': "And when you're on step six, when you're trying to come up with the right technique to overcome the inefficiency,", 'start': 38803.119, 'duration': 5.541}, {'end': 38810.461, 'text': 'the ideas will automatically come to you.', 'start': 38808.66, 'duration': 1.801}, {'end': 38813.902, 'text': 'The practice is very important to succeed in step six.', 'start': 38810.961, 'duration': 2.941}], 'summary': 'Practice 5-10 problems per lesson to recognize patterns and succeed in step six.', 'duration': 30.774, 'max_score': 38783.128, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA38783128.jpg'}], 'start': 35944.278, 'title': 'Graph creation and algorithms', 'summary': "Discusses creating graphs with nodes, edges, weights, debugging graph creation code, and implementing dijkstra's algorithm to find the shortest path, emphasizing the importance of graph representation and problem-solving techniques in python interviews.", 'chapters': [{'end': 36373.36, 'start': 35944.278, 'title': 'Graph creation and debugging', 'summary': 'Discusses creating graphs with nodes, edges, weights, and debugging the code for graph creation, specifically focusing on identifying and rectifying issues with the weighted graph representation.', 'duration': 429.082, 'highlights': ['Creating graph one with num nodes, edges, and weighted representation, ensuring the proper functionality of the graph creation process.', 'Identifying and rectifying issues with the weighted graph representation by debugging the code and correcting syntax errors and misnamed variables.', 'Utilizing live coding to demonstrate the process of creating graphs, emphasizing the importance of testing functions during development to prevent errors and ensure functionality.', 'Discussing the significance of Jupiter notebooks in aiding the coding process, highlighting their usefulness in identifying and rectifying mistakes during code development.', 'Exploring the process of graph creation and debugging, illustrating the challenges and importance of thoroughly testing functions to ensure accurate graph representation.']}, {'end': 36910.788, 'start': 36373.88, 'title': 'Graph representation and shortest path', 'summary': "Explains graph representation using nodes and edges with weights, and the implementation of dijkstra's algorithm to find the shortest path in a directed graph, emphasizing the importance of graph representation and the strategy behind dijkstra's algorithm.", 'duration': 536.908, 'highlights': ['The chapter emphasizes the importance of graph representation and its usefulness in checking the correctness of the implementation before proceeding with graph algorithms.', "The implementation of Dijkstra's algorithm for finding the shortest path in a directed graph is explained, emphasizing the strategy of maintaining a set of visited nodes and updating distances of neighbors.", 'The distinction between finding shortest paths with and without weights in a graph is highlighted, emphasizing the usage of breadth-first search for unweighted graphs and the need for more advanced algorithms for weighted graphs.', "The concept of shortest path in terms of total weight and the strategy of Dijkstra's algorithm are explained, with a focus on identifying the shortest path between a given node and target based on total weight."]}, {'end': 37400.903, 'start': 36911.849, 'title': 'Shortest path algorithm', 'summary': 'Explains the shortest path algorithm, which involves marking all nodes as unvisited, assigning tentative distance values, and updating distances of unvisited nodes based on the current node, with the goal of finding the shortest path to a target node.', 'duration': 489.054, 'highlights': ['The algorithm involves marking all nodes as unvisited and creating a set of unvisited nodes, then assigning tentative distance values and setting the initial node as the current node.', 'It calculates tentative distances for unvisited neighbors through the current node, updating distances of unvisited nodes, and marking the current node as visited, removing it from the unvisited set.', 'The process continues by finding the first unvisited node with the smallest distance and repeating the updating process until the target node is visited, completing the algorithm.', 'The algorithm maintains a queue and uses it to keep track of the next element to dequeue, ensuring the target node is not visited and the shortest path is found.']}, {'end': 38497.127, 'start': 37401.603, 'title': "Dijkstra's shortest path algorithm", 'summary': "Introduces dijkstra's shortest path algorithm, explaining the process of updating distances of neighbors, finding the next unvisited node, and determining the complexity of breadth-first search and the shortest path algorithm.", 'duration': 1095.524, 'highlights': ["The chapter introduces Dijkstra's shortest path algorithm, explaining the process of updating distances of neighbors, finding the next unvisited node, and determining the complexity of breadth-first search and the shortest path algorithm.", 'The process of updating distances of all the neighbors involves checking the weight of the edges connecting the current node to its neighbors, comparing the distance for each node, and updating the distance if necessary.', 'The algorithm includes a function called pick next node, which tracks the minimum distance and the unvisited node with the minimum distance, and enqueues the next node if it exists.', 'The chapter explains the complexity of breadth-first search and the shortest path algorithm, highlighting the order of N plus M complexity for breadth-first search and the order of N square plus M or N times M complexity for the shortest path algorithm.', "The concept of using a min heap to improve the Dijkstra's algorithm is introduced, which optimizes the pick next node operation and reduces the complexity from M plus N times N to M plus N times log N."]}, {'end': 38887.209, 'start': 38497.207, 'title': 'Python interview tips & tricks', 'summary': 'Covers python interview tips, tricks, and practical advice for data structures and algorithms, emphasizing the importance of reviewing lectures, completing assignments, participating in forum discussions, and simulating interview scenarios to apply problem-solving techniques.', 'duration': 390.002, 'highlights': ['The importance of reviewing lecture videos, completing assignments, and attempting optional questions and participating in forum discussions is emphasized for learning and earning a certificate of accomplishment.', 'Simulating interview scenarios to apply problem-solving techniques, identify inefficiencies, and determine the right data structures or algorithms is crucial for success in coding assessments or interviews.', 'Practicing about five to 10 problems for each lesson helps in recognizing patterns and developing the ability to overcome inefficiencies by applying the right techniques.', "The systematic strategy for problem-solving includes steps such as stating the problem clearly, providing example inputs and outputs, devising a correct solution, implementing the solution, and analyzing the algorithm's complexity.", 'The course website, pythondsa.com, provides access to all previous lessons, assignments, and the course project for additional learning resources.']}, {'end': 39761.855, 'start': 38888.973, 'title': 'Finding continuous subarray sum', 'summary': 'Discusses the importance of clarifying questions in a coding interview, followed by a detailed explanation of finding a continuous subarray of a given list that adds up to a specific sum. the interview process, problem-solving approach, and coding process are also covered.', 'duration': 872.882, 'highlights': ['The importance of clarifying questions in a coding interview is stressed, as it aids in understanding the problem thoroughly and prevents incorrect implementation.', 'Explanation of finding a continuous subarray of a given list that adds up to a specific sum, along with the process of returning the indices of the subarray.', 'The process of problem-solving is detailed, including the step-by-step approach of restating the problem, defining inputs and outputs, and considering various test cases.', 'The brute force solution for finding the continuous subarray sum is explained, including the problem-solving strategy and the coding process.']}], 'duration': 3817.577, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA35944278.jpg', 'highlights': ['The importance of graph representation and its usefulness in checking the correctness of the implementation before proceeding with graph algorithms.', "The concept of using a min heap to improve the Dijkstra's algorithm is introduced, which optimizes the pick next node operation and reduces the complexity from M plus N times N to M plus N times log N.", "The systematic strategy for problem-solving includes steps such as stating the problem clearly, providing example inputs and outputs, devising a correct solution, implementing the solution, and analyzing the algorithm's complexity.", 'Simulating interview scenarios to apply problem-solving techniques, identify inefficiencies, and determine the right data structures or algorithms is crucial for success in coding assessments or interviews.', 'Practicing about five to 10 problems for each lesson helps in recognizing patterns and developing the ability to overcome inefficiencies by applying the right techniques.', 'The process of updating distances of all the neighbors involves checking the weight of the edges connecting the current node to its neighbors, comparing the distance for each node, and updating the distance if necessary.']}, {'end': 41281.032, 'segs': [{'end': 40079.419, 'src': 'embed', 'start': 40056.215, 'weight': 4, 'content': [{'end': 40066.241, 'text': "Great, You have learned it, but if you're not able to arrive um at the order and cubes at the order and cube complexity for the brute force solution,", 'start': 40056.215, 'duration': 10.026}, {'end': 40070.684, 'text': 'then you probably need a little more practice, because this should become second nature to you.', 'start': 40066.241, 'duration': 4.443}, {'end': 40076.888, 'text': 'Just looking at a problem, identifying the simplest solution, and then finding the complexity of the simplest solution.', 'start': 40071.124, 'duration': 5.764}, {'end': 40079.419, 'text': 'Okay All right.', 'start': 40077.568, 'duration': 1.851}], 'summary': 'Need practice if unable to find order and cube complexity for brute force solution.', 'duration': 23.204, 'max_score': 40056.215, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA40056215.jpg'}, {'end': 40291.85, 'src': 'embed', 'start': 40257.862, 'weight': 2, 'content': [{'end': 40259.843, 'text': "You don't even have to apply any special technique.", 'start': 40257.862, 'duration': 1.981}, {'end': 40263.725, 'text': 'And in this case, we found these couple of optimizations.', 'start': 40261.084, 'duration': 2.641}, {'end': 40264.486, 'text': "So let's apply them.", 'start': 40263.745, 'duration': 0.741}, {'end': 40270.929, 'text': "So what we'll do is we'll define def sub array sum two.", 'start': 40265.206, 'duration': 5.723}, {'end': 40283.346, 'text': 'and here once again we have the array and we have the target, and this time we get the length of the array.', 'start': 40274.682, 'duration': 8.664}, {'end': 40291.85, 'text': 'now, once again i goes from the same value, so i goes from 0 to n minus 1.', 'start': 40283.346, 'duration': 8.504}], 'summary': 'Optimizations found for subarray sum calculation.', 'duration': 33.988, 'max_score': 40257.862, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA40257862.jpg'}, {'end': 40655.332, 'src': 'embed', 'start': 40629.021, 'weight': 0, 'content': [{'end': 40633.184, 'text': 'We are just doing some comparisons and one addition, not up to N additions.', 'start': 40629.021, 'duration': 4.163}, {'end': 40639.348, 'text': 'So the complexity goes from order of N cube to order of N square by maintaining a running sum.', 'start': 40633.725, 'duration': 5.623}, {'end': 40651.469, 'text': 'Great. Now This, at this point, when you have described the solution to the interviewer and maybe also coded it, you might ask them is this good enough?', 'start': 40640.61, 'duration': 10.859}, {'end': 40654.491, 'text': "And they can see that you've X.", 'start': 40651.91, 'duration': 2.581}, {'end': 40655.332, 'text': "you've thought about it.", 'start': 40654.491, 'duration': 0.841}], 'summary': 'Reduced complexity from o(n^3) to o(n^2) by maintaining running sum. ask if good enough with x consideration.', 'duration': 26.311, 'max_score': 40629.021, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA40629021.jpg'}, {'end': 41258.346, 'src': 'embed', 'start': 41232.283, 'weight': 1, 'content': [{'end': 41249.832, 'text': 'So this is a good example of a problem where the step-by-step solution coming up with a simple solution and then thinking about the inefficiency in the problem and then applying in this case just common sense to solve the inefficiency step by step.', 'start': 41232.283, 'duration': 17.549}, {'end': 41255.324, 'text': 'leads to the perfect solution, and a very good solution, in fact.', 'start': 41251.761, 'duration': 3.563}, {'end': 41258.346, 'text': 'so you start out with an order n cube solution.', 'start': 41255.324, 'duration': 3.022}], 'summary': 'Using step-by-step approach, improved from o(n^3) to a very good solution.', 'duration': 26.063, 'max_score': 41232.283, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA41232283.jpg'}], 'start': 39762.316, 'title': 'Code testing and optimization', 'summary': 'Discusses the importance of testing code in interviews, analyzing brute force and array sum solutions, and optimizing subarray sum algorithms, resulting in improved efficiency and accuracy. it includes process demonstrations and complexity analysis.', 'chapters': [{'end': 39968.668, 'start': 39762.316, 'title': 'Testing code in interviews', 'summary': "Discusses the importance of testing code in interviews, demonstrating the process of testing a subarray sum solution with various test cases, ensuring the solution's correctness and building confidence in the interviewer.", 'duration': 206.352, 'highlights': ['Testing code in interviews is crucial for building confidence in the interviewer, and the chapter demonstrates the process of testing a subarray sum solution with various test cases.', 'Demonstrating the correctness of the solution through extensive testing with various test cases, including specific examples like subarray sums with target values and single numbers.', 'Emphasizing the importance of thorough testing to ensure the correctness of the code and gain confidence in the interviewer, even in scenarios where running the code may not be feasible.']}, {'end': 40219.015, 'start': 39968.668, 'title': 'Analyzing brute force solution', 'summary': 'Discusses analyzing the brute force solution for a problem, identifying the complexity, and finding inefficiencies with optimizations, emphasizing the importance of understanding complexity and proposing two optimizations to improve the solution.', 'duration': 250.347, 'highlights': ['The importance of understanding complexity and arriving at the order n cube complexity for the brute force solution is emphasized, serving as a crucial learning milestone.', 'The process of identifying inefficiencies in the solution and proposing optimizations, such as maintaining a running sum and breaking out of the inner loop when the sum exceeds the target value, is explained in detail.', 'Explaining the analysis of the brute force solution, including counting operations in for loops and observing the operations inside the loops, is emphasized as a fundamental step in problem-solving.']}, {'end': 40571.69, 'start': 40219.075, 'title': 'Optimizing subarray sum algorithm', 'summary': 'Discusses two optimizations for the subarray sum algorithm, including an off-by-one error correction and a bug fix for handling the maximum value of j, resulting in improved efficiency and accuracy.', 'duration': 352.615, 'highlights': ['The algorithm discusses the off-by-one error while iterating through the array, emphasizing the importance of handling edge cases, which can significantly impact the final result.', 'A bug fix is implemented to handle the maximum value of J, ensuring that the algorithm appropriately checks for valid array indices, enhancing the accuracy of the subarray sum calculation.', "The chapter emphasizes the value of testing the algorithm with different inputs, highlighting the importance of identifying and rectifying potential bugs to ensure the algorithm's reliability and accuracy."]}, {'end': 41061.879, 'start': 40571.95, 'title': 'Optimizing array sum algorithm', 'summary': 'Discusses the optimization of an array sum algorithm, reducing the time complexity from n^3 to n^2, and the iterative process of finding and refining the solution based on interviewer feedback, with a final algorithm that maintains a running sum to efficiently find subarrays with a sum equal to a target value.', 'duration': 489.929, 'highlights': ['The algorithm complexity is reduced from N^3 to N^2 by maintaining a running sum, showcasing a 1:1.5 improvement in time complexity.', "The iterative process of finding and refining the solution based on interviewer feedback is emphasized, highlighting the importance of testing and analyzing the algorithm's efficiency.", 'The final algorithm efficiently maintains a running sum to find subarrays with a sum equal to a target value, providing an optimized solution to the problem.']}, {'end': 41281.032, 'start': 41062.64, 'title': 'Optimized subarray sum algorithm', 'summary': 'Discusses the implementation and testing of an optimized subarray sum algorithm with detailed analysis of its complexity, which concludes that it is an order n algorithm.', 'duration': 218.392, 'highlights': ['The solution for the subarray sum three is tested with multiple examples, such as input 10 producing output 2,6 and input 19 giving output 3,6.', 'The complexity analysis reveals that the subarray sum three algorithm is finally determined to be an order N algorithm, which is a significant improvement from the initial order n cube solution.', 'The step-by-step process of identifying inefficiencies, applying common sense, and refining the algorithm led to the development of a highly efficient order N solution for the subarray sum problem.']}], 'duration': 1518.716, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA39762316.jpg', 'highlights': ['The algorithm complexity is reduced from N^3 to N^2 by maintaining a running sum, showcasing a 1:1.5 improvement in time complexity.', 'The step-by-step process of identifying inefficiencies, applying common sense, and refining the algorithm led to the development of a highly efficient order N solution for the subarray sum problem.', 'The final algorithm efficiently maintains a running sum to find subarrays with a sum equal to a target value, providing an optimized solution to the problem.', 'The complexity analysis reveals that the subarray sum three algorithm is finally determined to be an order N algorithm, which is a significant improvement from the initial order n cube solution.', 'The importance of understanding complexity and arriving at the order n cube complexity for the brute force solution is emphasized, serving as a crucial learning milestone.']}, {'end': 42434.126, 'segs': [{'end': 41310.777, 'src': 'embed', 'start': 41281.032, 'weight': 0, 'content': [{'end': 41286.715, 'text': "so there's a huge difference between the severity sum one, two and three.", 'start': 41281.032, 'duration': 5.683}, {'end': 41289.937, 'text': 'so where is some three can work instantly for a billion elements.', 'start': 41286.715, 'duration': 3.222}, {'end': 41290.638, 'text': 'so where is some?', 'start': 41289.937, 'duration': 0.701}, {'end': 41299.543, 'text': 'one will take forever, even for a hundred thousand elements, and severity two is in between,', 'start': 41290.638, 'duration': 8.905}, {'end': 41310.777, 'text': 'and you can do the math And this technique where you can almost certainly tell what the next step is.', 'start': 41299.543, 'duration': 11.234}], 'summary': 'Severity 3 can work instantly for a billion elements, while severity 1 will take forever even for a hundred thousand elements, with severity 2 in between.', 'duration': 29.745, 'max_score': 41281.032, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA41281032.jpg'}, {'end': 41394.94, 'src': 'embed', 'start': 41347.553, 'weight': 2, 'content': [{'end': 41351.055, 'text': 'These problems are somewhat tricky, but you get the hang of these problems as well.', 'start': 41347.553, 'duration': 3.502}, {'end': 41356.398, 'text': 'If you search for greedy problems online, you get the hang of these by solving a few practice exercise.', 'start': 41351.155, 'duration': 5.243}, {'end': 41361.12, 'text': "So that's our first interview problem.", 'start': 41358.479, 'duration': 2.641}, {'end': 41366.323, 'text': "And we've solved it in about 45 minutes.", 'start': 41364.341, 'duration': 1.982}, {'end': 41369.745, 'text': 'And this is approximately how long you will have for an interview.', 'start': 41366.723, 'duration': 3.022}, {'end': 41377.252, 'text': 'A typical 45 minute to one hour interview will have about a couple of minutes of introduction, maybe a few minutes,', 'start': 41369.966, 'duration': 7.286}, {'end': 41380.895, 'text': 'just you talking about a project and the interviewer asking you questions,', 'start': 41377.252, 'duration': 3.643}, {'end': 41386.139, 'text': 'but then the next 30 to 40 minutes will be dedicated towards solving a problem.', 'start': 41380.895, 'duration': 5.244}, {'end': 41391.243, 'text': 'And this is what roughly the process will look.', 'start': 41389.542, 'duration': 1.701}, {'end': 41394.94, 'text': "Let's do one more example.", 'start': 41393.72, 'duration': 1.22}], 'summary': 'Solved an interview problem in 45 minutes, typical interview lasts 45-60 minutes with 30-40 minutes dedicated to problem-solving.', 'duration': 47.387, 'max_score': 41347.553, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA41347553.jpg'}, {'end': 41456.61, 'src': 'embed', 'start': 41433.468, 'weight': 1, 'content': [{'end': 41440.919, 'text': 'And the question is given two strings, a and B find the minimum number of steps required to convert a into B.', 'start': 41433.468, 'duration': 7.451}, {'end': 41447.687, 'text': 'So what you can do is you can perform operations and each operation is counted as one step,', 'start': 41442.185, 'duration': 5.502}, {'end': 41456.61, 'text': 'and the operations you can perform on a word are these you can either insert a character into the word or you can delete a character from the word.', 'start': 41447.687, 'duration': 8.923}], 'summary': 'Find minimum steps to convert string a to string b.', 'duration': 23.142, 'max_score': 41433.468, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA41433468.jpg'}, {'end': 41680.014, 'src': 'embed', 'start': 41629.215, 'weight': 5, 'content': [{'end': 41634.118, 'text': 'So just to keep things simple, either make everything uppercase or make everything lowercase.', 'start': 41629.215, 'duration': 4.903}, {'end': 41636.679, 'text': 'But yeah, this is what the input looks like.', 'start': 41635.178, 'duration': 1.501}, {'end': 41640.441, 'text': 'And the output is going to be a single number.', 'start': 41638.44, 'duration': 2.001}, {'end': 41643.863, 'text': 'So the output is simply going to be the edit distance.', 'start': 41641.121, 'duration': 2.742}, {'end': 41648.225, 'text': "So let's just call it output one, and it is going to be the number five.", 'start': 41643.943, 'duration': 4.282}, {'end': 41651.999, 'text': 'And here is something that you can verify.', 'start': 41650.498, 'duration': 1.501}, {'end': 41652.759, 'text': "So that's the input.", 'start': 41652.039, 'duration': 0.72}, {'end': 41656.521, 'text': "That's the output and function signature.", 'start': 41652.779, 'duration': 3.742}, {'end': 41664.826, 'text': 'So of course this term edit distance is how this problem is described, but here there is no edit.', 'start': 41657.582, 'duration': 7.244}, {'end': 41667.167, 'text': "There's no concept of edit distance that's mentioned.", 'start': 41665.206, 'duration': 1.961}, {'end': 41670.549, 'text': 'So you can give a function name that makes sense for this problem.', 'start': 41667.187, 'duration': 3.362}, {'end': 41674.691, 'text': 'So find the minimum number of steps required to convert A to B.', 'start': 41671.289, 'duration': 3.402}, {'end': 41680.014, 'text': "Okay So let's just call it min steps for now.", 'start': 41674.691, 'duration': 5.323}], 'summary': 'Convert input to output using minimum 5 steps', 'duration': 50.799, 'max_score': 41629.215, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA41629215.jpg'}, {'end': 42104.507, 'src': 'embed', 'start': 42076.518, 'weight': 4, 'content': [{'end': 42079.471, 'text': "Okay Now let's look at each case.", 'start': 42076.518, 'duration': 2.953}, {'end': 42086.675, 'text': "The first case is it has, if it is deleted now, the power of the beauty of recursion is that we don't need to guess which solution it is.", 'start': 42079.791, 'duration': 6.884}, {'end': 42090.258, 'text': 'We can try all three recursively and then simply pick the best one.', 'start': 42086.775, 'duration': 3.483}, {'end': 42093.16, 'text': 'So suppose we choose to delete the first character.', 'start': 42090.758, 'duration': 2.402}, {'end': 42096.482, 'text': 'So suppose we say that we are deleting the first character.', 'start': 42094.14, 'duration': 2.342}, {'end': 42102.566, 'text': "Now, what that means is we've performed one operation and we've deleted the first character.", 'start': 42097.743, 'duration': 4.823}, {'end': 42104.507, 'text': "So now what we're left with is this.", 'start': 42102.866, 'duration': 1.641}], 'summary': 'Recursive approach allows trying all solutions and picking the best one.', 'duration': 27.989, 'max_score': 42076.518, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA42076518.jpg'}, {'end': 42192.657, 'src': 'embed', 'start': 42165.921, 'weight': 7, 'content': [{'end': 42171.288, 'text': 'now that these two have become equal, we can move this forward and we can move this forward.', 'start': 42165.921, 'duration': 5.367}, {'end': 42176.03, 'text': 'so now we can simply recursively solve the problem for n tension and execution,', 'start': 42171.288, 'duration': 4.742}, {'end': 42192.657, 'text': 'find the minimum edit distance between the two and simply add one to it to get the number of steps required to change intention to execution by swapping the first character right from i to e.', 'start': 42176.03, 'duration': 16.627}], 'summary': 'Recursive solution for n tension and execution, find minimum edit distance and add one to get steps required to change intention to execution.', 'duration': 26.736, 'max_score': 42165.921, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA42165921.jpg'}, {'end': 42320.537, 'src': 'embed', 'start': 42291.38, 'weight': 9, 'content': [{'end': 42294.802, 'text': "so let's see, let's see if we can define such an end scenario.", 'start': 42291.38, 'duration': 3.422}, {'end': 42307.175, 'text': "so maybe let's say we have been performing recursion and then we ended up at a situation like this where There is nothing left in the second string but you still have some characters left in the first string right?", 'start': 42294.802, 'duration': 12.373}, {'end': 42310.597, 'text': 'So you are at this position now and here this is gone.', 'start': 42307.555, 'duration': 3.042}, {'end': 42312.778, 'text': "There's nothing left in the second string.", 'start': 42310.637, 'duration': 2.141}, {'end': 42320.537, 'text': 'So in this case, to change recursive to change T I O N into the empty string.', 'start': 42314.839, 'duration': 5.698}], 'summary': 'Defining end scenario for recursion with one string empty.', 'duration': 29.157, 'max_score': 42291.38, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA42291380.jpg'}], 'start': 41281.032, 'title': 'Greedy and edit distance problems', 'summary': 'Covers the concepts of greedy approach and edit distance problem solving, with the greedy approach including a 45-minute to one-hour interview process and the edit distance problem discussing input, output, function signature, recursive solution, and test cases.', 'chapters': [{'end': 41606.446, 'start': 41281.032, 'title': 'Greedy approach for interview problem solving', 'summary': 'Discusses the concept of a greedy approach for solving interview problems, using an example to find the minimum number of steps required to convert one string into another, and outlines the typical structure of a 45-minute to one-hour interview process in which 30 to 40 minutes are dedicated to problem-solving.', 'duration': 325.414, 'highlights': ['The chapter discusses a greedy approach for solving interview problems, using an example to find the minimum number of steps required to convert one string into another, and outlines the typical structure of a 45-minute to one-hour interview process.', "The algorithm's severity levels demonstrate significant differences in efficiency, with severity 3 able to work instantly for a billion elements, while severity 1 would take forever, even for a hundred thousand elements.", 'Interviews typically involve a couple of minutes of introduction followed by 30 to 40 minutes dedicated to problem-solving, and the example problem is solved in approximately 45 minutes, reflecting the typical interview process.', 'The example problem entails finding the minimum number of steps required to convert one string into another, involving operations such as character insertion, deletion, or replacement, with the demonstrated solution requiring 5 steps.']}, {'end': 41996.443, 'start': 41607.046, 'title': 'Edit distance problem', 'summary': 'Discusses the edit distance problem, explaining the input, output, and function signature, providing a recursive solution, and listing out test cases for the problem.', 'duration': 389.397, 'highlights': ['The chapter discusses the edit distance problem, explaining the input, output, and function signature.', 'It provides a recursive solution for the edit distance problem.', 'It lists out various test cases for the edit distance problem.']}, {'end': 42434.126, 'start': 41996.463, 'title': 'Minimum edit distance problem', 'summary': 'Discusses the minimum edit distance problem in which the goal is to transform one string to another with the minimum number of operations, exploring the cases of deletion, swapping, and insertion, and ultimately determining the recursive solutions for different scenarios.', 'duration': 437.663, 'highlights': ['The chapter explains the three possibilities when the first character of the strings is not equal: deletion, swapping, or insertion, illustrating the concept of recursion and the power of exploring all options.', 'It details the recursive approach for each case, emphasizing the recursive solutions for deletion, swapping, and insertion, showcasing the systematic method for determining the minimum number of steps for transforming the strings.', 'The discussion delves into the end scenarios of the recursion, outlining the cases where one string becomes empty and the operations required to transform it, highlighting the comprehensive analysis of various end cases.']}], 'duration': 1153.094, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA41281032.jpg', 'highlights': ["The algorithm's severity levels demonstrate significant differences in efficiency, with severity 3 able to work instantly for a billion elements, while severity 1 would take forever, even for a hundred thousand elements.", 'The example problem entails finding the minimum number of steps required to convert one string into another, involving operations such as character insertion, deletion, or replacement, with the demonstrated solution requiring 5 steps.', 'Interviews typically involve a couple of minutes of introduction followed by 30 to 40 minutes dedicated to problem-solving, and the example problem is solved in approximately 45 minutes, reflecting the typical interview process.', 'The chapter discusses a greedy approach for solving interview problems, using an example to find the minimum number of steps required to convert one string into another, and outlines the typical structure of a 45-minute to one-hour interview process.', 'The chapter explains the three possibilities when the first character of the strings is not equal: deletion, swapping, or insertion, illustrating the concept of recursion and the power of exploring all options.', 'The chapter discusses the edit distance problem, explaining the input, output, and function signature.', 'It details the recursive approach for each case, emphasizing the recursive solutions for deletion, swapping, and insertion, showcasing the systematic method for determining the minimum number of steps for transforming the strings.', 'It provides a recursive solution for the edit distance problem.', 'It lists out various test cases for the edit distance problem.', 'The discussion delves into the end scenarios of the recursion, outlining the cases where one string becomes empty and the operations required to transform it, highlighting the comprehensive analysis of various end cases.']}, {'end': 45048.017, 'segs': [{'end': 43865.236, 'src': 'embed', 'start': 43836.066, 'weight': 1, 'content': [{'end': 43839.909, 'text': 'And then you realize that either you were correct or what your mistake was.', 'start': 43836.066, 'duration': 3.843}, {'end': 43846.712, 'text': "It's probably going to happen in one of five interviews anyway.", 'start': 43843.331, 'duration': 3.381}, {'end': 43849.852, 'text': "Okay So now we've written a memoir solution.", 'start': 43847.412, 'duration': 2.44}, {'end': 43853.473, 'text': 'Great And we can start checking the memoir solution now.', 'start': 43850.793, 'duration': 2.68}, {'end': 43860.315, 'text': "So minimum edit distance memo, let's call them main edit distance memo, and we get back the value for looks fine.", 'start': 43853.493, 'duration': 6.822}, {'end': 43865.236, 'text': "Let's try Saturday and Sunday as we have.", 'start': 43860.875, 'duration': 4.361}], 'summary': 'The solution involves a minimum edit distance memo, with an expected occurrence in one out of five interviews.', 'duration': 29.17, 'max_score': 43836.066, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA43836066.jpg'}, {'end': 44070.635, 'src': 'embed', 'start': 44040.853, 'weight': 0, 'content': [{'end': 44043.576, 'text': 'So where it was taking 10 to the 47 operations.', 'start': 44040.853, 'duration': 2.723}, {'end': 44048.581, 'text': 'Now it takes only 2, 500 operations, which is pretty small.', 'start': 44044.016, 'duration': 4.565}, {'end': 44055.349, 'text': 'So you can still work with lists of size up to 10, 000 or a hundred thousand very easily using the memo solution.', 'start': 44048.601, 'duration': 6.748}, {'end': 44061.89, 'text': 'So that covers this problem and keep talking through your solution.', 'start': 44058.288, 'duration': 3.602}, {'end': 44070.635, 'text': "Even as you're stuck, even as you're confused, just as I was, it's helpful to just keep a spend maybe two or three minutes trying to solve the issue.", 'start': 44062.23, 'duration': 8.405}], 'summary': 'Algorithm now only requires 2,500 operations instead of 10^47, making it efficient for lists up to 100,000.', 'duration': 29.782, 'max_score': 44040.853, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA44040853.jpg'}, {'end': 44254.215, 'src': 'embed', 'start': 44220.975, 'weight': 2, 'content': [{'end': 44223.076, 'text': 'Ultimately, this is what a dynamic programming looks like.', 'start': 44220.975, 'duration': 2.101}, {'end': 44240.282, 'text': 'Programming problem looks like you are ultimately going to create a table here and how we start filling the table is the IJ element.', 'start': 44223.216, 'duration': 17.066}, {'end': 44241.342, 'text': "So let's say this element.", 'start': 44240.322, 'duration': 1.02}, {'end': 44246.049, 'text': 'INTE EXCE.', 'start': 44243.527, 'duration': 2.522}, {'end': 44254.215, 'text': 'So this element represents the edit distance or the number of operations required to convert INTE into EXCE.', 'start': 44246.73, 'duration': 7.485}], 'summary': 'Dynamic programming involves creating a table to calculate edit distance.', 'duration': 33.24, 'max_score': 44220.975, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA44220975.jpg'}, {'end': 44729.525, 'src': 'embed', 'start': 44699.583, 'weight': 4, 'content': [{'end': 44700.723, 'text': "That's one way to go about it.", 'start': 44699.583, 'duration': 1.14}, {'end': 44709.106, 'text': 'And once again, just do five to 10 problems on binary search, and you will be able to identify pretty much any binary search question in an interview.', 'start': 44700.943, 'duration': 8.163}, {'end': 44716.768, 'text': 'Then the next topic that we looked at was binary search trees, traversals, and here is something.', 'start': 44710.326, 'duration': 6.442}, {'end': 44721.239, 'text': 'That is generally asked very directly.', 'start': 44718.777, 'duration': 2.462}, {'end': 44725.362, 'text': 'So you will be given a question like binary search tree, do something with a binary search tree.', 'start': 44721.299, 'duration': 4.063}, {'end': 44727.584, 'text': 'And you can answer that question directly.', 'start': 44725.983, 'duration': 1.601}, {'end': 44729.525, 'text': "We've covered a lot of different things here.", 'start': 44727.644, 'duration': 1.881}], 'summary': 'Practice 5-10 binary search problems to identify interview questions. cover binary search trees and traversals.', 'duration': 29.942, 'max_score': 44699.583, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA44699583.jpg'}, {'end': 44981.527, 'src': 'embed', 'start': 44954.548, 'weight': 3, 'content': [{'end': 44960.752, 'text': 'complete the assignments and attempt the optional questions to practice and participate in forum discussions also very useful.', 'start': 44954.548, 'duration': 6.204}, {'end': 44966.617, 'text': 'when you participate in forum discussions, why, by answering questions, a lot of your own doubts get cleared.', 'start': 44960.752, 'duration': 5.865}, {'end': 44970.699, 'text': 'so do participate in forum discussions and then join or start a study group, if possible.', 'start': 44966.617, 'duration': 4.082}, {'end': 44974.342, 'text': 'getting together with a group of four or five people is great.', 'start': 44970.699, 'duration': 3.643}, {'end': 44981.527, 'text': 'it really helps you focus and improve your understanding by discussion.', 'start': 44974.342, 'duration': 7.185}], 'summary': 'Completing assignments, attempting optional questions, and participating in forum discussions can help clear doubts and improve understanding.', 'duration': 26.979, 'max_score': 44954.548, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA44954548.jpg'}], 'start': 42436.454, 'title': 'Minimum steps and dynamic programming', 'summary': 'Discusses the minimum steps problem, recursive functions for minimum steps, finding minimum edit distance, dynamic programming, memoization, and review of key data structures and algorithms with emphasis on practicing techniques and complexities for effective problem-solving in interviews.', 'chapters': [{'end': 42643.442, 'start': 42436.454, 'title': 'Minimum steps problem', 'summary': 'Discusses the minimum steps problem, involving tracking the characters in two strings, using recursion and window pointers to optimize computation, and handling the end cases, with the goal of minimizing additions and deletions in the strings.', 'duration': 206.988, 'highlights': ['The chapter discusses the process of using recursion and window pointers to optimize computation by tracking the characters in two strings.', 'The end cases are handled by determining the number of additions and deletions required to minimize operations in the strings.', 'The starting point of the window determines the substring for which the problem is solved, aiming to minimize the number of operations required.']}, {'end': 42961.412, 'start': 42644.182, 'title': 'Minimum steps recursive function', 'summary': 'Discusses a recursive function that determines the minimum number of steps required for insertion, deletion, or swapping in two given strings. the function algorithmically selects the minimum number of steps by recursively checking the cost for each operation, effectively providing a versatile and efficient solution for similar problems.', 'duration': 317.23, 'highlights': ['Recursion is used to determine the minimum number of steps required for insertion, deletion, or swapping in two given strings.', 'The recursive function determines the minimum steps for insertion, deletion, or swapping by considering each case and selecting the minimum one.', 'The recursive function provides a versatile and efficient solution for similar problems.']}, {'end': 43900.34, 'start': 42961.412, 'title': 'Finding minimum edit distance', 'summary': 'Discusses the process of finding the minimum edit distance between two strings using recursion and memoization, with the complexity of the recursive solution being exponential three to the power of n1 plus n2. the final solution obtained was four changes for a specific case.', 'duration': 938.928, 'highlights': ['The complexity of the recursive solution is exponential, being three to the power of n1 plus n2.', 'The final solution obtained for a specific case was four changes, which is considered a suboptimal solution.', 'The chapter discusses the process of finding the minimum edit distance between two strings using recursion and memoization.']}, {'end': 44631.393, 'start': 43900.34, 'title': 'Dynamic programming and memoization', 'summary': 'Discusses the application of dynamic programming and memoization to solve a problem, showcasing how the time complexity reduces from exponential to linear and the importance of stating the brute force solution in interviews.', 'duration': 731.053, 'highlights': ['The time complexity reduces from exponential to linear with the application of memoization, making it possible to work with larger input sizes such as 10,000 or 100,000 very easily.', 'The logic behind dynamic programming is explained, involving the creation of a table to calculate the minimum edit distance between two strings by considering cases where characters are equal or unequal.', 'Emphasizes the importance of stating the brute force solution in interviews and offering to implement it if unable to figure out a more optimal solution to demonstrate coding abilities.']}, {'end': 44801.165, 'start': 44634.875, 'title': 'Review of data structures and algorithms', 'summary': 'Covers five key techniques: binary search, binary search trees, hash tables, sorting algorithms, and their complexities, emphasizing the importance of practicing each technique with 5-10 problems to identify and solve related interview questions effectively.', 'duration': 166.29, 'highlights': ['Binary search is a common interview question; practicing 5-10 problems helps to identify and solve related questions effectively.', 'Binary search trees, traversals, and balancing are frequently asked questions, providing a good exercise on recursion.', 'Hashing and hash tables are common interview topics; building hash tables from scratch in Python and handling collisions using linear probing is emphasized.', 'Sorting algorithms, including bubble sort, insertion sort, merge sort, and quick sort, are covered, with an emphasis on complexities and space constraints.']}, {'end': 45048.017, 'start': 44802.782, 'title': 'Data structures & algorithms in python', 'summary': 'Covered implementing algorithms for polynomial multiplication, dynamic programming, graph algorithms, and course project guidelines, emphasizing the importance of practice and participation in forum discussions.', 'duration': 245.235, 'highlights': ['The course project involves solving a coding problem from an online source, using a problem-solving template, documenting the solution, and performing complexity analysis, to be published on the Jovian profile. (Quantifiable: 1 project)', 'Emphasizing the importance of practicing and participating in forum discussions to reinforce learning, clarify doubts, and improve understanding. (Quantifiable: 5 forum posts)', 'Covered implementing algorithms for polynomial multiplication, dynamic programming, recursion, memoization, backtracking, pruning, graph algorithms, depth-first search, breadth-first search, and shortest paths in directed and weighted graphs. (Quantifiable: 5 algorithm implementations)', 'Recommendation to solve at least five questions on breadth-first search and depth-first search to excel in solving graph problems in interviews. (Quantifiable: 5 questions on each algorithm)', 'Advice to join or start a study group of four to five people to enhance understanding through discussions. (Quantifiable: 1 study group)']}], 'duration': 2611.563, 'thumbnail': 'https://coursnap.oss-ap-southeast-1.aliyuncs.com/video-capture/pkYVOmU3MgA/pics/pkYVOmU3MgA42436454.jpg', 'highlights': ['The time complexity reduces from exponential to linear with memoization, enabling easy handling of larger input sizes. (Quantifiable: 10,000 or 100,000)', 'The chapter discusses the process of finding the minimum edit distance between two strings using recursion and memoization.', 'The logic behind dynamic programming is explained, involving the creation of a table to calculate the minimum edit distance between two strings.', 'Emphasizes the importance of practicing and participating in forum discussions to reinforce learning, clarify doubts, and improve understanding. (Quantifiable: 5 forum posts)', 'Binary search is a common interview question; practicing 5-10 problems helps to identify and solve related questions effectively.']}], 'highlights': ['The course runs over six weeks with two-hour video lectures every week', 'Binary search has a time complexity of order of log N', 'The process of finding the starting and ending position of a given number in a sorted array using binary search is explained, with a strategy involving two binary searches for first and last position, resulting in a complexity of order log₂n', 'The merge operation in merge sort involves merging sorted lists to create bigger and bigger sorted lists, with the merge operation being a crucial aspect of the merge sort algorithm', 'The concept of directed graphs and their application in navigating hyperlinks is discussed, emphasizing the need to find the shortest path between websites', 'The recursive solution for finding maximum profit has an exponential time complexity of O(2^N)', 'The algorithm complexity is reduced from N^3 to N^2 by maintaining a running sum, showcasing a 1:1.5 improvement in time complexity', 'The time complexity reduces from exponential to linear with memoization, enabling easy handling of larger input sizes', 'The chapter discusses the process of finding the minimum edit distance between two strings using recursion and memoization', 'Active forum participation increases course completion rates by four to five times']}