Back To Back SWE
Back To Back SWE
  • Видео 94
  • Просмотров 8 833 258
Build A Min Height BST From A Sorted Array | Coding Interview Question
Back with another video and a special offer on our lifetime membership for you - use the promo code: APRIL40 to get 40% off on our subscription 🎉
Free 5-Day Mini-Course: backtobackswe.com
Try Our Full Platform: backtobackswe.com/checkout?plan=lifetime-legacy&discount_code=APRIL40
📹 Intuitive Video Explanations
🏃 Run Code As You Learn
💾 Save Progress
❓ New Unseen Questions
Given a sorted array, create a binary search tree with minimal height.
Input:
[1, 2, 3, 4, 5, 6, 7]
Output:
[4, 2, 6, 1, 3, 5, 7]
Explanation:
4
/ \
2 6
/ \ / \
1 3 5 7
Просмотров: 7 026

Видео

Introducing Asymptotic Notations
Просмотров 32 тыс.3 года назад
Introducing Asymptotic Notations
AVL Trees & Rotations (Self-Balancing Binary Search Trees)
Просмотров 329 тыс.4 года назад
AVL Trees & Rotations (Self-Balancing Binary Search Trees)
The New Back To Back SWE Platform (2020 Plans)
Просмотров 42 тыс.4 года назад
The New Back To Back SWE Platform (2020 Plans)
Network Flows: Max-Flow Min-Cut Theorem (& Ford-Fulkerson Algorithm)
Просмотров 325 тыс.4 года назад
Network Flows: Max-Flow Min-Cut Theorem (& Ford-Fulkerson Algorithm)
Interval Scheduling Maximization (Proof w/ Exchange Argument)
Просмотров 61 тыс.4 года назад
Interval Scheduling Maximization (Proof w/ Exchange Argument)
Dijkstra's Algorithm vs Prim's Algorithm
Просмотров 68 тыс.4 года назад
Dijkstra's Algorithm vs Prim's Algorithm
Professor Clyde Kruskal On Kruskal's Algorithm
Просмотров 40 тыс.4 года назад
Professor Clyde Kruskal On Kruskal's Algorithm
i'm starting a coding interview class
Просмотров 33 тыс.4 года назад
i'm starting a coding interview class
How I Got An Internship @ Twitter
Просмотров 26 тыс.5 лет назад
How I Got An Internship @ Twitter
Why Comparison Based Sorting Algorithms Are Ω(n*lg(n))
Просмотров 61 тыс.5 лет назад
Why Comparison Based Sorting Algorithms Are Ω(n*lg(n))
Software Engineer On Negotiating Job Offers & Finding The Right Workplace (Samrat Jha - B2B Show 3)
Просмотров 9 тыс.5 лет назад
Software Engineer On Negotiating Job Offers & Finding The Right Workplace (Samrat Jha - B2B Show 3)
Serialize & Deserialize A Binary Tree - Crafting Recursive Solutions To Interview Problems
Просмотров 101 тыс.5 лет назад
Serialize & Deserialize A Binary Tree - Crafting Recursive Solutions To Interview Problems
Gaurav Sen: Talking Daily Life At Uber & System Design Wisdom (The Back To Back Show - Show 1)
Просмотров 12 тыс.5 лет назад
Gaurav Sen: Talking Daily Life At Uber & System Design Wisdom (The Back To Back Show - Show 1)
Find the k'th Largest or Smallest Element of an Array: From Sorting To Heaps To Partitioning
Просмотров 266 тыс.5 лет назад
Find the k'th Largest or Smallest Element of an Array: From Sorting To Heaps To Partitioning
Counting Sort: An Exploration of Sorting Special Input In Linear Time
Просмотров 51 тыс.5 лет назад
Counting Sort: An Exploration of Sorting Special Input In Linear Time
Sort A K Sorted Array - Investigating Applications of Min/Max Heaps
Просмотров 27 тыс.5 лет назад
Sort A K Sorted Array - Investigating Applications of Min/Max Heaps
Lowest Common Ancestor Between 2 Binary Tree Nodes (A Recursive Approach)
Просмотров 83 тыс.5 лет назад
Lowest Common Ancestor Between 2 Binary Tree Nodes (A Recursive Approach)
The Quicksort Sorting Algorithm: Pick A Pivot, Partition, & Recurse
Просмотров 163 тыс.5 лет назад
The Quicksort Sorting Algorithm: Pick A Pivot, Partition, & Recurse
Search A 2D Sorted Matrix - Fundamentals of Search Space Reduction
Просмотров 51 тыс.5 лет назад
Search A 2D Sorted Matrix - Fundamentals of Search Space Reduction
Fast Multiplication: From Grade-School Multiplication To Karatsuba's Algorithm
Просмотров 71 тыс.5 лет назад
Fast Multiplication: From Grade-School Multiplication To Karatsuba's Algorithm
The Backtracking Blueprint: The Legendary 3 Keys To Backtracking Algorithms
Просмотров 474 тыс.5 лет назад
The Backtracking Blueprint: The Legendary 3 Keys To Backtracking Algorithms
Asymptotic Notations 101: Big O, Big Omega, & Theta (Asymptotic Analysis Bootcamp)
Просмотров 317 тыс.5 лет назад
Asymptotic Notations 101: Big O, Big Omega, & Theta (Asymptotic Analysis Bootcamp)
Investigating Heap Sort - Why Is Heap Sort Θ(n * log(n))? An Even Longer Really Long Answer.
Просмотров 64 тыс.5 лет назад
Investigating Heap Sort - Why Is Heap Sort Θ(n * log(n))? An Even Longer Really Long Answer.
Reverse Polish Notation: Types of Mathematical Notations & Using A Stack To Solve RPN Expressions
Просмотров 71 тыс.5 лет назад
Reverse Polish Notation: Types of Mathematical Notations & Using A Stack To Solve RPN Expressions
Add Two Numbers Without The "+" Sign (Bit Shifting Basics)
Просмотров 123 тыс.5 лет назад
Add Two Numbers Without The " " Sign (Bit Shifting Basics)
Minimum Window Substring: Utilizing Two Pointers & Tracking Character Mappings With A Hashtable
Просмотров 121 тыс.5 лет назад
Minimum Window Substring: Utilizing Two Pointers & Tracking Character Mappings With A Hashtable
Why Is Merge Sort O(n * log(n))? The Really Really Long Answer.
Просмотров 113 тыс.5 лет назад
Why Is Merge Sort O(n * log(n))? The Really Really Long Answer.
Egg Dropping Problem: Dynamic Programming Fundamentals & Understanding Subproblem Decomposition
Просмотров 108 тыс.5 лет назад
Egg Dropping Problem: Dynamic Programming Fundamentals & Understanding Subproblem Decomposition
Longest Common Subsequence (2 Strings) - Dynamic Programming & Competing Subproblems
Просмотров 193 тыс.5 лет назад
Longest Common Subsequence (2 Strings) - Dynamic Programming & Competing Subproblems

