Maximum XOR of Two Numbers in an Array | using Trie Data Structure | DSA-One Course

Sdílet
Vložit
  • čas přidán 7. 09. 2024
  • Hey guys, In this video, We will be solving a problem known as the Maximum XOR of two numbers in an array. We'll be using the Trie Data Structure to optimize the solution.
    Practice here: practice.geeks...
    🥳 Join our Telegram Community:
    Telegram channel: telegram.me/re...
    Telegram group: telegram.me/ds...
    🚀 Follow me on:
    Instagram: / anuj.kumar.sharma
    Linkedin: / sharma-kumar-anuj
    Twitter: / realanujbhaiya
    💸 Use coupon code ANUJBHAIYA on GeeksforGeeks to avail discounts on courses!
    📚 Complete DSA Playlist: • DSA-One Course - The C...
    Complete Android Development Playlist: • Android Development Tu...
    Hashtags:
    #anujbhaiya #dsaone
    Ignore these tags:
    maximum xor of two numbers in an array
    anuj bhaiya java
    trie data structure
    dsp anuj bhaiya
    java anuj bhaiya
    maximum subset xor
    anuj kumar sharma
    array in dsa
    complete java dsa course
    concatenation of consecutive binary numbers
    data structure
    data structures and algorithms java
    maximum xor
    maximum xor of two numbers
    python for data analysis
    trie

