Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tiancaiamao/thoughtworks
my failed code assignment for ThoughtWorks interview
https://github.com/tiancaiamao/thoughtworks
Last synced: about 1 month ago
JSON representation
my failed code assignment for ThoughtWorks interview
- Host: GitHub
- URL: https://github.com/tiancaiamao/thoughtworks
- Owner: tiancaiamao
- Created: 2014-07-14T10:37:02.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-07-14T10:49:30.000Z (over 10 years ago)
- Last Synced: 2023-03-27T22:23:22.376Z (over 1 year ago)
- Language: Go
- Homepage:
- Size: 129 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
thoughtworks的编程测试,题目是trains,挂了,这是我提交的代码。
# build
first, [you need a golang envirenment](http://golang.org)
then, copy trains dir to $GOPATH
go install trains
no extra dependency required, the executable will be in $GOPATH/bin
# run
cd $GOPATH/src/trains
../../bin/trains graphFile questionFileif $GOPATH/bin is in your $PATH, that also work, of course
trains graphFile questionFile
Personally, I suggest you do that, Go is great!
you can slightly change graphFile and questionFile to do some test, but should remain the right format~
# other
to run unit test, just type:
go test -v trains
to see I'm a honest interviewee, :-)
git log
code struct:
.
├── bruteforce.go
├── bruteforce_test.go
├── dijkstra.go // implement dijkstra algorithm
├── graph.go // data struct represent of Graph in adjacency
├── graphFile // test file
├── graph_test.go
├── main.go // main file
├── parser.go // parse input into internal data struct
├── questionFile // test file
└── solver.go // solve the abstract problem