Skip to content
geeksforgeeks
  • 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
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • DSA
  • Branch and Bound Tutorial
  • Backtracking Vs Branch-N-Bound
  • 0/1 Knapsack
  • 8 Puzzle Problem
  • Job Assignment Problem
  • N-Queen Problem
  • Travelling Salesman Problem
Open In App
Next Article:
8 puzzle Problem
Next article icon

Implementation of 0/1 Knapsack using Branch and Bound

Last Updated : 23 Nov, 2023
Comments
Improve
Suggest changes
Like Article
Like
Report

Given two arrays v[] and w[] that represent values and weights associated with n items respectively. Find out the maximum value subset(Maximum Profit) of v[] such that the sum of the weights of this subset is smaller than or equal to Knapsack capacity Cap(W).

Note: The constraint here is we can either put an item completely into the bag or cannot put it at all. It is not possible to put a part of an item into the bag.

Example:

Input: N = 3, W = 4, v[] = {1, 2, 3}, w[] = {4, 5, 1}
Output: 3
Explanation: There are two items which have weight less than or equal to 4. If we select the item with weight 4, the possible profit is 1. And if we select the item with weight 1, the possible profit is 3. So the maximum possible profit is 3. Note that we cannot put both the items with weight 4 and 1 together as the capacity of the bag is 4.

Input: N = 3, W = 4, v[] = {2, 3.14, 1.98, 5, 3}, w[] = {40, 50, 100, 95, 30}
Output: 235

Implementation of 0/1 Knapsack using Branch and Bound:

We strongly recommend to refer below post as a prerequisite for this. Branch and Bound | Set 1 (Introduction with 0/1 Knapsack) We discussed different approaches to solve above problem and saw that the Branch and Bound solution is the best suited method when item weights are not integers. In this post implementation of Branch and Bound method for 0/1 knapsack problem is discussed. 

0-1-Knapsack-using-Branch-and-Bound3

Implementation of 0/1 Knapsack using Branch and Bound

How to find bound for every node for 0/1 Knapsack? 

The idea is to use the fact that the Greedy approach provides the best solution for Fractional Knapsack problem. To check if a particular node can give us a better solution or not, we compute the optimal solution (through the node) using Greedy approach. If the solution computed by Greedy approach itself is more than the best so far, then we can’t get a better solution through the node. 

Algorithm:

  • Sort all items in decreasing order of ratio of value per unit weight so that an upper bound can be computed using Greedy Approach.
  • Initialize maximum profit, maxProfit = 0
  • Create an empty queue, Q.
  • Create a dummy node of decision tree and enqueue it to Q. Profit and weight of dummy node are 0.
  • Do following while Q is not empty.
    • Extract an item from Q. Let the extracted item be u.
    • Compute profit of next level node. If the profit is more than maxProfit, then update maxProfit.
    • Compute bound of next level node. If bound is more than maxProfit, then add next level node to Q.
    • Consider the case when next level node is not considered as part of solution and add a node to queue with level as next, but weight and profit without considering next level nodes.

Following is implementation of above idea. 

Cpp




// C++ program to solve knapsack problem using
// branch and bound
#include <bits/stdc++.h>
using namespace std;
 
// Structure for Item which store weight and corresponding
// value of Item
struct Item
{
    float weight;
    int value;
};
 
// Node structure to store information of decision
// tree
struct Node
{
    // level --> Level of node in decision tree (or index
    //             in arr[]
    // profit --> Profit of nodes on path from root to this
    //         node (including this node)
    // bound ---> Upper bound of maximum profit in subtree
    //         of this node/
    int level, profit, bound;
    float weight;
};
 
// Comparison function to sort Item according to
// val/weight ratio
bool cmp(Item a, Item b)
{
    double r1 = (double)a.value / a.weight;
    double r2 = (double)b.value / b.weight;
    return r1 > r2;
}
 
// Returns bound of profit in subtree rooted with u.
// This function mainly uses Greedy solution to find
// an upper bound on maximum profit.
int bound(Node u, int n, int W, Item arr[])
{
    // if weight overcomes the knapsack capacity, return
    // 0 as expected bound
    if (u.weight >= W)
        return 0;
 
    // initialize bound on profit by current profit
    int profit_bound = u.profit;
 
    // start including items from index 1 more to current
    // item index
    int j = u.level + 1;
    int totweight = u.weight;
 
    // checking index condition and knapsack capacity
    // condition
    while ((j < n) && (totweight + arr[j].weight <= W))
    {
        totweight += arr[j].weight;
        profit_bound += arr[j].value;
        j++;
    }
 
    // If k is not n, include last item partially for
    // upper bound on profit
    if (j < n)
        profit_bound += (W - totweight) * arr[j].value /
                                        arr[j].weight;
 
    return profit_bound;
}
 
