Code Monkey home page Code Monkey logo

basemax / subsetsumbacktracking Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 22 KB

This is an implementation of the Sub Set Sum Backtracking algorithm in C. The algorithm is used to find a subset of a given set of numbers that adds up to a given sum. The algorithm is implemented using backtracking.

License: GNU General Public License v3.0

C 88.75% Python 8.07% CMake 3.18%
algorithm backtracking backtracking-algorithm backtracking-search c data-structures-and-algorithms datastructure ds subsetsum sum tree sub-set-sum sum-algorithm

subsetsumbacktracking's Introduction

Sub Set Sum Backtracking

This is an implementation of the Sub Set Sum Backtracking algorithm in C. The algorithm is used to find a subset of a given set of numbers that adds up to a given sum. The algorithm is implemented using backtracking.

Usage

To compile the program, run the following command:

gcc -o subsetsum subsetsum.c

To run the program, run the following command:

./subsetsum

Example

Enter the number of elements: 5
Enter the elements: 1 2 3 4 5
Enter the sum: 10
The subset is: 1 2 3 4

The program will print the subset of numbers that add up to the given sum.

License

This project is licensed under the GPL-3 License - see the LICENSE file for details

© Copyright (c) 2022 Max Base

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.