V
V
Volodymyr Lavryk2017-02-03 15:30:08
JSON
Volodymyr Lavryk, 2017-02-03 15:30:08

How to convert JSON to directed graph?

I have a JSON file

{
  "value": 10,
  "elements": [
    {
      "value": 2,
      "elements": [
        {
          "value": 3,
          "elements": [
            {
              "value": 90,
              "elements": []
            },
            {
              "value": 12,
              "elements": []
            }
          ]
        },
        {
          "value": 5,
          "elements": [
            {
              "value": 11,
              "elements": []
            }
          ]
        },
        {
          "value": 6,
          "elements": []
        }
      ]
    },
    {
      "value": 4,
      "elements": []
    },
    {
      "value": 5,
      "elements": [
        {
          "value": 32,
          "elements": []
        },
        {
          "value": 41,
          "elements": []
        }
      ]
    }
  ]
}

it needs to be presented on the screen in the form of a directed graph Binary_search_tree.svg.png
where links show the nesting of elements in JSON

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question