// Returns maximum profit we can get with capacity W
int knapsack(int W, Item arr[], int n)
{
    // sorting Item on basis of value per unit
    // weight.
    sort(arr, arr + n, cmp);
 
    // make a queue for traversing the node
    queue<Node> Q;
    Node u, v;
 
    // dummy node at starting
    u.level = -1;
    u.profit = u.weight = 0;
    Q.push(u);
 
    // One by one extract an item from decision tree
    // compute profit of all children of extracted item
    // and keep saving maxProfit
    int maxProfit = 0;
    while (!Q.empty())
    {
        // Dequeue a node
        u = Q.front();
        Q.pop();
 
        // If it is starting node, assign level 0
        if (u.level == -1)
            v.level = 0;
 
        // If there is nothing on next level
        if (u.level == n-1)
            continue;
 
        // Else if not last node, then increment level,
        // and compute profit of children nodes.
        v.level = u.level + 1;
 
        // Taking current level's item add current
        // level's weight and value to node u's
        // weight and value
        v.weight = u.weight + arr[v.level].weight;
        v.profit = u.profit + arr[v.level].value;
 
        // If cumulated weight is less than W and
        // profit is greater than previous profit,
        // update maxprofit
        if (v.weight <= W && v.profit > maxProfit)
            maxProfit = v.profit;
 
        // Get the upper bound on profit to decide
        // whether to add v to Q or not.
        v.bound = bound(v, n, W, arr);
 
        // If bound value is greater than profit,
        // then only push into queue for further
        // consideration
        if (v.bound > maxProfit)
            Q.push(v);
 
        // Do the same thing, but Without taking
        // the item in knapsack
        v.weight = u.weight;
        v.profit = u.profit;
        v.bound = bound(v, n, W, arr);
        if (v.bound > maxProfit)
            Q.push(v);
    }
 
    return maxProfit;
}
 
// driver program to test above function
int main()
{
    int W = 10; // Weight of knapsack
    Item arr[] = {{2, 40}, {3.14, 50}, {1.98, 100},
                {5, 95}, {3, 30}};
    int n = sizeof(arr) / sizeof(arr[0]);
 
    cout << "Maximum possible profit = "
        << knapsack(W, arr, n);
 
    return 0;
}
 
 

Java




import java.util.Arrays;
import java.util.Comparator;
import java.util.PriorityQueue;
 
class Item {
    float weight;
    int value;
 
    Item(float weight, int value) {
        this.weight = weight;
        this.value = value;
    }
}
 
class Node {
    int level, profit, bound;
    float weight;
 
    Node(int level, int profit, float weight) {
        this.level = level;
        this.profit = profit;
        this.weight = weight;
    }
}
 
public class KnapsackBranchAndBound {
    static Comparator<Item> itemComparator = (a, b) -> {
        double ratio1 = (double) a.value / a.weight;
        double ratio2 = (double) b.value / b.weight;
        // Sorting in decreasing order of value per unit weight
        return Double.compare(ratio2, ratio1);
    };
 
    static int bound(Node u, int n, int W, Item[] arr) {
        if (u.weight >= W)
            return 0;
 
        int profitBound = u.profit;
        int j = u.level + 1;
        float totalWeight = u.weight;
 
        while (j < n && totalWeight + arr[j].weight <= W) {
            totalWeight += arr[j].weight;
            profitBound += arr[j].value;
            j++;
        }
 
        if (j < n)
            profitBound += (int) ((W - totalWeight) * arr[j].value / arr[j].weight);
 
        return profitBound;
    }
 
    static int knapsack(int W, Item[] arr, int n) {
        Arrays.sort(arr, itemComparator);
        PriorityQueue<Node> priorityQueue =
          new PriorityQueue<>((a, b) -> Integer.compare(b.bound, a.bound));
        Node u, v;
 
        u = new Node(-1, 0, 0);
        priorityQueue.offer(u);
 
        int maxProfit = 0;
 
        while (!priorityQueue.isEmpty()) {
            u = priorityQueue.poll();
 
            if (u.level == -1)
                v = new Node(0, 0, 0);
            else if (u.level == n - 1)
                continue;
            else
                v = new Node(u.level + 1, u.profit, u.weight);
 
            v.weight += arr[v.level].weight;
            v.profit += arr[v.level].value;
 
            if (v.weight <= W && v.profit > maxProfit)
                maxProfit = v.profit;
 
            v.bound = bound(v, n, W, arr);
 
            if (v.bound > maxProfit)
                priorityQueue.offer(v);
 
            v = new Node(u.level + 1, u.profit, u.weight);
            v.bound = bound(v, n, W, arr);
 
            if (v.bound > maxProfit)
                priorityQueue.offer(v);
        }
 
        return maxProfit;
    }
 
    public static void main(String[] args) {
        int W = 10;
        Item[] arr = {
            new Item(2, 40),
            new Item(3.14f, 50),
            new Item(1.98f, 100),
            new Item(5, 95),
            new Item(3, 30)
        };
        int n = arr.length;
 
        int maxProfit = knapsack(W, arr, n);
        System.out.println("Maximum possible profit = " + maxProfit);
    }
}
 
 

Python




from Queue import Queue
 
# Define an Item class to represent
# each item in the knapsack
class Item:
    def __init__(self, weight, value):
        self.weight = weight
        self.value = value
 
# Define a Node class to represent each
# node in the branch and bound tree
class Node:
    def __init__(self, level, profit, bound, weight):
        self.level = level
        self.profit = profit
        self.bound = bound
        self.weight = weight
 
# Define a compare function to sort items
# by their value-to-weight ratio in
# descending order
def compare(a, b):
    r1 = float(a.value) / a.weight
    r2 = float(b.value) / b.weight
    return r1 > r2
 
# Define a function to calculate the
# maximum possible profit for a given node
def bound(u, n, W, arr):
    # If the node exceeds the knapsack's
    # capacity, its profit bound is 0
    if u.weight >= W:
        return 0
 
    # Calculate the profit bound by adding
    # the profits of all remaining items
    # that can fit into the knapsack
    profitBound = u.profit
    j = u.level + 1
    totWeight = int(u.weight)
 
    while j < n and totWeight + int(arr[j].weight) <= W:
        totWeight += int(arr[j].weight)
        profitBound += arr[j].value
        j += 1
 
    # If there are still items remaining,
    # add a fraction of the next item's
    # profit proportional to the remaining
    # space in the knapsack
    if j < n:
        profitBound += int((W - totWeight) * arr[j].value / arr[j].weight)
 
    return profitBound
 
# Define the knapsack_solution function
# that uses the Branch and Bound algorithm
# to solve the 0-1 Knapsack problem
def knapsack_solution(W, arr, n):
 
    # Sort the items in descending order
    # of their value-to-weight ratio
    arr.sort(cmp=compare, reverse=True)
 
    # Initialize a queue with a root node
    # of the branch and bound tree
    q = Queue()
    u = Node(-1, 0, 0, 0)
    q.put(u)
 
    # Initialize a variable to keep track
    # of the maximum profit found so far
    maxProfit = 0
 
    # Loop through each node in the
    # branch and bound tree
    while not q.empty():
        u = q.get()
 
        # If the node is the root node,
        # add its child nodes to the queue
        if u.level == -1:
            v = Node(0, 0, 0, 0)
 
        # If the node is a leaf node, skip it
        if u.level == n - 1:
            continue
 
        # Calculate the child node that
        # includes the next item in knapsack
        v = Node(u.level + 1, u.profit +
                 arr[u.level + 1].value, 0, u.weight + arr[u.level + 1].weight)
 
        # If the child node's weight is
        # less than or equal to the knapsack's
        # capacity and its profit is greater
        # than the maximum profit found so far,
        # update the maximum profit
        if v.weight <= W and v.profit > maxProfit:
            maxProfit = v.profit
 
        # Calculate the profit bound for the
        # child node and add it to the queue
        # if its profit bound is greater than
        # the maximum profit found so far
        v.bound = bound(v, n, W, arr)
 
        if v.bound > maxProfit:
            q.put(v)
 
        v = Node(u.level + 1, u.profit, 0, u.weight)
 
        v.bound = bound(v, n, W, arr)
 
        if v.bound > maxProfit:
            q.put(v)
 
    return maxProfit
 
 
# Driver Code
if __name__ == '__main__':
    W = 10
    arr = [Item(2, 40), Item(3.14, 50), Item(
        1.98, 100), Item(5, 95), Item(3, 30)]
    n = len(arr)
 
    print 'Maximum possible profit =', knapsack_solution(W, arr, n)
 
 

C#




using System;
using System.Collections.Generic;
 
public struct Item
{
    public float weight;
    public int value;
}
 
public struct Node
{
    public int level;
    public int profit;
    public int bound;
    public float weight;
}
 
public class Knapsack
{
    public static bool Compare(Item a, Item b)
    {
        double r1 = (double)a.value / a.weight;
        double r2 = (double)b.value / b.weight;
        return r1 > r2;
    }
 