Комментарии

  • @AmirKanyazov
    @AmirKanyazov 9 часов назад

    You are very dedicated. Really cool!! Thanx

  • @glatavento1513
    @glatavento1513 14 часов назад

    best kmp video on ytb

  • @kamalapriyass2608
    @kamalapriyass2608 2 дня назад

    This exaplanation is awesome, wonderful. Thank for the wonderful service!!

  • @hosseinbred1061
    @hosseinbred1061 4 дня назад

    Goat 🥂

  • @hosseinbred1061
    @hosseinbred1061 4 дня назад

    Genius ❤

  • @geertex
    @geertex 5 дней назад

    Amazing explanation on dynamic programming! For this example it would be a really cool to add transposition which adds a nice extra special case.

  • @wagishagupta162
    @wagishagupta162 5 дней назад

    what an amazing way to build intuition for such problems! thank you!!

  • @tarfaibrahim912
    @tarfaibrahim912 6 дней назад

    thanks it was good i never learnt it before like this it is nice but needs math that why IT always better to have good math grasp

  • @markforbes6187
    @markforbes6187 10 дней назад

    Incredible video.

  • @freakfreakk2386
    @freakfreakk2386 10 дней назад

    Thank you man

  • @silasleuenberger7204
    @silasleuenberger7204 10 дней назад

    Great video!

  • @user-kv3jd1ln4l
    @user-kv3jd1ln4l 11 дней назад

    amazing. thanks

  • @witchelreme3262
    @witchelreme3262 12 дней назад

    Don't like to throw the race card in there but THANK YOU!

  • @krishnaMurari48
    @krishnaMurari48 13 дней назад

    Amazing!!!

  • @JogoShugh
    @JogoShugh 13 дней назад

    Within a minute or so, I knew this was going to be one of the best explanations I have seen or read. Thanks!

    • @JogoShugh
      @JogoShugh 13 дней назад

      I've been reading Grokking Algorithms 2nd Edition, and found your explanation better. Though, I love the book too." One thing that bothers me in most explanations, including in GA2ndEd, is that they rarely deal with the case where the item you are looking for is the last one. In your example, of 1, 2, 3, 4, 5, 6, 7, 8 if we are looking for "8", and using the floor division approach (which GA2ndEd uses) we start with index 3, too low. Next we look at "5" within 5, 6, 7, 8. 2nd attempt, too low. Next we look at 7 within 7,8. Third attempt, and still too low. Now, unless we know ahead of time that the item we're looking for is guaranteed to be in the set, then we must make a 4th comparison to verify that 8 is indeed the last available item to examine. The book says it is going to explain this in chapter 4 (I'm only on 3) as to why constants are not used in Big O notation, but I just wish they and others would note this nuance when the list of items is a power of 2.

  • @janpoonthong
    @janpoonthong 13 дней назад

    row = int(input()) user_input = [] for i in range(row): user_input.append(list(map(int, input().split()))) def kadane(user_input): max_global = float("-inf") max_current = 0 for i in range(len(user_input)): max_current += user_input[i] if max_current > max_global: max_global = max_current if max_current < 0: max_current = 0 return max_global max_global = float("-inf") running_row_sum = [0] * len(user_input) for run in range(len(user_input[0])): running_row_sum = [0] * len(user_input) for l in range(run, len(user_input[0])): for r in range(len(user_input)): current_number = user_input[r][l] running_row_sum[r] += current_number best_max_sub_list = kadane(running_row_sum) if best_max_sub_list > max_global: max_global = best_max_sub_list print(max_global) acm.timus.ru/problem.aspx?space=1&num=1146

  • @janpoonthong
    @janpoonthong 13 дней назад

    Great video

  • @RDharini-yg1nm
    @RDharini-yg1nm 13 дней назад

    Very Helpful, Fantastic Explanation

  • @dibaonguyentat600
    @dibaonguyentat600 14 дней назад

    Love this video

  • @jesca4855
    @jesca4855 14 дней назад

    ive left more confused than before. :(

  • @n.h.son1902
    @n.h.son1902 14 дней назад

    8:02, why do we move backwards in the array arr? Is there any reason behind this? Why not moving forwards?

  • @hannaistomina7768
    @hannaistomina7768 14 дней назад

    THANK YOU SO MUCH!!!!!

  • @ronmc1677
    @ronmc1677 16 дней назад

    Nice video man. I like your style of teaching, this is the first ever video of yours that I've watched and I like the casual style of teaching. It would be great if you could make videos that emphasize the guiding principle behind solving a problem and then share ways to attack the problem as well, in a direct way. Thanks and Cheers!

  • @artizanal60
    @artizanal60 16 дней назад

    8:14 starts here

  • @TadiwanasheNyamapfene
    @TadiwanasheNyamapfene 16 дней назад

    Absolutely the best video to explain this. Just took away all my frustration lol!!

  • @cinemabreaker8800
    @cinemabreaker8800 17 дней назад

    Greate video, Thanks a lot!

  • @Ashblowsup
    @Ashblowsup 17 дней назад

    i think you're the love of my life

  • @spageen
    @spageen 17 дней назад

    Thank you!!!

  • @kunalhotwani6315
    @kunalhotwani6315 17 дней назад

    Hath Mila Bhai 🤝

  • @gecho5427
    @gecho5427 17 дней назад

    why are you explaining things better than the people who get paid to do it? why do I have to pay 1800 for college credit to learn the material on youtube?

  • @reality_today
    @reality_today 18 дней назад

    Amazing wonderfully explained

  • @gabegutz1151
    @gabegutz1151 18 дней назад

    super super love this

  • @teknical-_-6468
    @teknical-_-6468 20 дней назад

    Well done

  • @memeingthroughenglish7221
    @memeingthroughenglish7221 20 дней назад

    Thank you so much!

  • @vlai4965
    @vlai4965 20 дней назад

    1. why we are ONLY able to put the new left/right Parentheses at the rightest side every time? 2. According to the above limitation, why we could say the final level leafs are the answer? Thanks 🙇‍♂

  • @shahainmanujith2109
    @shahainmanujith2109 20 дней назад

    Nice explanation :)

  • @shenshaw5345
    @shenshaw5345 20 дней назад

    16:25 he makes this feel so epic.

  • @tejasvix
    @tejasvix 21 день назад

    lol got this question for amazon applied scientist role 2 years ago and i didn't know it was LRU cache

  • @lesteI
    @lesteI 21 день назад

    I've struggled with the knapsack problem for so long. I learned a lot from your video. Thank you!

  • @Gwittdog
    @Gwittdog 21 день назад

    Great Explanation

  • @niccolomancini3801
    @niccolomancini3801 23 дня назад

    TY so much great explanation and I dont even speak english that well! Love from italy

  • @hakunamatata-nl4js
    @hakunamatata-nl4js 23 дня назад

    Thank you so much

  • @baraaabuasal5626
    @baraaabuasal5626 23 дня назад

    at 6:00 I was like, say no more => Subscribed. fkn love the way explain stuff man

  • @mehmetalikeskin6467
    @mehmetalikeskin6467 24 дня назад

    good job brother very appreciate it

  • @abhimanyu6215
    @abhimanyu6215 25 дней назад

    Best expiation ever sir. Thank you so much for your efforts.

  • @Userk77777
    @Userk77777 26 дней назад

    Thank you, sir! You explained it with great energy and clarity.

  • @louishauger3057
    @louishauger3057 29 дней назад

    Sorry but show big trees not that small stuff

  • @ritapiu319
    @ritapiu319 29 дней назад

    nice, thank you

  • @dontignore5567
    @dontignore5567 Месяц назад

    Is it possible to solve this question without looking at solution ?

  • @ed2023bc
    @ed2023bc Месяц назад

    Very detailed explanation with a big array! Thank you .