Skip to content
geeksforgeeks
  • Tutorials
    • Python
    • Java
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
    • Practice Coding Problems
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • DSA Tutorial
  • Data Structures
  • Algorithms
  • Array
  • Strings
  • Linked List
  • Stack
  • Queue
  • Tree
  • Graph
  • Searching
  • Sorting
  • Recursion
  • Dynamic Programming
  • Binary Tree
  • Binary Search Tree
  • Heap
  • Hashing
  • Divide & Conquer
  • Mathematical
  • Geometric
  • Bitwise
  • Greedy
  • Backtracking
  • Branch and Bound
  • Matrix
  • Pattern Searching
  • Randomized
Open In App
Next Article:
Inclusion Exclusion principle for Competitive Programming
Next article icon

Bitwise Hacks for Competitive Programming

Last Updated : 20 Apr, 2023
Comments
Improve
Suggest changes
Like Article
Like
Report
Prerequisite: It is recommended to refer Interesting facts about Bitwise Operators 

How to set a bit in the number 'num':

If we want to set a bit at nth position in the number 'num', it can be done using the 'OR' operator( | ).  

  • First, we left shift '1' to n position via (1<<n)
  • Then, use the 'OR' operator to set the bit at that position. 'OR' operator is used because it will set the bit even if the bit is unset previously in the binary representation of the number 'num'.

Note: If the bit would be already set then it would remain unchanged.

