Coder Social home page Coder Social logo

davecom / classiccomputerscienceproblemsinswift Goto Github PK

View Code? Open in Web Editor NEW
187.0 11.0 42.0 112 KB

Source Code for the Book Classic Computer Science Problems in Swift

Home Page: https://www.manning.com/books/classic-computer-science-problems-in-swift?a_aid=oaksnow&a_bid=8de75028

License: Apache License 2.0

Swift 100.00%
book swift manning computer-science neural-network graph-algorithms search-algorithms genetic-algorithms k-means constraint-satisfaction-problem

classiccomputerscienceproblemsinswift's People

Contributors

davecom avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

classiccomputerscienceproblemsinswift's Issues

Bug in eight queens algorithm?

A direct copy of the algorithm found in https://github.com/davecom/ClassicComputerScienceProblemsInSwift/blob/master/Classic%20Computer%20Science%20Problems%20in%20Swift.playground/Pages/Chapter%203.xcplaygroundpage/Contents.swift can give results that violate the same row constraint (if the format is "column: row"). For example:

"[2: 3, 5: 4, 7: 5, 4: 6, 8: 8, 1: 1, 3: 8, 6: 2]"

8:8 and 3:8 are in the same row, which is a violation. Another example:

"[5: 2, 7: 6, 8: 1, 1: 1, 4: 7, 2: 3, 6: 4, 3: 5]"

8:1 and 1:1 are violating the same row constraint

Chapter 2 - Cannot find type 'PriorityQueue' in scope

When executing Chapter 2 on swift playground with xcode, I get the following error message

Cannot find type 'PriorityQueue' in scope

on line (according to chapter 2.2.5 A* search)

var frontier: PriorityQueue<Node<StateType>> = PriorityQueue<Node<StateType>>(ascending: true, startingValues: [Node(state: initialState, parent: nil, cost: 0, heuristic: heuristicFn(initialState))])

Swift 5.7 and Xcode Version 13.4.1 (13F100)

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.