GithubHelp home page GithubHelp logo

Nicola Pedretti's Projects

uninformed-equation-searcher icon uninformed-equation-searcher

subset of the given set of N numbers and the 4 basic arithmetic operation ( +, -, x, / ) to reach the target. E.g: Given the set of numbers 1,2,3,4,6 and target 53, one way to reach the target is: (2 + 3 + 4) ∗ 6 1 (a) Define a suitable search space representation for the problem, and briefly outline a strategy to solve the problem. (b) (programming portion) Write a program to solve the problem, according to the program specification given below. You should implement different search strategies (BFS, DFS, IDS, UCS) for finding the best node. For UCS, use the following costs for the different operators, which roughly relates to the number of CPU cycles for a typical modern processor: Addition: 4 units, Subtraction: 4 units, Multiplication: 6 units, Division: 32 units. The program should output one way of reaching the target in the usual arithmetic notation, using parentheses whenever necessary. Program Specification : Assume that all input numbers and the target are positive integers. Each number may be used at most once in the expression. However, the set of input numbers may themselves have repeated numbers. Your program should not do division that will not result in integers. The java program should run on any of the lab machines . It will be invoked as follows: java HW1 < debug > < Search Strategy > < target > < set of numbers > Where < debug > could be either 0 or 1. A value of 1 would mean that the program should output all states and the paths taken that it searches in the same order. (Whenever the program expands a node during search, it outputs the contents of the node and the label of the path it took to reach that node.) < Search Strategy > could be either BFS, DFS, IDS, UCS < target > is the goal number that we want to reach < set of numbers > is just the input set of N numbers separated by spaces . Example invocation: java HW1 1 BFS 6 1 2 3

vimrc icon vimrc

A simple configuration file for Vim

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.