Find if a Number is power of Two

Описание к видео Find if a Number is power of Two

JOIN ME
—————
YouTube 🎬    / @cppnuts  
Patreon 🚀   / cppnuts  

TUTORIALS PLAYLIST
————————————
C++ Tutorial For Beginners:    • Introduction To C++  
STL (Standard Template Library):    • STL In C++  
ThreadIng In C++:    • Multithreading In C++  
Data Structures:    • Data Structure  
Algorithms:    • Binary Search  
Design Patterns:    • Factory Design Pattern in C++  
Smart Pointers:    • Smart Pointer In C++  
C++14:    • Digit Separator In C++  
C++17:    • std string_view in C++17 | Fastest St...  
C++ All Type Casts:    • static_cast In C++  


INTERVIEW PLAYLIST
————————————
C++ Interview Q&A:    • Structural Padding & Packing In C & C++  
C++ Interview Q&A For Experienced:    • How delete[] Knows How Much  To Deall...  
Linked List Interview Questions:    • Find Kth Node From Back In Singly Lin...  
BST Interview Questions:    • Search Element In Binary Search Tree ...  
Array Interview Questions:    • Reverse An Array  
String Interview Questions:    • Check String Is Palindrome Or Not  
Bit Manipulation Questions:    • Find Set Bit In Integer Number  
Binary Tree Interview Question:    • Invert Binary Tree  
Sorting Algorithms:    • Bubble Sort  
C++ MCQ:    • Видео  
C MCQ:    • What printf returns after printing? |...  
C Interview Questions:    • Designated Initialization In C  

Time Lines
=========
0:05 Introduction
0:39 Approach

In this video we will learn how to find the number is power of 2 or not?

This is very easy we can use formula like n&&!(n&(n-1)) and this should give you the result zero if number is power of two.
So we can see that this question can be solved using bit manipulation techniques.

#bitmanipulation #interview #dsa #bits #algorithms

Комментарии

Информация по комментариям в разработке