Комментарии •

  • @aalishanhunzai
    @aalishanhunzai 7 месяцев назад +22

    amazing video
    corrections:
    c(0,4) 19 with root 3
    c(1,4) 11 with root 4
    graph is:
    r(0,4)
    / 3 \
    r(0,2) r(3,4)
    / 1 \ / 4 \
    r(0,0) r(1,2) r(3,3) r(4,4)
    / \
    r(1,1) r(2,2)
    result:
    15
    / \
    5 20
    \
    3

  • @kumarabhinav1577
    @kumarabhinav1577 Год назад +33

    *Correction*
    C[1,4] is 11 and root is 4
    C[0,4] is 19 and root is 3
    //it's okay we're here to learn the concept.

    • @User-student-404
      @User-student-404 Год назад +2

      best comment in the comment section 👍👍

    • @aalishanhunzai
      @aalishanhunzai 7 месяцев назад

      iska phir jo vertexes bana rahe wo zyada arha ha

  • @SonuYadav-ub1zx
    @SonuYadav-ub1zx 2 года назад +24

    Cost (1,4 ) is 11 with root 4 & c(0,4) is 19 with root 3

  • @thefuntech2810
    @thefuntech2810 4 года назад +56

    answer is wrong I filled all blocks
    C(1,4)=11
    C(0,4)=19
    And root is vertex 3

    • @manjeetmanu4547
      @manjeetmanu4547 4 года назад +1

      BUT ISKA TREE KAISE BANEGA

    • @thefuntech2810
      @thefuntech2810 4 года назад

      @@manjeetmanu4547 wahi process follow karo

    • @mahiransh9894
      @mahiransh9894 4 года назад

      Bhai final answer bta de yrr...
      Kll paper hai...!!!

    • @thefuntech2810
      @thefuntech2810 4 года назад +1

      @@mahiransh9894 video poori dekhlo phir apne aap samaj mai aa jayega
      UP se ho kya AKTU University ?

    • @jaxim8520
      @jaxim8520 4 года назад +1

      C[0,4]= 14
      Shi h C[0,4] ka answer

  • @prakashnavin6245
    @prakashnavin6245 Год назад +1

    thank you so much last moment tuition you guys are doing a really great job today is my final exam and after watching your video at 4: 35 am I got the concept very clearly. please keep uploading such informative video #engineers #btech

  • @navjyoti3075
    @navjyoti3075 3 года назад

    Bhai apko pranam kitna acche seh apne samjhaya ❤️ mera abhi 4 sem m ei topic h smj nhi arha tha toh search kia aur baki smj a gya pura 😁😁 thnks bhai

  • @coderx7177
    @coderx7177 2 года назад

    Bhaiya bohot sahi video tha apne jo choti choti tricks batai isse remember krne k lie voh lajvab thi mene kai sare videos dekhe pr kuch nahi smjha apne har ek step achhese bataya hai bohot bohot dhanywaad ❤️.

  • @shreechatane9215
    @shreechatane9215 Год назад

    Thank you bro very useful content ✌🏻

  • @neeketasaini3695
    @neeketasaini3695 4 года назад +4

    Sir the value of c(1,4)=11 with root Vertex 4.please let u clear this doubt.

  • @kunalbudhiraja7761
    @kunalbudhiraja7761 3 года назад +6

    Literally cramming of algorithm

  • @ankitgitm
    @ankitgitm 4 года назад +78

    The entry of (0, 4) will be 21 with root 3
    Entry for (1,4) will be 11 with root 4
    The final answer will be changed accordingly
    According to me, The final answer will be
    Root (15)
    / \
    5 20
    \
    10

  • @SalimShaikh-fx4kz
    @SalimShaikh-fx4kz 2 года назад +2

    impressed bhai,after watching too many videos ,this clearifies the concept

  • @Error-zp3bn
    @Error-zp3bn 5 лет назад +9

    Cost (1,4) mai w(1,4) ki value add nhi ki hai

  • @mihirnaidu5211
    @mihirnaidu5211 2 года назад

    Kya hi samjhae aap bhaiya luv u upar wala aapko bohot khushiyaan de tysm !!!!

  • @aguyfromindia
    @aguyfromindia 2 года назад +5

    Thankyou sooo much you saved my whole life in just 30 mins :)
    .
    .
    .
    .
    .
    .
    .
    .
    .
    recommendation: go for only concept not for calculation.

  • @sahilchoudharypublicvlogs4456
    @sahilchoudharypublicvlogs4456 4 года назад +2

    how you calculated (1,3) please tell

  • @devaganeshnair5883
    @devaganeshnair5883 3 года назад +34

    C[1,4]= 11 root 4
    C[0,4]= 19 root 3
    15
    /\
    5. 20
    \
    10

  • @mfaraday4044
    @mfaraday4044 4 года назад +3

    Thank you bhau

  • @Morris64
    @Morris64 Год назад +3

    General formula for calculating the minimum cost is:
    C[i,j] = min{c[i, k-1] + c[k,j]} + w(i,j)

  • @ashwinikakade3418
    @ashwinikakade3418 2 месяца назад

    1 number shikavle tumchyamul maze 6 marks fix zale sir....👍🙏

  • @shivamtiwari9040
    @shivamtiwari9040 2 месяца назад

    The mistake you made in calculation of c(1,4) made me recheck all my calculations and understand the concept more clearly.

  • @CSEBivekKumarSahNirala
    @CSEBivekKumarSahNirala 4 года назад

    thank you sir

  • @thefuntech2810
    @thefuntech2810 4 года назад

    Badiya video hai ;)

  • @saurabhkumarkardam8782
    @saurabhkumarkardam8782 4 года назад +2

    Why did u not fill the all block ?

  • @unknownman1
    @unknownman1 4 года назад +2

    tum jio ek lakh saal :)

  • @zilesingh6349
    @zilesingh6349 Год назад

    Sir aapse (1,4) mistake ho gye hai usme aapne weight ko add nahi kiya
    Vo 11 hona tha uske vajah se (0,4) b galat ho gya . But sir aapne bahut acha samjaya mera exact tree create huya hai thanku so much...

  • @shahjee-iy4gu
    @shahjee-iy4gu Год назад

    You are genius

  • @g13arpitrajput76
    @g13arpitrajput76 5 лет назад

    Notes khaan h sir ...koi link nhi h notes ka

  • @awesomechintz7076
    @awesomechintz7076 Год назад

    Bhai h tu mera😘

  • @rockiggo
    @rockiggo 2 года назад

    Tqs sir

  • @ombothre2350
    @ombothre2350 Год назад +13

    Final Optimal BST :- 15
    / \
    5 20
    \
    10

    • @vishalghule4807
      @vishalghule4807 8 месяцев назад +2

      Tree in video is wrong?

    • @vishalghule4807
      @vishalghule4807 8 месяцев назад +2

      There he is starting from 5 then 20 , 15 ,10

    • @rajat129
      @rajat129 8 месяцев назад +1

      @@vishalghule4807 yes it is wrong in video , this is right answer

    • @vishalghule4807
      @vishalghule4807 8 месяцев назад

      @@rajat129 ok thanks 👍

    • @alinajaved2165
      @alinajaved2165 6 месяцев назад

      Final Optimal BST :-
      (0,4)
      15
      / \
      r(0,0) 5 20 r(1,4)
      \
      10 how 5 came here becoz on r(0,0) it will stop

  • @63yashshimpi79
    @63yashshimpi79 Год назад +2

    Q: Construct OBST for the given instances, If N=4, Set of Identifiers {a1, a2, a3,
    a4}= {do, if, int, while }, P(1:4)={p1,p2,p3,p4}={3,3,1,1} and Q(0:4)=
    {q0,q1,q2,q3,q4}={2,3,1,1,1} Construct a Optimal Binary Search Tree .
    👆👆👆👆👆👆 koi muze iss question mese VERTEX , KEY ,& FREQUENCY batao plzzzzz

    • @harsshadshivsharan.6539
      @harsshadshivsharan.6539 Год назад +1

      To construct an optimal binary search tree (OBST) for the given instances, we can use the dynamic programming approach. Let's go through the steps to construct the OBST:
      Step 1: Initialize the tables and arrays.
      Create two-dimensional tables cost and root of size (N+2) x (N+1).
      Create an array P of size (N+1) to store the probabilities.
      Create an array Q of size (N+2) to store the cumulative probabilities.
      Step 2: Calculate cumulative probabilities.
      Initialize Q(0) = 0.
      For i = 1 to N+1:
      Q(i) = Q(i-1) + P(i-1).
      Step 3: Initialize the cost table.
      For i = 1 to N+1:
      cost(i, i-1) = Q(i) + Q(i-1).
      Step 4: Build the optimal binary search tree.
      For L = 1 to N:
      For i = 1 to N-L+1:
      j = i + L - 1
      cost(i, j) = infinity
      For r = i to j:
      c = cost(i, r-1) + cost(r+1, j) + sum of P(i:j) + sum of Q(i:j+1)
      If c < cost(i, j):
      cost(i, j) = c
      root(i, j) = r
      Step 5: Print the optimal binary search tree.
      Call a recursive function printOBST(root, i, j):
      If i > j:
      Print "d" + (j+1)
      Else:
      Print "if" + (root(i, j)) + " (d" + (root(i, j)-1) + ", " + "d" + (root(i, j)+1) + ")"
      Recursively call printOBST(root, i, root(i, j)-1)
      Recursively call printOBST(root, root(i, j)+1, j)
      Now, let's apply these steps to the given instances:
      Step 1: Initialize the tables and arrays.
      N = 4
      Set of Identifiers: {do, if, int, while }
      P(1:4) = {3, 3, 1, 1}
      Q(0:4) = {2, 3, 1, 1, 1}
      Step 2: Calculate cumulative probabilities.
      Q(0) = 0
      Q(1) = Q(0) + P(0) = 0 + 3 = 3
      Q(2) = Q(1) + P(1) = 3 + 3 = 6
      Q(3) = Q(2) + P(2) = 6 + 1 = 7
      Q(4) = Q(3) + P(3) = 7 + 1 = 8
      Step 3: Initialize the cost table.
      cost(1, 0) = Q(1) + Q(0) = 3 + 2 = 5
      cost(2, 1) = Q(2) + Q(1) = 6 + 3 = 9
      cost(3, 2) = Q(3) + Q(2) = 7 + 6 = 13
      cost(4, 3) = Q(4) + Q(3) = 8 + 7 = 15
      Step 4: Build the optimal binary search tree.
      For L = 1:
      For i = 1:
      j = 1 + 1 - 1 = 1
      cost(1, 1) = infinity
      For r = 1 to 1:
      c = cost(1, 1-1) + cost(1+1, 1) + P(1) + Q(1:2)
      If c < cost(1, 1):
      cost(1, 1) = c
      root(1, 1) = 1
      For L = 2:
      For i = 1:
      j = 1 + 2 - 1 = 2
      cost(1, 2) = infinity
      For r = 1 to 2:
      c = cost(1, 1-1) + cost(1+1, 2) + sum of P(1:2) + sum of Q(1:3)
      If c < cost(1, 2):
      cost(1, 2) = c
      root(1, 2) = 2
      For i = 2:
      j = 2 + 2 - 1 = 3
      cost(2, 3) = infinity
      For r = 2 to 3:
      c = cost(2, 2-1) + cost(2+1, 3) + P(2) + Q(2:4)
      If c < cost(2, 3):
      cost(2, 3) = c
      root(2, 3) = 3
      For L = 3:
      For i = 1:
      j = 1 + 3 - 1 = 3
      cost(1, 3) = infinity
      For r = 1 to 3:
      c = cost(1, 1-1) + cost(1+1, 3) + sum of P(1:3) + sum of Q(1:4)
      If c < cost(1, 3):
      cost(1, 3) = c
      root(1, 3) = 2
      For i = 2:
      j = 2 + 3 - 1 = 4
      cost(2, 4) = infinity
      For r = 2 to 4:
      c = cost(2, 2-1) + cost(2+1, 4) + sum of P(2:4) + sum of Q(2:5)
      If c < cost(2, 4):
      cost(2, 4) = c
      root(2, 4) = 3
      For i = 3:
      j = 3 + 3 - 1 = 5
      cost(3, 5) = infinity
      For r = 3 to 5:
      c = cost(3, 3-1) + cost(3+1, 5) + sum of P(3:4) + sum of Q(3:5)
      If c < cost(3, 5):
      cost(3, 5) = c
      root(3, 5) = 4
      Step 5: Print the optimal binary search tree.
      Call printOBST(root, 1, 4):
      Print "if3 (d2, d4)"
      Call printOBST(root, 1, 2):
      Print "do (d1, d2)"
      Print "int (d3, d4)"
      Call printOBST(root, 4, 4):
      Print "while (d5)"
      The optimal binary search tree is as follows:
      Copy code
      if3
      / \
      do while
      int
      Note: The "d" + (index) represents a dummy node.

  • @anupsingh9978
    @anupsingh9978 Год назад +1

    Cost of [1,4] =11 because weight of w[1,4] =7
    So 7 + 4 = 11 And 11 is answer not 4 ok
    students don't be confused.

  • @bhushanvashist7556
    @bhushanvashist7556 2 года назад

    Thanks 👍

  • @danish_gaming01
    @danish_gaming01 2 года назад

    Good 👍👍👍👍👍

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

    Was method rightly explained ?
    Should I consider it for my exam

  • @user-gw6zn1kx9y
    @user-gw6zn1kx9y 4 месяца назад

    besttttt ever

  • @codingmania8856
    @codingmania8856 3 года назад +66

    Tree and answer are wrong because C[1,4] is 11 and C[0,4] is 19. so the root will be 3.

  • @manjirikulkarni805
    @manjirikulkarni805 5 лет назад +2

    c(1,4)=11

  • @shishpal512
    @shishpal512 2 года назад

    thanks bhai

  • @Zmayur143
    @Zmayur143 2 года назад +2

    Sir, can you please tell me what if the vertex is starting from 0 rather than 1?
    Means in your example vertex are 1,2,3,4
    but what if they are 0,1,2,3?
    I'm very confused in this situation.
    I can't ignore the previous value because of that 0.

    • @mihirnaidu5211
      @mihirnaidu5211 2 года назад +1

      Then we will take min nd consider 0s all values in (0,1) nd soo on!!!

  • @poojapatil4584
    @poojapatil4584 4 года назад

    Aapne sare box fill q nhi kiye

  • @rakshitmehra9199
    @rakshitmehra9199 4 года назад +2

    C(1,4)=11

  • @goonbanode7988
    @goonbanode7988 3 месяца назад

    C[0,4] is 14 is correct because we have to select the least value
    only c[1,4] is 11

    • @kashbeats3732
      @kashbeats3732 2 месяца назад

      Yes absolutely 14 is correct

  • @anupsingh9978
    @anupsingh9978 Год назад

    And cost of [0,4] will be 19

  • @djagadeshwar7983
    @djagadeshwar7983 2 года назад +1

    You not added w(1,4) in cost(1,4)

  • @suryakantasundaray932
    @suryakantasundaray932 2 года назад +1

    any doubt??
    ask me

  • @krishi2760
    @krishi2760 2 года назад

    Excellent explanation but values are wrongly calculated

  • @aishwaryatiwari3618
    @aishwaryatiwari3618 3 года назад +2

    what have u done....its a blunder....optimal weight is 19 not 14....tree is fully wrong...check before uploading

  • @spiritual487
    @spiritual487 3 месяца назад

    [1,4] is 14

  • @69miXxX
    @69miXxX Год назад

    Explain dynamic programming approach and apply it to construct optimal binary search tree using Huffman coding for weights given below
    (2,3,5,7,9,13)

  • @anshagarwal5999
    @anshagarwal5999 6 месяцев назад

    waah kya ladka hai

  • @satyammahajan2773
    @satyammahajan2773 3 года назад +4

    In C (1,3) it's coming 7 instead of 4 with root vertex 3

    • @deftme5440
      @deftme5440 2 года назад +3

      Don't include weight of 1 in the calculation of w(1,3), therefore weight will be 1+2 =3 , so calculation part will be ,
      C(1,3)=c(1,2)+c(3,3)+3
      C(1,3)= 1+0+3=4

    • @kushalbhatt6266
      @kushalbhatt6266 7 месяцев назад

      thanks bro

  • @suryakantasundaray932
    @suryakantasundaray932 2 года назад

    doubt?

  • @meenakshirawat6213
    @meenakshirawat6213 7 месяцев назад +1

    [1,3]=4. is it right??? my answer is different

    • @devanshgupta2772
      @devanshgupta2772 7 месяцев назад

      answer is wrong I filled all blocks
      C(1,4)=11
      C(0,4)=19
      And root is vertex 3

    • @devanshgupta2772
      @devanshgupta2772 7 месяцев назад

      Final Optimal BST :- 15
      / \
      5 20
      \
      10

  • @saurabhkumarkardam8782
    @saurabhkumarkardam8782 4 года назад +3

    Bhai apne ye neeche ke blocks kyon nhi fill kare

    • @sumitsharma5058
      @sumitsharma5058 3 года назад

      Coz there u got (0,0) vertices and it means value is nothing. Hope u understand

  • @amrit8445
    @amrit8445 2 года назад

    Half part kyu ni solve kiya apne

  • @VARINDERSINGH-zn8mp
    @VARINDERSINGH-zn8mp Год назад +2

    not a proper explanation does not tell how to fill block c[1,3] and c[2,4] , because of that man i waste my 3 hour ,dislike

  • @yunusahmed5799
    @yunusahmed5799 Год назад

    (1, 4) = 11 with root 4 and (0,4)=19 with root 3

  • @RaveenRajSingh
    @RaveenRajSingh 4 года назад

    Answer is wrong sir

  • @siddhantking7659
    @siddhantking7659 8 месяцев назад

    itne time me to 3 question solve hojayenge

  • @khedkarsonali1680
    @khedkarsonali1680 4 года назад

    answer is wrong...

  • @nikhilmatta6686
    @nikhilmatta6686 Год назад

    why we are not considering keys here 😅

  • @sumitsharma5058
    @sumitsharma5058 3 года назад

    Dislike to missed the typical part of the video..

  • @amrutkajave6787
    @amrutkajave6787 4 года назад +4

    c(1,4) = 4 ❌

  • @swapnilpatel9831
    @swapnilpatel9831 8 месяцев назад

    Wrong answer brooh!

  • @racingarena04
    @racingarena04 6 месяцев назад +1

    khud confuse h

  • @djagadeshwar7983
    @djagadeshwar7983 2 года назад

    It's wrong solution

  • @OmkarBcw
    @OmkarBcw 8 месяцев назад

    Bhai kaunsa answer sahi hai bata do kal exam hai
    🥲

    • @OmkarBcw
      @OmkarBcw 8 месяцев назад +1

      answer
      . 15
      / \
      5. 20
      \
      10

  • @prajwalmehare_
    @prajwalmehare_ 2 месяца назад

    barabar nahii samjta bhaii , thoda explanation , writing ka tarika improve karo
    😶😒😑😪

  • @btech_trader968
    @btech_trader968 8 месяцев назад

    Isko kuch ata nahi hai buus kuch bhi samjha raha hai

  • @btech_trader968
    @btech_trader968 8 месяцев назад

    Are acche se samjha phela khud Sikh ke aa

  • @amanchaurasiya3065
    @amanchaurasiya3065 4 года назад

    Thanks bhai