Overview of application.
-
For solving the problem, the data structure used for representing parking lot is a mix of Heap and maps to solve all of the commands in optimal manner as possible, assuming space is not an issue. Min Heap is used to store the empty slots and fetch the nearest slot in optimal time.
-
No external testing library has been used as golang provides internal "testing" library. All test cases have been written using it.
-
script is written in
bin/setup
to install dependencies,run test case and build package. It will generatebin/parking_lot
binary to run the application.
Follow this step to run application in Golang
- To run this application, install Go.
- Place the package in /go/src/github.com/ where GOPATH(/go/src).
- Navigate to path $GOPATH/github.com/parking_lot/
- Run
/bin/setup
script to install dependencies,run test case and build package. - To run application, run binary
/bin/parking_lot
.Please make sure its in executable mode in your system Runchmod 755 parking_lot
in command prompt if not. Please make sure your GOPATH is set to application directory