Skip to content

mxp100/go-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Binary Search Tree Simple Application

Run

go run visiongotest.go 

Build

go build visiongotest.go

API

Search

Method: GET

Params Type Description Example
val integer Searching value 36

Example:

curl --request GET --url 'http://localhost:8080/search?val=36'

Output:

{
  "Found": true,
  "Tree": {
    "Value": 36,
    "Left": {
      "Value": 34,
      "Left": {
        "Value": 32,
        "Left": null,
        "Right": null
      },
      "Right": null
    },
    "Right": null
  }
}

Delete

Method: DELETE

Params Type Example
val integer 412

Example:

curl --request DELETE --url 'http://localhost:8080/delete?val=412'

Output:

{
  "Deleted": [
    412
  ],
  "Tree": ... Full tree

Insert

Method: POST

Content-Type: application/json

Body: int[]

Example:

curl --request POST \
  --url http://localhost:8080/insert \
  --header 'content-type: application/json' \
  --data '[2]'

Output:

{
  "Inserted": [
    2
  ],
  "Tree": ... Full tree

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages