Course Hive
Search

Welcome

Sign in or create your account

Continue with Google
or
Dynamic Programming Tutorial Part 1 | Memoization & Tabulation | Algorithms | Learn DP  @SCALER
Play lesson

Data Structures and Algorithms (DSA): Stacks & Queues | Linked Lists | Sorting | Arrays - Dynamic Programming Tutorial Part 1 | Memoization & Tabulation | Algorithms | Learn DP @SCALER

Master the Art of Data Structures & Algorithms: Crack Coding Interviews with Ease in 2023! Explore Comprehensive Tutorials & Interview Prep on Stacks, Queues, Graphs, and More. Get Ready to Ace FAANG with Expert Guidance from SCALER!

5.0 (2)
17 learners

What you'll learn

Develop proficiency in implementing commonly used data structures such as stacks, queues, and linked lists
Enhance problem-solving skills by applying algorithms to various coding challenges
Understand and optimize time complexity for efficient algorithm performance
Master dynamic programming and graph theory techniques for complex problem-solving

This course includes

  • 389 hours of video
  • Certificate of completion
  • Access on mobile and TV

Summary

Keywords

Full Transcript

This video is a part of Dynamic Programming Tutorial by Mahima Hans (Software Engineer at Adobe). You can also master the basics of dynamic programming and it's application. Check out our free masterclasses by industry-leading experts here: https://www.scaler.com/events?utm_source=Youtube&utm_medium=osocial&utm_campaign=brand_scaler_events_osocial_youtube_dynamic-programming-tutorial-part1-mahima-hans&utm_content=YTDescription Dynamic programming is a method for solving complex problems by breaking them down into simpler subproblems and solving each subproblem only once, storing the solutions to avoid redundant computations. It is particularly useful for optimisation problems, where the goal is to find the best solution among a set of possible solutions. But what is problem solving? Problem solving in dynamic programming involves applying the principles of dynamic programming to solve optimization problems efficiently. Here's a step-by-step overview of how dynamic programming is typically applied to solve a problem: 1. Identify Optimal Substructure: Determine if the problem can be broken down into smaller subproblems, and if the optimal solution to the original problem can be constructed from the optimal solutions of its subproblems. 2. Define Recurrence Relation: Formulate a recursive relation that expresses the solution to a larger problem in terms of solutions to its subproblems. This relation should capture the recurrence pattern of the problem. 3. Optimal Solution: Once the solutions to all subproblems are computed, retrieve the solution to the original problem from the table or cache. 4. Analysis: The time and space complexity of the solution to ensure it meets the requirements of the problem. Dynamic programming solutions are often optimized to reduce time and space complexity compared to naive recursive solutions. There are two main approaches to dynamic programming: Top-Down Approach (Memoization): In this approach, the problem is solved recursively, breaking it down into smaller subproblems. However, to avoid redundant computations, the solutions to subproblems are stored in a data structure like an array or a hash table. This process is called memoization. When a subproblem is encountered again, instead of recomputing its solution, the precomputed solution is retrieved from memory. Memoization ensures that each subproblem is solved only once, leading to improved efficiency.This approach is typically implemented using recursion with an added memoization mechanism. Bottom-Up Approach (Tabulation): In the bottom-up approach, the problem is solved iteratively, starting from the smallest subproblems and gradually building up to the larger ones.The solutions to subproblems are stored in a table or array. At each step, the solution to a larger problem is computed using the solutions to smaller subproblems, following a specific order to ensure that all necessary subproblems are already solved. Since all subproblems are solved in a predefined order, there is no need for recursion or memoization. This approach is often more efficient in terms of both time and space complexity compared to the top-down approach. It's particularly useful when the recursive structure of the problem can be easily converted into an iterative process. Topics Covered 00:00 - Introduction 00:40 - Dynamic Programming Part 1 01:51 - Fibonnaci Series Example 06:16 - Overlapping Sub-problems 07:42 - Top Down/ Memoization Approach 11:32 - Memoization Code Example 15:44 - Bottom Up/ Tabulation Approach 18:20 - Tabulation Code Example 21:05 - Difference between the two approaches with examples #scaler #dynamicprogramming #algorithm #problemsolving ______________________________________________________________________________ About SCALER: A transformative tech school, creating talent with impeccable skills. Upskill and Create Impact. Learn more about Scaler: https://bit.ly/3Ps8z6j 📌 Follow us on Social and be a part of an amazing tech community📌 👉 Meet like-minded coder folks on Discord - https://discord.com/invite/ejFeksEtTq 👉 Tweets you cannot afford to miss out on - https://twitter.com/scaler_official 👉 Check out student success stories, expert opinions, and live classes on Linkedin - https://www.linkedin.com/school/scalerofficial 👉 Explore value-packed reels, carousels and get access to exclusive updates on Instagram - https://www.instagram.com/scaler_official/ 📢 Be a part of our one of a kind telegram community: https://t.me/Scalercommunity 🔔 Hit that bell icon to get notified of all our new videos 🔔 If you liked this video, please don't forget to like and comment. Never miss out on our exclusive videos to help boost your coding career! Subscribe to Scaler now! https://www.youtube.com/Scaler?sub_confirmation=1

Course Hive

Continue this lesson in the app

Install CourseHive on Android or iOS to keep learning while you move.

Related Courses

FAQs

Course Hive
Download CourseHive
Keep learning anywhere