Komentáře • 70

  • @sujoyseal195
    @sujoyseal195 Před rokem +7

    No BS , No 5 min introduction, No Faltu promotion . Straight to the point.

  • @sukhbirSinghMehra
    @sukhbirSinghMehra Před 2 lety +27

    Bhaiya bhale hi views kam aarhe hai last videos mai aap kabhi bhi band mat kijiye ye DSA course ya Koi aur course...All the best to you

  • @user-mm9qo4rt8c
    @user-mm9qo4rt8c Před rokem +5

    Thanks a ton, Anuj! This course helped me a lot to build a great knowledge base of fundamentals especially because I did not study computer science in college. This was a life saver for me to prep for interviews. Once again, Thank you Anuj Bhaiya 😊

  • @unbelievable1421
    @unbelievable1421 Před 2 lety +18

    It really help us a lot than imagined.
    Thank you for building such a informative course.
    We will be waiting for your next course to start.
    I hope you will start it sooner to provide us a lot more things to learn...

  • @sumittanwar7727
    @sumittanwar7727 Před 2 lety +7

    Starting today, was checking that course is completed or not!!
    just one word thanks

  • @sahilhansofficial
    @sahilhansofficial Před 2 lety +5

    Congratulations for 100 videos to all🥳🥳🥳
    OP bhaiya🥰🤗

  • @ashutoshkumar3921
    @ashutoshkumar3921 Před 2 lety +3

    bhai aag lgadi aag lgadi , patienly waiting for the next one ....

  • @shubhasaha595
    @shubhasaha595 Před 2 lety +7

    Hi, Anuj Bhaiya this is Shubha 🙂 First of all Thanks a lot for making this wonderful course ❤ so I started learning 2 month it's been and now today at 17 Sept 3.00am I finished this video lecture ..... TBH from this course I gained so much knowledge One thing you know I completed my B.tech in 2021 from Mechanical Engineering currently I'm working at Infosys. ... and I decided to go at Amazon it's my dream and I will do it. Thank you so much bhaiya again in these 2 month I learned so many things .... So, another one is I took a subscription at GFG self paced course so tomorrow onwards I will start for making a good coding skill further .... Again Thank you Bhaiya ❤ Love you bhaiya❤‍🩹❤‍🩹

  • @preetkatiyar969
    @preetkatiyar969 Před 2 lety +3

    Big fan bhaiya from your old apni kaksha channel to your golden Anuj Bhaiya new Channel from Day 0 to Day 100 this journey is very awesome and memorable for me
    You started this dsa course when no any course on dsa with java is available . THIS COURSE IS PRECIOUS FOR ME AND IT HELPS ME LOTS AND LOTS.
    THANKS ANUJ BHAI. And congratulations to you..

    • @nidaali4665
      @nidaali4665 Před 2 lety

      Do I need to learn java before started this DSA with java course

    • @preetkatiyar969
      @preetkatiyar969 Před 2 lety +3

      @@nidaali4665 ya Bro atleast you have to know syntax of java and having understanding of concept of this language and its collections framework
      I recommend for java language you can go with code with harry java playlist them anuj bhaiya,s collections framework video and then come here bro. Follow this pattern.

    • @nidaali4665
      @nidaali4665 Před 2 lety +1

      @@preetkatiyar969 Ok thanku for info 😊

    • @illuminatidaylight8566
      @illuminatidaylight8566 Před rokem

      Is this course best for interview preparation as well ??

  • @sharma68945
    @sharma68945 Před 2 lety +2

    You making DSA easy to understand

  • @AjitSingh-rg3zu
    @AjitSingh-rg3zu Před rokem

    I watched all videos and all the videos are very good for understanding of concepts and selection of questions is very good. Thanks a lot sir

  • @abhishridwivedi5367
    @abhishridwivedi5367 Před rokem +2

    Thank you bhaiya for this generous and selfless deed of yours. This course has helped me a lot and I want to stay consistent till I make it big. Can you please suggest what should I take up next after finishing this course? Thanks one again🙂.

  • @Anonymous-ij7cw
    @Anonymous-ij7cw Před 2 lety +3

    please make topic wise playlist of your dsa course it will be very helpful

  • @EkAurEngineer1011
    @EkAurEngineer1011 Před rokem +1

    Thank you bheya for all your efforts and for completing the dsa playlist . I was start learnig java and dsa from you when you are educator in apnikaksaha and i am finished my dsa here . I t is a great experience and pleasure ton learn things from you . I hope i can meet you personally and thank you personally . Wish me a luck for upcoming placement season . Thank you ❤❤❤

    • @shivanshshekherojha2599
      @shivanshshekherojha2599 Před rokem

      Bro I had a question is this series complete??Like this sums up all DSA concepts?

    • @EkAurEngineer1011
      @EkAurEngineer1011 Před rokem +1

      @@shivanshshekherojha2599 Almost yes except some advanced concepts. And some important concepts like dp , tree are very big and have many questions. But bheya did some basic and classic questions. Other then it is good for beginners. After one complete it they can simply understand and learn advanced concepts.

    • @shivanshshekherojha2599
      @shivanshshekherojha2599 Před rokem

      @@EkAurEngineer1011 oh great basically this sets the base and make it feasible for learning advanced concept at quicker speed???Btw best wishes for your upcoming placements....

  • @SANJAY-yg3fp
    @SANJAY-yg3fp Před rokem +1

    THANK YOU SO MUCH...VERY HELPFUL BRO.......

  • @sanathkumarshenoy9955
    @sanathkumarshenoy9955 Před 2 lety +3

    Congratulations

  • @LaveshGarg
    @LaveshGarg Před 2 lety

    Amazing bhaiya you are the bestest coding teacher on this planet

  • @chandrakant05
    @chandrakant05 Před rokem

    Thanks bhaiya for such a great playlist

  • @rishikeshkmr
    @rishikeshkmr Před 6 měsíci +1

    Thanks 🙏

  • @alquatrader859
    @alquatrader859 Před rokem +1

    badhiya tha bhaiya.

  • @akshaysingh2045
    @akshaysingh2045 Před 2 měsíci

    I enjoyed learning this dsa one course, really helpful Anuj bhaiya you are a genius!🤌🏻

  • @animeshbarole
    @animeshbarole Před 2 lety +11

    Consistency OP in the chat Guys 😍🥵

  • @coldstone87
    @coldstone87 Před rokem

    Bahuth shaandar. Thanks a lot.

  • @adityasarkar7201
    @adityasarkar7201 Před 9 měsíci

    Hey anuj bhaiya could you please let me by completing these 100 videos playlist is these enough for our placement means all topics are covered or not.

  • @amanjain5154
    @amanjain5154 Před 2 lety +2

    Why did the second loop in the function max_xor starts with 1 ? Can somebody explain?

  • @RKxtar
    @RKxtar Před rokem

    Thank You Bhaiyya😁✌️🎉🎊🤗💖💝

  • @anchalsehgal7779
    @anchalsehgal7779 Před 2 měsíci

    sir similary please explain maximize and

  • @Rajeshkumar-hs5hi
    @Rajeshkumar-hs5hi Před 8 měsíci

    Can we use 0,1 knapsack algo to solve this problem ?

  • @ujjwalkumar8577
    @ujjwalkumar8577 Před 2 lety

    We can also sort the array and maximise the xor value of two adjacent elements in the sorted array.

  • @rahulkrishna304
    @rahulkrishna304 Před rokem

    great explanation!

  • @abhishekanand2163
    @abhishekanand2163 Před 2 lety +3

    Bhaiya ,please make video on Segment tree .

    • @AnujBhaiya
      @AnujBhaiya  Před 2 lety +6

      Will try to make a video on this soon

  • @priyankanarekar7983
    @priyankanarekar7983 Před rokem

    really helpful😊

  • @chaudharysandeep6214
    @chaudharysandeep6214 Před rokem

    Hello bhaiya.
    Is this your cource is enough for product base placement point of view.

  • @amitjoshi7309
    @amitjoshi7309 Před rokem +2

    Is this series complete?

  • @atulyajaiswal5022
    @atulyajaiswal5022 Před rokem

    Great one✌️✌️

  • @saritaprasad4295
    @saritaprasad4295 Před rokem

    thanks you

  • @user-pj1wv1ns9x
    @user-pj1wv1ns9x Před rokem

    Superb

  • @UPEShahidAnawarMamud-km6mh

    Bhaiya thanks

  • @abhishekanand2163
    @abhishekanand2163 Před 2 lety +4

    Make DSA two course

    • @AnujBhaiya
      @AnujBhaiya  Před 2 lety +4

      Hahaha, not for a while now 😄

    • @nehamartand7499
      @nehamartand7499 Před rokem

      What is this DSA one and DSA Two??? Could you please tell me? :)

    • @dudamneerajdattu1459
      @dudamneerajdattu1459 Před rokem

      @@nehamartand7499 did you got the answer, is this playlist is not the complete ones?

  • @heighlights012
    @heighlights012 Před rokem +4

    here is the answer:---------
    class Solution
    {
    static class TrieNode
    {
    TrieNode one,zero;
    }
    static void insert(TrieNode root,int n)
    {
    TrieNode curr=root;
    for(int i=31;i>=0;i--)
    {
    int bit=(n>>i)&1;
    if(bit==0)
    {
    if(curr.zero==null)
    {
    TrieNode newNode=new TrieNode();
    curr.zero=newNode;
    }
    curr=curr.zero;
    }
    else
    {
    if(curr.one==null)
    {
    TrieNode newNode=new TrieNode();
    curr.one=newNode;
    }
    curr=curr.one;
    }
    }
    }
    static int findmax(TrieNode root,int n)
    {
    TrieNode curr=root;
    int ans=0;
    for(int i=31;i>=0;i--)
    {
    int bit=(n>>i)&1;
    if(bit==1)
    {
    if(curr.zero!=null)
    {
    ans+=(1

  • @kaustubh_ramteke_07
    @kaustubh_ramteke_07 Před rokem

    is this playlist complete

  • @harshsrivastava2324
    @harshsrivastava2324 Před 2 lety

    prog.java:26: error: class, interface, or enum expected
    can you please tell me why I got this error

    • @youthoober21
      @youthoober21 Před 2 lety

      Hame kaise pata line number 26 pe kya likha h tumne.. 😂

    • @harshsrivastava2324
      @harshsrivastava2324 Před 2 lety

      @@youthoober21 code hi copy nahi hua sorry😂

  • @priyankapriyadarshini25
    @priyankapriyadarshini25 Před 2 lety +2

    100th 🥳👩‍💻

  • @amitbindra873
    @amitbindra873 Před 2 lety +2

    bhaiya aap to vaade ke pakke ho.

  • @fashionableipsita2952
    @fashionableipsita2952 Před 2 lety

    Hello bhayiya plzs help me.. mera ghar pe ki family pe koi nehi haii batane wala kya karu kya nehi.. actually mera problem haii mera diploma ke badd 2 yr gapp haii job kar rehithi non it field pe fir mee B-Tech kiya huh.... Me tcs Wipro saree mnc pe apply kar rehi huh..lekhin qu merea ko koi link nehi aaaraha haii test ke liye plzzz bhayiya help me🥺😭😭😭 I'm so helplessness

    • @satyamdhiwar5103
      @satyamdhiwar5103 Před rokem

      Aap aise har mat mano tcs wipro me one year gap hi allowed rehta h aur bhi bahut company me aisa h ,par aur bhi bahut saare company hai jinko year gap se matlb nhi rehta aap waha try karo

  • @abdullahanis5761
    @abdullahanis5761 Před 2 lety +4

    Is this a final video of DSA One.?

  • @anilreddy9654
    @anilreddy9654 Před 2 lety +1

    English

  • @kj2822
    @kj2822 Před rokem

    ✨✨✨✨

  • @abhishekdhakne4879
    @abhishekdhakne4879 Před rokem

    1111 == 15 not 17

  • @Deepakmishra-kv1kb
    @Deepakmishra-kv1kb Před 2 lety

    bohot fast bolte ho bhai,thoda sa slow bologe to logo ko dikkat km hogi