C++
#include<iostream> using namespace std; // num is the number and pos is the position  // at which we want to set the bit. void set(int & num,int pos) {      // First step is shift '1', second      // step is bitwise OR      num |= (1 << pos); } int main() {      int num = 4, pos = 1;      set(num, pos);      cout << (int)(num) << endl;      return 0; } 
Java
/*package whatever //do not write package name here */  import java.io.*;  class GFG {     public static void main (String[] args) {         int num = 4, pos =1;           num = set(num, pos);           System.out.println(num);     }       public static int set(int num, int pos){           // First step is shift '1', second          // step is bitwise OR           num |= (1 << pos);           return num;     } }  // This code is contributed by geeky01adash. 
Python3
# num = number, pos = position at which we want to set the bit def set (num, pos):   # First step = Shift '1'   # Second step = Bitwise OR   num |= (1 << pos)   print(num)    num, pos = 4, 1  set(num, pos)  # This code is contributed by sarajadhav12052009 
C#
using System;  public class GFG{      static public void Main ()     {       int num = 4, pos = 1;       set(num, pos);     }        // num = number, pos = position at which we want to set the bit     static public void set(int num, int pos)     {       // First Step: Shift '1'       // Second Step: Bitwise OR       num |= (1 << pos);       Console.WriteLine(num);     } }  // This code is contributed by sarajadhav12052009 
JavaScript
<script> // num is the number and pos is the position  // at which we want to set the bit. function set(num,pos) {      // First step is shift '1', second      // step is bitwise OR      num |= (1 << pos);      console.log(parseInt(num)); }  let num = 4; let pos = 1; set(num, pos);  // This code is contributed by akashish__  </script> 

Output
6

Time Complexity: O(1)
Auxiliary Space: O(1)

We have passed the parameter by 'call by reference' to make permanent changes in the number.

2. How to unset/clear a bit at n'th position in the number 'num' : 

Suppose we want to unset a bit at nth position in number 'num' then we have to do this with the help of 'AND' (&) operator.

  • First, we left shift '1' to n position via (1<<n) then we use bitwise NOT operator '~' to unset this shifted '1'.
  • Now after clearing this left shifted '1' i.e making it to '0' we will 'AND'(&) with the number 'num' that will unset bit at nth position.
C++
#include <iostream> using namespace std; // First step is to get a number that  has all 1's except the given position. void unset(int &num,int pos) {     //Second step is to bitwise and this  number with given number     num &= (~(1 << pos)); } int main() {     int num = 7;     int  pos = 1;     unset(num, pos);     cout << num << endl;     return 0; } 
Java
/*package whatever //do not write package name here */  import java.io.*;  class GFG {     public static void main(String[] args)     {         int num = 7, pos = 1;         num = unset(num, pos);         System.out.println(num);     }     public static int unset(int num, int pos)     {         // Second step is to bitwise and this  number with         // given number         num = num & (~(1 << pos));         return num;     } } 
Python3
# First Step: Getting which have all '1's except the # given position   def unset(num, pos):     # Second Step: Bitwise AND this number with the given number     num &= (~(1 << pos))     print(num)   num, pos = 7, 1  unset(num, pos) 
C#
using System;  public class GFG {      static public void Main()     {         // First Step: Getting a number which have all '1's         // except the given position         int num = 7, pos = 1;         unset(num, pos);     }     static public void unset(int num, int pos)     {         // Second Step: Bitwise AND this number with the         // given number         num &= (~(1 << pos));         Console.WriteLine(num);     } } 
JavaScript
// First step is to get a number that  has all 1's except the given position. function unset(num,pos) {     //Second step is to bitwise and this  number with given number     num &= ( ~ (1 << pos));     return num; } let num = 7; let  pos = 1; console.log(unset(num, pos));  // This code is contributed by akashish__ 

Output
5

Time Complexity: O(1)
Auxiliary Space: O(1)

3.  Toggling a bit at nth position :

Toggling means to turn bit 'on'(1) if it was 'off'(0) and to turn 'off'(0) if it was 'on'(1) previously. We will be using the 'XOR' operator here which is this '^'. The reason behind the 'XOR' operator is because of its properties. 

  • Properties of 'XOR' operator. 
    • 1^1 = 0
    • 0^0 = 0
    • 1^0 = 1
    • 0^1 = 1
  • If two bits are different then the 'XOR' operator returns a set bit(1) else it returns an unset bit(0).
C++
#include <iostream> using namespace std; // First step is to shift 1,Second step is to XOR with given // number void toggle(int& num, int pos) { num ^= (1 << pos); } int main() {     int num = 4;     int pos = 1;     toggle(num, pos);     cout << num << endl;     return 0; } 
Java
/*package whatever //do not write package name here */  import java.io.*;  class GFG {     public static void main (String[] args) {         int num = 4, pos =1;           num = toggle(num, pos);           System.out.println(num);     }       public static int toggle(int num, int pos){           // First step is to shift 1,Second step is to XOR with given number         num ^= (1 << pos);           return num;     } }  // This code is contributed by geeky01adash. 
Python3
def toggle(num, pos):   # First Step: Shifts '1'   # Second Step: XOR num   num ^= (1 << pos)   print(num)       num, pos = 4, 1  toggle(num, pos)  # This code is contributed by sarajadhav12052009 
C#
using System;  public class GFG{      static public void Main ()     {       int num = 4, pos = 1;       toggle(num, pos);     }     static public void toggle(int num, int pos)     {       // First Step: Shift '1'       // Second Step: XOR num       num ^= (1 << pos);       Console.WriteLine(num);     } }  // This code is contributed by sarajadhav12052009 
JavaScript
function toggle(num, pos) {      // First step is to shift 1,Second step is to XOR with given number     num ^= (1 << pos);     return num; }  let num = 4,     pos = 1; num = toggle(num, pos); console.log(num);  // This code is contributed by Prajwal Kandekar 

Output
6

Time Complexity: O(1)
Auxiliary Space: O(1)

4. Checking if bit at nth position is set or unset: 

It is quite easily doable using the 'AND' operator.

  • Left shift '1' to given position and then 'AND'('&').
C++
#include <iostream> using namespace std;  bool at_position(int num, int pos) {     bool bit = num & (1 << pos);     return bit; }  int main() {     int num = 5;     int pos = 0;     bool bit = at_position(num, pos);     cout << bit << endl;     return 0; } 
Java
/*package whatever //do not write package name here */  import java.io.*;  class GFG {     public static void main(String[] args)     {         int num = 5;         int pos = 0;         int bit = at_position(num, pos);         System.out.println(bit);     }     public static int at_position(int num, int pos)     {         int bit = num & (1 << pos);         return bit;     } } 
Python3
# code def at_position(num,pos):     bit = num & (1<<pos)     return bit    num = 5 pos = 0 bit = at_position(num, pos) print(bit) 
C#
using System;  class GFG {     static void Main(string[] args)     {         int num = 5;         int pos = 0;         int bit = at_position(num, pos);         Console.WriteLine(bit);     }      static int at_position(int num, int pos)     {         int bit = num & (1 << pos);         return bit;     } } 
JavaScript
<script> function at_position(num,pos) {  return num & (1<<pos); } let num = 5; let pos = 0; console.log(at_position(num, pos)); // contributed by akashish__ </script> 

Output
1

Time Complexity: O(1)
Auxiliary Space: O(1)

Observe that we have first left shifted '1' and then used 'AND' operator to get bit at that position. So if there is '1' at position 'pos' in 'num', then after 'AND' our variable 'bit' will store '1' else if there is '0' at position 'pos' in the number 'num' than after 'AND' our variable bit will store '0'.

Some more quick hacks: 

  • Inverting every bit of a number/1's complement: If we want to invert every bit of a number i.e change bit '0' to '1' and bit '1' to '0'.We can do this with the help of '~' operator. For example : if number is num=00101100 (binary representation) so '~num' will be '11010011'.

This is also the '1s complement of number'.

C++
#include <iostream> using namespace std; int main() {     int num = 4;      // Inverting every bit of number num     cout << (~num);     return 0; } 
Java
/*package whatever //do not write package name here */  import java.io.*;  class GFG {     public static void main (String[] args) {         int num = 4;                  // Inverting every bit of number num           num = (~num);           System.out.println(num);     } } 
Python3
num = 4  # Inverting every bit of number num print(~num) 
C#
using System;  public class GFG{      static public void Main ()     {       int num = 4;              // Inverting every bit of number num       Console.WriteLine(~num);     } } 
JavaScript
<script> let num = 4;      // Inverting every bit of number num     console.log(~num);          </script> 

Output
-5

Time Complexity: O(1)
Auxiliary Space: O(1)

  • Two's complement of the number: 2's complement of a number is 1's complement + 1.

So formally we can have 2's complement by finding 1s complement and adding 1 to the result i.e (~num+1) or what else we can do is using '-' operator.

C++
#include <iostream> using namespace std; int main() {     int num = 4;     int twos_complement = -num;     cout << "This is two's complement " << twos_complement << endl;     cout << "This is also two's complement " << (~num+1) << endl;     return 0; } 
Java
/*package whatever //do not write package name here */  import java.io.*;  class GFG {     public static void main(String[] args)     {         int num = 4;         int twos_complement = -num;         System.out.println("This is two's complement "              + twos_complement);         System.out.println("This is also two's complement "              + (~num + 1));     } }  // This code is contributed by geeky01adash. 
Python3
num = 4 twos_complement = -num  print(f"This is two's complement {twos_complement}") print(f"This is also two's complement {~num + 1}")  # This code is contributed by sarajadhav12052009 
C#
using System;  public class GFG{      static public void Main ()     {       int num = 4;       int twos_complement = -num;              Console.WriteLine("This is two's complement " + twos_complement);       Console.WriteLine("This is also two's complement " + (~num+1));     } }  // This code is contributed by sarajadhav12052009 
JavaScript
<script> let num = 4; let twos_complement = -num; console.log("This is two's complement " + twos_complement); console.log("This is also two's complement " + (~num+1));  // This code is contributed by akashish__ </script> 

Output
This is two's complement -4 This is also two's complement -4

Time Complexity: O(1)
Auxiliary Space: O(1)

 Stripping off the lowest set bit :

In many situations we want to strip off the lowest set bit for example in Binary Indexed tree data structure, counting number of set bit in a number. We do something like this:  

X = X & (X-1)

But how does it even work? Let us see this by taking an example, let X = 1100.

  • (X-1)  inverts all the bits till it encounters the lowest set '1' and it also inverts that lowest set '1'.
  • X-1 becomes 1011. After 'ANDing' X with X-1 we get the lowest set bit stripped. 
C++
#include <iostream> using namespace std; void strip_last_set_bit(int &num) {     num = num & (num-1); } int main() {     int num = 7;     strip_last_set_bit(num);     cout << num << endl;     return 0; } 
Java
import java.io.*;  class GFG {     public static void main(String[] args)     {         int num = 7;         num = strip_last_set_bit(num);         System.out.println(num);     }     public static int strip_last_set_bit(int num)     {         return num & (num - 1);     } } 
Python3
def strip_last_set_bit(num):     num &= (num - 1)     print(num)   num = 7  strip_last_set_bit(num) 
C#
using System;  public class GFG{      static public void Main ()     {       int num = 7;       strip_last_set_bit(num);     }     static public void strip_last_set_bit(int num)     {       num &= (num - 1);       Console.WriteLine(num);     } } 
JavaScript
<script> function strip_last_set_bit(num) {     return num & (num-1); }  let num = 7;  console.log(strip_last_set_bit(num)); </script> 

Output
6

Time Complexity: O(1)
Auxiliary Space: O(1)

Getting the lowest set bit of a number:

This is done by using the expression 'X &(-X)'Let us see this by taking an example: Let X = 00101100. So ~X(1's complement) will be '11010011' and 2's complement will be (~X+1 or -X) i.e.  '11010100'.So if we 'AND' original number 'X' with its two's complement which is '-X', we get the lowest set bit. 

  00101100 & 11010100 -----------   00000100
C++
#include <iostream> using namespace std; int lowest_set_bit(int num) {     int ret = num & (-num);     return ret; } int main() {     int num = 10;     int ans = lowest_set_bit(num);     cout << ans << endl;     return 0; } 
Java
import java.io.*;  class GFG {     public static void main(String[] args)     {         int num = 10;         int ans = lowest_set_bit(num);         System.out.println(ans);     }     public static int lowest_set_bit(int num)     {         int ret = num & (-num);         return ret;     } } 
Python3
def lowest_set_bit(num):     num &= (-num)     print(num)   num = 10  lowest_set_bit(num) 
JavaScript
// Function for lowest set bit function lowest_set_bit(num) {     // Taking and of num and -ve of num     let ret = num & (-num);     return ret; }  // Driver code let num = 10 let ans = lowest_set_bit(num) console.log(ans) 
C#
using System;  public class GFG {      static public void Main()     {         int num = 10;         lowest_set_bit(num);     }     static public void lowest_set_bit(int num)     {         num &= (~num + 1);         Console.WriteLine(num);     } } 

Output
2

Time Complexity: O(1)
Auxiliary Space: O(1)

Division by 2 and Multiplication by 2 are very frequently that too in loops in Competitive Programming so using Bitwise operators can help in speeding up the code.

Divide by 2 using the right shift operator:

00001100 >> 1 (00001100 is 12) ------------ 00000110 (00000110 is 6)
C++
#include <iostream> using namespace std; int main() {     int num = 12;     int ans = num>>1;     cout << ans << endl;     return 0; } 
Java
import java.io.*;  class GFG {     public static void main(String[] args)     {         int num = 12;         int ans = num >> 1;         System.out.println(ans);     } } 
Python3
num = 12 print(num >> 1) 
C#
using System;  public class GFG{      static public void Main ()     {       int num = 12;       Console.WriteLine(num >> 1);     } } 
JavaScript
<script> var num = 12; var ans = num>>1; console.log(ans); </script> 

Output
6

Time Complexity: O(1)
Auxiliary Space: O(1)

Multiply by 2 using the left shift operator:

00001100 << 1 (00001100 is 12) ------------ 00011000 (00000110 is 24)
C++
#include <iostream> using namespace std; int main() {     int num = 12;     int ans = num<<1;     cout << ans << endl;     return 0; } 
Java
/*package whatever //do not write package name here */  import java.io.*;  class GFG {     public static void main (String[] args) {           int num = 12;         int ans = num<<1;         System.out.println(ans);     } }  // This code is contributed by geeky01adash. 
C#
using System;  public class GFG{      static public void Main ()     {       int num = 12;       Console.WriteLine(num << 1);     } }  // This code is contributed by sarajadhav12052009 
Python3
# Python program for the above approach  num = 12 ans = num<<1 print(ans)  # This code is contributed by Shubham Singh 
JavaScript
<script> // Javascript program for the above approach  var num = 12; var ans = num<<1; document.write(ans);  //This code is contributed by Shubham Singh </script> 

Output
24

Time Complexity: O(1)
Auxiliary Space: O(1)


Bit Tricks for Competitive Programming
Refer BitWise Operators Articles for more articles on Bit Hacks.

 


Next Article
Inclusion Exclusion principle for Competitive Programming

K

kartik
Improve
Article Tags :
  • Competitive Programming
  • C++
  • DSA
  • Bitwise-XOR
Practice Tags :
  • CPP

Similar Reads

    Competitive Programming - A Complete Guide
    Competitive Programming is a mental sport that enables you to code a given problem under provided constraints. The purpose of this article is to guide every individual possessing a desire to excel in this sport. This article provides a detailed syllabus for Competitive Programming designed by indust
    8 min read
    Competitive Programming (CP) Handbook with Complete Roadmap
    Welcome to the Competitive Programming Handbook or CP Handbook by GeeksforGeeks! This Competitive Programming Handbook is a go-to resource for individuals aiming to enhance their problem-solving skills and excel in coding competitions. This CP handbook provides a comprehensive guide, covering fundam
    12 min read

    Mathematics for Competitive Programming

    Must do Math for Competitive Programming
    Competitive Programming (CP) doesn’t typically require one to know high-level calculus or some rocket science. But there are some concepts and tricks which are sufficient most of the time. You can definitely start competitive coding without any mathematical background, but maths becomes essential as
    15+ min read
    Pigeonhole Principle for CP | Identification, Approach & Problems
    In competitive programming, where people solve tough problems with computer code, the Pigeonhole Principle is like a secret tool. Even though it's a simple idea, it helps programmers tackle complex challenges. This article is your guide to understanding how this principle works and why it's crucial
    8 min read
    Euler Totient for Competitive Programming
    What is Euler Totient function(ETF)?Euler Totient Function or Phi-function for 'n', gives the count of integers in range '1' to 'n' that are co-prime to 'n'. It is denoted by \phi(n) .For example the below table shows the ETF value of first 15 positive integers: 3 Important Properties of Euler Totie
    8 min read
    Mathematics for Competitive Programming Course By GeeksforGeeks
    Mathematics forms the foundation of problem-solving in Competitive Programming (CP). Mastering key mathematical concepts is crucial for approaching algorithmic challenges effectively. If you're an aspiring competitive programmer or someone who wishes to enhance your problem-solving skills, this Math
    3 min read

    Number Theory for CP

    Binary Exponentiation for Competitive Programming
    In competitive programming, we often need to do a lot of big number calculations fast. Binary exponentiation is like a super shortcut for doing powers and can make programs faster. This article will show you how to use this powerful trick to enhance your coding skills. Table of ContentWhat is Binary
    15+ min read
    GCD (Greatest Common Divisor) Practice Problems for Competitive Programming
    GCD (Greatest Common Divisor) or HCF (Highest Common Factor) of two numbers is the largest positive integer that divides both of the numbers.GCD of Two NumbersFastest Way to Compute GCDThe fastest way to find the Greatest Common Divisor (GCD) of two numbers is by using the Euclidean algorithm. The E
    4 min read

    Bit Manipulation for CP

    Bit Manipulation for Competitive Programming
    Bit manipulation is a technique in competitive programming that involves the manipulation of individual bits in binary representations of numbers. It is a valuable technique in competitive programming because it allows you to solve problems efficiently, often reducing time complexity and memory usag
    15+ min read
    Bit Tricks for Competitive Programming
    In competitive programming or in general, some problems seem difficult but can be solved very easily with little concepts of bit magic. We have discussed some tricks below in the previous post.Bitwise Hacks for Competitive Programming One-Liner Hacks of Bit Manipulation:One-Liner CodeFunctionx&1
    7 min read
    Bitwise Hacks for Competitive Programming
    Prerequisite: It is recommended to refer Interesting facts about Bitwise Operators How to set a bit in the number 'num': If we want to set a bit at nth position in the number 'num', it can be done using the 'OR' operator( | ).   First, we left shift '1' to n position via (1<<n)Then, use the 'O
    14 min read

    Combinatorics for CP

    Inclusion Exclusion principle for Competitive Programming
    What is the Inclusion-Exclusion Principle?The inclusion-exclusion principle is a combinatoric way of computing the size of multiple intersecting sets or the probability of complex overlapping events. Generalised Inclusion-Exclusion over Set:For 2 Intersecting Set A and B: A\bigcup B= A + B - A\bigca
    5 min read

    Greedy for CP

    Binary Search on Answer Tutorial with Problems
    Binary Search on Answer is the algorithm in which we are finding our answer with the help of some particular conditions. We have given a search space in which we take an element [mid] and check its validity as our answer, if it satisfies our given condition in the problem then we store its value and
    15+ min read
    Ternary Search for Competitive Programming
    Ternary search is a powerful algorithmic technique that plays a crucial role in competitive programming. This article explores the fundamentals of ternary search, idea behind ternary search with its use cases that will help solving complex optimization problems efficiently. Table of Content What is
    8 min read

    Array based concepts for CP

    What are Online and Offline query-based questions in Competitive Programming
    The query-based questions of competitive programming are mainly of two types: Offline Query.Online Query. Offline Query An offline algorithm allows us to manipulate the data to be queried before any answer is printed. This is usually only possible when the queries do not update the original element
    4 min read
    Precomputation Techniques for Competitive Programming
    What is the Pre-Computation Technique?Precomputation refers to the process of pre-calculating and storing the results of certain computations or data structures in advance, in order to speed up the execution time of a program. This can be useful in situations where the same calculations or data stru
    15+ min read
    PreComputation Technique on Arrays
    Precomputation refers to the process of pre-calculating and storing the results of certain computations or data structures(array in this case) in advance, in order to speed up the execution time of a program. This can be useful in situations where the same calculations are needed multiple times, as
    15 min read
    Frequency Measuring Techniques for Competitive Programming
    Measuring the frequency of elements in an array is a really handy skill and is required a lot of competitive coding problems. We, in a lot of problems, are required to measure the frequency of various elements like numbers, alphabets, symbols, etc. as a part of our problem. Examples: Input: arr[] =
    15+ min read

    Dynamic Programming (DP) for CP

    DP on Trees for Competitive Programming
    Dynamic Programming (DP) on trees is a powerful algorithmic technique commonly used in competitive programming. It involves solving various tree-related problems by efficiently calculating and storing intermediate results to optimize time complexity. By using the tree structure, DP on trees allows p
    15+ min read
    Dynamic Programming in Game Theory for Competitive Programming
    In the fast-paced world of competitive programming, mastering dynamic programming in game theory is the key to solving complex strategic challenges. This article explores how dynamic programming in game theory can enhance your problem-solving skills and strategic insights, giving you a competitive e
    15+ min read

    Game Theory for CP

    Interactive Problems in Competitive Programming
    Interactive Problems are those problems in which our solution or code interacts with the judge in real time. When we develop a solution for an Interactive Problem then the input data given to our solution may not be predetermined but is built for that problem specifically. The solution performs a se
    6 min read
    Mastering Bracket Problems for Competitive Programming
    Bracket problems in programming typically refer to problems that involve working with parentheses, and/or braces in expressions or sequences. It typically refers to problems related to the correct and balanced usage of parentheses, and braces in expressions or code. These problems often involve chec
    4 min read
    MEX (Minimum Excluded) in Competitive Programming
    MEX of a sequence or an array is the smallest non-negative integer that is not present in the sequence.Note: The MEX of an array of size N cannot be greater than N since the MEX of an array is the smallest non-negative integer not present in the array and array having size N can only cover integers
    15+ min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences