Lecture 79: Trie & its Implementation || C++ Placement Series

Поділитися
Вставка
  • Опубліковано 4 лют 2025

КОМЕНТАРІ • 407

  • @solarchat9413
    @solarchat9413 2 роки тому +53

    You said you will complete for sure, and here you are.
    Thanks 👍

  • @aryanmaniyar7301
    @aryanmaniyar7301 Рік тому +8

    Bhaiya, itna quality content free mein provide karna is not a joke! Bilkul samajh sakte hai ki aapko bhi aapke personal kaam hote hai, so thank you so much for taking your time out for this :)

  • @manavsharma142
    @manavsharma142 17 днів тому +2

    Hats off to your hardwork and dedication bhaiya ....Please never change yourself , you are a great person

  • @shraddhasingh8574
    @shraddhasingh8574 2 роки тому +21

    learning from this series since 3 months, really helpful to me . thank you for your hard work you're doing a really good job

  • @AshishSharma-ly9lg
    @AshishSharma-ly9lg 21 день тому +1

    Your window which turned from daylight to dark in a single video motivated me to work with consistency no matter what!!

  • @amarparajuli692
    @amarparajuli692 2 роки тому +3

    Waaahhh..... Iss series se koii v Noob apni programming skills ko behtaar bana saktaa hai.🔥🔥

  • @anushkayachit
    @anushkayachit 2 роки тому +86

    Finalllyyyyy... Aagaye aap.... Don't worry we are here only.... We know you'll complete this series 🔥🔥

    • @bollywoodmaestro4553
      @bollywoodmaestro4553 2 роки тому +1

      koi idea h aur kitne time chalega ye series

    • @sandeep_khariwal8137
      @sandeep_khariwal8137 2 роки тому +1

      @@bollywoodmaestro4553 jo abhi flow chl rha h series ka... according to that 2months lg jayenge...agr bhaiya dubara flow me aa jate h to ye series within 1month me ho jayegi...jo ki ab flow me aana mushkil h 😭...."Look on us bro we are dependent on you"😑

    • @MukeshKumar-fz3sw
      @MukeshKumar-fz3sw 2 роки тому

      Why here created two different-different class trienode and trei pls help

    • @devesharya5184
      @devesharya5184 7 місяців тому

      @@MukeshKumar-fz3sw because, tree is the set of all nodes created, so we make tree node by node.

  • @AyurvedaAddict
    @AyurvedaAddict Рік тому +3

    The Most Ever Easy Explanation of Trie...
    My first video on Trie and understood it fully.. in one time ✅✅

  • @anshikasingh4158
    @anshikasingh4158 Рік тому +1

    sir aap toh sach mein din raat mehnat karte ho. video shuru hui thi toh din tha, raat ho gyi khatam hote hote. respect++;inspiration=babbar

  • @tmhd48_abhishekbade78
    @tmhd48_abhishekbade78 2 роки тому +65

    Brother, Your teaching method is ingenious I am big fan. RUN machine = VIRAT KOHLI (Sir) CODE machine = BABBAR (Sir)

  • @govindsuryavanshi6653
    @govindsuryavanshi6653 Рік тому +8

    First I have completed all DSA series and now conclude this is Greatest ever DSA series to exists on youtube or paid courses. Your contribution will be remembered. You're God of DSA for us🙇‍♂ Thanks you.

  • @aparnamanna1369
    @aparnamanna1369 2 роки тому +8

    Finally 😎 bhaiya is back ,
    Bhaiya placement series discontinue mat karna
    I'm literally enjoying your series

  • @virendrakeshri6072
    @virendrakeshri6072 2 роки тому +1

    thanks bhaiya aap plz continue karo aap sahi me bahut acha padhate ho ye dsa ka best course ho sakta h you tube par plz bhaiya discontinue mat karna

  • @RaviRana-d2w
    @RaviRana-d2w Рік тому

    I have implemented by myself just by listening till 11:13. Thank you Babbar Bhaiya 😃

  • @sandipmedhe1201
    @sandipmedhe1201 2 роки тому

    Thank you bhaiya aap vapas aa gaye hume pura bharosa hai ki aap isko pura complete kar ke rahoge because your are the love bhaiya

  • @RohitKumar-oo8lo
    @RohitKumar-oo8lo 2 роки тому +11

    Bhaiya, plz 30 April tak khatam kardo, jitna jaldi khatam hoga utna zyada hum khudse aur practice kar paaynge questions..Especially graph aur DP k...Please !! ♥♥

  • @human75788
    @human75788 2 роки тому +2

    One word : Love Babbar❤ Sir, just outstanding.

  • @aakashbhargavaa
    @aakashbhargavaa 2 роки тому +5

    Thanks for continuing this course. Thank you so much.

    • @MukeshKumar-fz3sw
      @MukeshKumar-fz3sw 2 роки тому

      Why here created two different-different class trienode and trei pls help

    • @HARRY-xz1hf
      @HARRY-xz1hf Рік тому

      @@MukeshKumar-fz3sw did you get the answer

  • @sukhjitsingh959
    @sukhjitsingh959 2 роки тому +8

    Babar I can understand you and trust you ....there is no any need to think even about your commitment in suspicious way .... 👍 So I trust your thoughts so thanks for you such course and thoughts .......you have ... 👍

    • @itsaayush7357
      @itsaayush7357 Рік тому

      To edit karke theek kr le na😂

    • @therealartist9
      @therealartist9 11 місяців тому

      @@sukhjitsingh959 bhai nxt level hai tu nayi bna diya teacher ko😆

    • @sukhjitsingh959
      @sukhjitsingh959 11 місяців тому

      @@therealartist9 bahi toon tu mere se bhi next level hai ...abhi professionals wali baat nahi tujh mein ....

    • @therealartist9
      @therealartist9 11 місяців тому

      @@sukhjitsingh959 mcc tune professional bankar kya kar liye ?? corporate ke majdoor

    • @sukhjitsingh959
      @sukhjitsingh959 11 місяців тому

      @@therealartist9 Teri ukaad ka frakh dikhta hai ... Putraa ethey Tera Bappu bethaa pange nahi laydee ... Text tu pattaa lagda Teri ukaad da .... Kar te mein bahut kuch laya... ... Tere Paley nahi panee

  • @RiteshYadav-lh4wo
    @RiteshYadav-lh4wo 10 місяців тому

    00:00 Implementing a dictionary with three operations: insertion, search, and removal.
    02:22 Trie data structure implementation in C++
    07:47 Implementation of Trie data structure in C++
    10:50 Understanding the structure of the trie data structure.
    16:48 Introduction to Trie data structure
    19:50 Understanding the implementation of Trie
    25:11 Trie node types
    28:45 Trie data structure and its implementation in C++
    33:43 Removing words from a trie and optimizing space.
    35:50 Trie is a data structure used for efficient space utilization and optimal utilization.
    40:36 Implementation of Trie data structure in C++
    43:08 Understanding the implementation of Trie data structure
    Crafted by Merlin AI.

  • @VivekSharma-lr7kx
    @VivekSharma-lr7kx 4 місяці тому +2

    calling the function length of word times
    but for each calling you are passing the string hence the
    for every call there is creating a string of size(n-1) hence '
    for inserting with recurstion it is O( len*len);

    • @Mkhuss
      @Mkhuss Місяць тому

      Yes. To optimize this, u can add a more parameter to the function "index", and u can call the function as index+1 for next call

  • @Satya-g5t
    @Satya-g5t 2 місяці тому

    Patiently and well explained every problem.

  • @human75788
    @human75788 2 роки тому +5

    Just watching your explanation and class building only I myself wrote both iterative & recursive solutions of build a trie from scratch in leetcode, both were 100% correct. Your explanation is just too simple and easy to understand.

  • @anuptewary3016
    @anuptewary3016 2 роки тому +2

    Bhaiya tension na lo we all are with you ❤️🔥

  • @_KARAN-699
    @_KARAN-699 8 місяців тому +3

    29:20 we do not need to make child in searching we can directly do this!!
    int index = word[0] - 'A';
    if (root->children[index] != NULL)
    {
    return searchUtil(root->children[index], word.substr(1));
    }
    else
    {
    return false;
    }
    }

  • @supersuperhero2449
    @supersuperhero2449 Рік тому +1

    In deleting, while returning do free(child) ; to free the space
    , make root->isterminal=false , for making nonterminal to last character of word so word doest comes in search while searching

  • @sharatpaul
    @sharatpaul 2 роки тому +3

    If we consider uppercase and lowercase then there should be 26*2=52 possible paths from a node

    • @fnGamingz
      @fnGamingz 2 роки тому +4

      no, better to convert the input to lowercase always.

    • @lakshitgoel8481
      @lakshitgoel8481 Рік тому +1

      ​@@fnGamingzbut in that case, you will lost the original input from the user, which is not a good practice

  • @awesomepatt620
    @awesomepatt620 2 роки тому +3

    Awesome content bhaiya..waiting for your LIVE course very anxiuosly

  • @dewanshyadav6033
    @dewanshyadav6033 2 роки тому +2

    full trust on you bhaiya ♥️👍👍👍

  • @UEEANILKUMAR
    @UEEANILKUMAR 2 роки тому +1

    Thank you so much for coming 🙏🙏🙏. We fully trust on you .

  • @itsaayush7357
    @itsaayush7357 Рік тому

    At last me when bhaiya said..
    "Pr vo bhoola nahi he"..
    Sounds like a movie dialogue 🔥

  • @ShridharSarda
    @ShridharSarda 19 днів тому

    Thanks for this course Bhaiya ,consistency++

  • @rajshrivastava906
    @rajshrivastava906 2 роки тому +1

    Thank you so much bhaiya for continuing this series.

  • @sounaksaha1455
    @sounaksaha1455 2 роки тому +3

    space optimization in trie is OP. 🔥🔥🔥

    • @sumitkanth5349
      @sumitkanth5349 Рік тому

      how space can we optimized in remove function ?

    • @rishisharma3867
      @rishisharma3867 Рік тому

      @@sumitkanth5349 traverse to the last character node then start deleting the node in reverse order one by one until u found isTerminal = true for a node

  • @parthtrivedi318
    @parthtrivedi318 2 роки тому +1

    Thank you bhaiya hamare liye itne efforts karneke liye

  • @krishan9739
    @krishan9739 5 місяців тому

    Hashset and Trie are not explained in detailed. At least not like others. These are the most important data structure and you solved very few questions for both.

  • @Lucifer_movies
    @Lucifer_movies 2 роки тому +2

    We have full trust on you bhaiya ♥️

  • @prashantbirajdar9271
    @prashantbirajdar9271 2 роки тому

    maza aaa gyaa sir swad+++ subkuch samaj aya achhe see..... love you sirr and consisitancy+++

  • @mkat21
    @mkat21 Рік тому

    Bhaiya OP.bas ese hi maan kar rha tha bolne ka toh bol dia.😂

  • @utkarshsingh1457
    @utkarshsingh1457 2 роки тому +2

    Thanks for the beautiful content Bhaiya ❤️❤️

  • @excelexpertclasses6776
    @excelexpertclasses6776 Рік тому

    learned much from this video babbar ji thank you

  • @sushilsahu5719
    @sushilsahu5719 2 роки тому +2

    Thanks you bhaiya for quality content 🤗♥️

  • @gatikalagh39
    @gatikalagh39 Рік тому +1

    good teaching skills

  • @inspiringzone12
    @inspiringzone12 2 роки тому +1

    Thank you so much for coming back bhaiya

  • @skchoudhary4122
    @skchoudhary4122 2 роки тому +2

    Trie color🔥🔥

  • @niharbastia5740
    @niharbastia5740 2 роки тому +1

    Full support bhaiya❤️💙... Keep up the consistency 💥⚔️

    • @MukeshKumar-fz3sw
      @MukeshKumar-fz3sw 2 роки тому

      Why here created two different-different class trienode and trei pls help

  • @saritaprasad4295
    @saritaprasad4295 2 роки тому +1

    Great explanation! I am here to strong DSA

  • @shailenkaushik4910
    @shailenkaushik4910 2 роки тому +2

    Awesome explanation,Sawad++😅😅

  • @Vije860
    @Vije860 2 роки тому

    Finally new video comes 😁😁
    Welcome back bhaiya 🙏🙏

  • @arpitrajput6424
    @arpitrajput6424 2 роки тому +1

    Finally Achhe din Phir aa Gaye😎😎 Present++

  • @eprithvikushwah4754
    @eprithvikushwah4754 Рік тому

    hmesha maza aata h love bhaiya

  • @justjellytechnology3462
    @justjellytechnology3462 9 місяців тому

    35:20 at this how we can optimise the space. Suppose we remove TIS word from trie then TIME will impact. Can you solve my problem. I can't understand this point

    • @chayanmallick939
      @chayanmallick939 7 місяців тому +1

      Just start from the bottom and check if it has any child nodes then dont delete it if not then delete that node.

    • @justjellytechnology3462
      @justjellytechnology3462 7 місяців тому

      @@chayanmallick939 Tnx..

  • @aashishrangdal9614
    @aashishrangdal9614 2 роки тому +3

    Bhaiyya consistency dikhao zara😅😅
    Plz daily videos dalne ki koshish kro⚡⚡🔥🔥

  • @adityavishwakarrma514
    @adityavishwakarrma514 2 роки тому +1

    Yo yo video a gyi😀😀

  • @rachit_joshi
    @rachit_joshi 7 місяців тому

    Thank You So Much BHRATA SHREE !!!!!!!

  • @raisanjeeb42
    @raisanjeeb42 2 роки тому

    Nice Explanation bhaiya..Crystal Clear🔥🔥

  • @KratosProton
    @KratosProton 2 роки тому

    Aap hi ka intezaar thaa....

  • @mkp189
    @mkp189 2 роки тому +2

    How dud your lower case input give matching?? Index was calculated based on upper case so overflow hona chahiye tha since children only 26

    • @ShubhamKumar-rh3dz
      @ShubhamKumar-rh3dz 2 роки тому

      shi bol rha bhai..mere me fss gya tha.. fir maine index ke liye lower case use kiya

  • @akashjha822
    @akashjha822 2 роки тому

    East or west Babbar Bhaiya Is The Best

  • @mukeshkir1991
    @mukeshkir1991 2 роки тому +2

    sir ji ...greedy algorithm bhi karayoge na .....🧡🧡😥😥...please reply ...lots of love from mount-abu

  • @b-237-abhishekmishra7
    @b-237-abhishekmishra7 2 роки тому +1

    Thank you bhaiya very helpful video ❤️

  • @parasmanku7536
    @parasmanku7536 4 місяці тому +1

    What is the refresh rate of this monitor ?

  • @CosmicJewelss
    @CosmicJewelss 4 місяці тому

    but sir agar koi do ka prefix search karega aur do removed hoga toh us case mein prefix search toh true return karega

  • @Harish50602
    @Harish50602 Рік тому +1

    Bhaiya as you mentioned Trie uses less memory than hashmap by showing those 5 words ARE,ARM,ARENA,ARMDILO,ARDENO in these words if i try to search ARM will it not show false as isTerminal will be false in the node M ?

  • @divyanshupant3892
    @divyanshupant3892 5 місяців тому

    swaad agayaaaaa

  • @KratosProton
    @KratosProton 2 роки тому +1

    Great explaination

  • @anmolkumar01
    @anmolkumar01 9 місяців тому

    cout

  • @adityaprasad2298
    @adityaprasad2298 Рік тому +4

    solution for removal of word:
    void removeUtil(trienode* root,string word){
    if(word.length()==0){
    root->isTerminal=false;
    cout

  • @RohitKumar-oo8lo
    @RohitKumar-oo8lo 2 роки тому +1

    Abhi mazza aayga na Bidu!! :D

  • @memorybyshubhammanitripath4368
    @memorybyshubhammanitripath4368 2 роки тому

    Bhaiya code section update kar do 🙏😁
    By the way maja bahut aaya
    Bola tha na 19 April ko catchup kar lunga course
    So 18 April ko hi done
    Bahut maja aa raha bhaiya 🙏🙏🙏🙏

  • @rishabhupadhyay8165
    @rishabhupadhyay8165 2 роки тому +1

    Thnx

  • @anandprateekbaranwal8275
    @anandprateekbaranwal8275 2 роки тому

    Awesome going bhaiya 💥

  • @dipakkumarsingh.7151
    @dipakkumarsingh.7151 4 місяці тому

    maja aagaya....

  • @jaydwarkadhish959
    @jaydwarkadhish959 2 роки тому +1

    Sir amazing video

  • @eprithvikushwah4754
    @eprithvikushwah4754 Рік тому

    love from 3 tier college❤❤

  • @cowopar
    @cowopar 28 днів тому

    sir design patterns bhi padha do

  • @amanprajapati3417
    @amanprajapati3417 2 роки тому

    I am not able to understand this in first go, but eventually get to know the concept

    • @Everydayshorts913
      @Everydayshorts913 2 роки тому

      if you are still confused than you can contact me

    • @simranbandhu9926
      @simranbandhu9926 2 роки тому

      @@Everydayshorts913 my search function is giving wrong output

    • @simranbandhu9926
      @simranbandhu9926 2 роки тому

      @@Everydayshorts913 I'll be greatful to you if you can explain me.

    • @Everydayshorts913
      @Everydayshorts913 2 роки тому

      @@simranbandhu9926 your code please

  • @ayushgoel4145
    @ayushgoel4145 2 роки тому

    Dhanywaad Bhaiya!

  • @kungagyaltsenlachungpa8915
    @kungagyaltsenlachungpa8915 2 роки тому +1

    Bhaiya, can you do more questions on hashmaps as you said in that last video?

  • @AnaghAngira
    @AnaghAngira 2 роки тому

    Thankx bhaiya aapki awaj suune ke liye Kan taras rahe the

  • @AmandeepSingh-cs3we
    @AmandeepSingh-cs3we Рік тому +1

    Won't the time complexity be O(length^2) cuz we are doing substr, which also takes O(length)?

  • @venkateshpk7822
    @venkateshpk7822 9 місяців тому

    nice explanation bhaiya

  • @bhavyasharma3500
    @bhavyasharma3500 2 роки тому

    Thanks Babbar Bhai !!

  • @mr.himanshu4299
    @mr.himanshu4299 2 роки тому

    keep uploading babbar bhai

  • @letsgo8640
    @letsgo8640 Рік тому

    Wonderful!

  • @vedantdeshmukh4949
    @vedantdeshmukh4949 2 роки тому

    Babbar sher is back!

  • @iteself_me
    @iteself_me Рік тому

    296 ✅completed 👍Liked 1:22

  • @Undertaker1122
    @Undertaker1122 2 роки тому

    🙌🙌🙌dil se respect

  • @sane_aalam
    @sane_aalam 2 роки тому

    Present Bhaiya ❤️⌚

  • @rajkumarojha1028
    @rajkumarojha1028 2 роки тому

    Maza agaya bhaiya ❤️

  • @sanskarkumar028
    @sanskarkumar028 Рік тому

    thanks love bhaiya

  • @sounaksaha1455
    @sounaksaha1455 2 роки тому +1

    Bhaiya back in business, please aab chorke na jaiyo.

  • @jagritiyadavv
    @jagritiyadavv Рік тому

    why is it not word.length()==1? because we should be checking the condition isTerminal for the last character......

    • @kishan_psd
      @kishan_psd Рік тому

      root points to the last node in case of word.length() == 0. But, it points to the prefix of last node in case of word.length() == 1.

  • @shivkumar-og4ow
    @shivkumar-og4ow 2 роки тому +2

    present guru ji .. consistency ++ . we know you have complete this series..

  • @BornHubisLive
    @BornHubisLive 2 роки тому

    Thanks a lot bhaiya....

  • @sumitkanth5349
    @sumitkanth5349 Рік тому +1

    how space can we optimized in remove function ?

  • @fazerugbrug439
    @fazerugbrug439 2 роки тому +1

    superb

  • @itzheavem4451
    @itzheavem4451 2 роки тому

    great video 👍

  • @pratik_code
    @pratik_code 2 роки тому +2

    Java Code For Trie
    -------------------------------------------------------------------------------------
    class TrieNode{
    char data;
    TrieNode[] children=new TrieNode[26];
    boolean isTerminal;

    TrieNode(char ch) {
    data=ch;
    for(int i=0;i

  • @iutkarshmehta
    @iutkarshmehta 2 роки тому +1

    Reach++
    Attendance marked✅