    public static int Bound(Node u, int n, int W, Item[] arr)
    {
        if (u.weight >= W)
            return 0;
 
        int profitBound = u.profit;
        int j = u.level + 1;
        int totWeight = (int)u.weight;
 
        while (j < n && totWeight + (int)arr[j].weight <= W)
        {
            totWeight += (int)arr[j].weight;
            profitBound += arr[j].value;
            j++;
        }
 
        if (j < n)
            profitBound += (int)((W - totWeight) * arr[j].value / arr[j].weight);
 
        return profitBound;
    }
 
    public static int KnapsackSolution(int W, Item[] arr, int n)
    {
        Array.Sort<Item>(arr, Compare);
 
        Queue<Node> q = new Queue<Node>();
        Node u, v;
        int maxProfit = 0;
 
        u.level = -1;
        u.profit = 0;
        u.weight = 0;
        q.Enqueue(u);
 
        while (q.Count > 0)
        {
            u = q.Dequeue();
 
            if (u.level == -1)
                v.level = 0;
 
            if (u.level == n - 1)
                continue;
 
            v.level = u.level + 1;
            v.weight = u.weight + arr[v.level].weight;
            v.profit = u.profit + arr[v.level].value;
 
            if (v.weight <= W && v.profit > maxProfit)
                maxProfit = v.profit;
 
            v.bound = Bound(v, n, W, arr);
 
            if (v.bound > maxProfit)
                q.Enqueue(v);
 
            v.weight = u.weight;
            v.profit = u.profit;
            v.bound = Bound(v, n, W, arr);
 
            if (v.bound > maxProfit)
                q.Enqueue(v);
        }
 
        return maxProfit;
    }
 
    public static void Main(string[] args)
    {
        int W = 10;
        Item[] arr = new Item[5] { new Item { weight = 2, value = 40 },
                                   new Item { weight = 3.14f, value = 50 },
                                   new Item { weight = 1.98f, value = 100 },
                                   new Item { weight = 5, value = 95 },
                                   new Item { weight = 3, value = 30 } };
        int n = arr.Length;
 
        Console.WriteLine("Maximum possible profit = {0}", KnapsackSolution(W, arr, n));
    }
}
 
 

Javascript




// JavaScript program to solve knapsack problem using
// branch and bound
 
// Structure for Item which store weight and corresponding value of Item
class Item {
    constructor(weight, value) {
        this.weight = weight;
        this.value = value;
    }
}
 
// Node structure to store information of decision tree
class Node {
    constructor(level, profit, weight, bound) {
        this.level = level; // Level of node in decision tree (or index in arr[])
        this.profit = profit; // Profit of nodes on path from root to this node (including this node)
        this.weight = weight; // Weight of nodes on path from root to this node (including this node)
        this.bound = bound; // Upper bound of maximum profit in subtree of this node
    }
}
 
// Comparison function to sort Item according to val/weight ratio
function cmp(a, b) {
    let r1 = a.value / a.weight;
    let r2 = b.value / b.weight;
    return r1 < r2;
}
 
// Returns bound of profit in subtree rooted with u.
// This function mainly uses Greedy solution to find
// an upper bound on maximum profit.
function bound(u, n, W, arr) {
    // if weight overcomes the knapsack capacity, return 0 as expected bound
    if (u.weight >= W) {
        return 0;
    }
 
    // initialize bound on profit by current profit
    let profit_bound = u.profit;
 
    // start including items from index 1 more to current item index
    let j = u.level + 1;
    let totweight = u.weight;
 
    // checking index condition and knapsack capacity condition
    while (j < n && totweight + arr[j].weight <= W) {
        totweight += arr[j].weight;
        profit_bound += arr[j].value;
        j++;
    }
 
    // If k is not n, include last item partially for upper bound on profit
    if (j < n) {
        profit_bound += (W - totweight) * arr[j].value / arr[j].weight;
    }
 
    return profit_bound;
}
 
