Simple REST service which receives path tree data in json format, resolve and calculate max value of paths.
Clone the project
git clone https://github.com/guneyin/go-path-resolver.git
Go project directory
cd go-path-resolver
Build project
go build
Run
.\go-path-resolver
POST http:https://127.0.0.1:3001/
{
"tree": {
"nodes": [
{"id": "1", "left": "2", "right": "3", "value": 1},
{"id": "3", "left": null, "right": null, "value": 3},
{"id": "2", "left": null, "right": null, "value": 2}
],
"root": "1"
}
}
{
"path_sum": 4,
"node_count": 3,
"execute_duration": 0
}
Run the following command to run the tests
go test