Bit Manipulation Interview Problems Solved Step by Step | Competitive Programming | Data Structures

Sdílet
Vložit
  • čas přidán 7. 07. 2024
  • Bit manipulation is a popular topic for programming job interviews. To crack coding interviews it is imperative to practise these problems on bit manipulation. Mastering coding problems helps in competitive programming. Master Data Structures and Algorithm now: www.scaler.com/events?...
    What is bit manipulation?
    Bit manipulation is the act of algorithmically manipulating bits or other pieces of data shorter than a word. Computer programming tasks that require bit manipulation include low-level device control, error detection and correction algorithms. Bit manipulation, in some cases, can obviate or reduce the need to loop over a data structure and can give many-fold speed-ups, as bit manipulations are processed in parallel, but the code can become more difficult to write and maintain.
    The following topics are covered in this bit manipulation tutorial:
    0:00 - Introduction
    1:05 - Importance of bit manipulation
    2:21 - Bit manipulation part 1
    1:05:10 - Bit manipulation part 2
    --------------------------------------- About Scaler -------------------------------------------------
    We are a tech-focused upskilling and reskilling platform catering to tech enthusiasts in universities and working professionals. There are more Scaler graduates working at Amazon than all of the IITs combined!
    Learn more about Scaler: bit.ly/3VKTuP5
    📌 Follow us on Social and be a part of an amazing tech community📌
    👉 Meet like-minded coder folks on Discord - / discord
    👉 Tweets you cannot afford to miss out on - / scaler_official
    👉 Check out student success stories, expert opinions, and live classes on Linkedin - / scalerofficial
    👉 Explore value packed reels, carousels and get access to exclusive updates on Instagram - / scaler_official
    📢 Be a part of our one of a kind telegram community: 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!
    czcams.com/users/Scaler?sub_co...
    #bitmanipulation #datastructures #competitiveprogramming

Komentáře • 5

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

    Question : for an input number N, return the minimum number possible K such that there are N distinct integers less than or equal to K with total XOR as 0.
    Example : for N = 4, minimum number possible is 5 as 2^3^4^5 = 0.
    How should we solve this?

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

    1:26:02 .
    Suppose the question is modified and is asking to return the min XOR the number can have in the array with any other remaining number, for every index.
    Then,
    This Approach fails for array [ 8,9,11,10,7,14]. As minimum XOR of 7 will be with 14 giving XOR = 9.
    XOR of 7^8 = 15 so the original approach will give answer 15 but that is not true imo.
    How should we proceed with such question ?

  • @phardik5610
    @phardik5610 Před 6 měsíci

    The first question , check if the ith bit is set or not, 0110 is six right , but given i=2, 1

  • @rajdipdas1329
    @rajdipdas1329 Před 2 lety

    sir at first you are taking one mask '010' which is comming from left shift of '001' and after that we are doing bitwise and.

  • @rahultoshniwal1533
    @rahultoshniwal1533 Před 2 lety

    1:28:36 8^7=15 8^5=13 8^3=11 ?