// Returns maximum profit we can get with capacity W
function knapsack(W, arr, n) {
    // sorting Item on basis of value per unit weight.
    arr.sort(cmp);
 
    // make a queue for traversing the node
    let Q = [];
    let u = new Node(-1, 0, 0, 0);
    let v;
 
    // dummy node at starting
    Q.push(u);
 
    // One by one extract an item from decision tree
    // compute profit of all children of extracted item
    // and keep saving maxProfit
    let maxProfit = 0;
    while (Q.length > 0) {
        // Dequeue a node
        u = Q.shift();
 
        // If it is starting node, assign level 0
        if (u.level == -1) {
            v = new Node(0, 0, 0, 0);
        }
 
        // If there is nothing on next level
        if (u.level == n - 1) {
            continue;
        }
 
        // Else if not last node, then increment level,
        // and compute profit of children nodes.
        v = new Node(u.level + 1, u.profit, u.weight, 0);
 
        // Taking current level's item add current
        // level's weight
        v.weight = u.weight + arr[v.level].weight;
        v.profit = u.profit + arr[v.level].value;
            // If cumulated weight is less than W and
    // profit is greater than previous profit,
    // update maxprofit
    if (v.weight <= W && v.profit > maxProfit) {
        maxProfit = v.profit;
    }
 
    // Get the upper bound on profit to decide
    // whether to add v to Q or not.
    v.bound = bound(v, n, W, arr);
 
    // If bound value is greater than profit,
    // then only push into queue for further
    // consideration
    if (v.bound > maxProfit) {
        Q.push(v);
    }
 
    // Do the same thing, but Without taking
    // the item in knapsack
    v = new Node(u.level + 1, u.profit, u.weight, 0);
    v.bound = bound(v, n, W, arr);
    if (v.bound > maxProfit) {
        Q.push(v);
    }
}
 
return maxProfit;
}
 
// driver program to test above function
function main() {
const W = 10; // Weight of knapsack
const arr = [
{ weight: 2, value: 40 },
{ weight: 3.14, value: 50 },
{ weight: 1.98, value: 100 },
{ weight: 5, value: 95 },
{ weight: 3, value: 30 },
];
const n = arr.length;
 
console.log(`Maximum possible profit = ${knapsack(W, arr, n)}`);
}
main();
 
 
Output
Maximum possible profit = 235 

Time complexity: O(2n) because the while loop runs n times, and inside the while loop, there is another loop that also runs n times in the worst case.
Auxiliary Space: O(n) because the queue stores the nodes, and in the worst case, all nodes are stored, so the size of the queue is proportional to the number of items, which is n.



Next Article
8 puzzle Problem
author
kartik
Improve
Article Tags :
  • Branch and Bound
  • DSA
  • knapsack

Similar Reads

  • Branch and Bound Algorithm
    The Branch and Bound Algorithm is a method used in combinatorial optimization problems to systematically search for the best solution. It works by dividing the problem into smaller subproblems, or branches, and then eliminating certain branches based on bounds on the optimal solution. This process c
    1 min read
  • Introduction to Branch and Bound - Data Structures and Algorithms Tutorial
    Branch and bound algorithms are used to find the optimal solution for combinatory, discrete, and general mathematical optimization problems. A branch and bound algorithm provide an optimal solution to an NP-Hard problem by exploring the entire search space. Through the exploration of the entire sear
    13 min read
  • 0/1 Knapsack using Branch and Bound
    Given two arrays v[] and w[] that represent values and weights associated with n items respectively. Find out the maximum value subset(Maximum Profit) of v[] such that the sum of the weights of this subset is smaller than or equal to Knapsack capacity W. Note: The constraint here is we can either pu
    15+ min read
  • Implementation of 0/1 Knapsack using Branch and Bound
    Given two arrays v[] and w[] that represent values and weights associated with n items respectively. Find out the maximum value subset(Maximum Profit) of v[] such that the sum of the weights of this subset is smaller than or equal to Knapsack capacity Cap(W). Note: The constraint here is we can eith
    15+ min read
  • 8 puzzle Problem
    Given a 3×3 board with 8 tiles (each numbered from 1 to 8) and one empty space, the objective is to place the numbers to match the final configuration using the empty space. We can slide four adjacent tiles (left, right, above, and below) into the empty space. Table of Content [Naive Approach] Using
    15+ min read
  • Job Assignment Problem using Branch And Bound
    You are the head of a company with n employees and n distinct jobs to be completed. Every employee takes a different amount of time to complete different jobs, given in the form of a cost[][] matrix, where cost[i][j] represents the time taken by the ith person to complete the jth job. Your task is t
    15+ min read
  • N Queen Problem using Branch And Bound
    The N queens puzzle is the problem of placing N chess queens on an N×N chessboard so that no two queens threaten each other. Thus, a solution requires that no two queens share the same row, column, or diagonal. The backtracking Algorithm for N-Queen is already discussed here. In a backtracking solut
    15+ min read
  • Traveling Salesman Problem using Branch And Bound
    Given a set of cities and distance between every pair of cities, the problem is to find the shortest possible tour that visits every city exactly once and returns to the starting point. For example, consider the graph shown in figure on right side. A TSP tour in the graph is 0-1-3-2-0. The cost of t
    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