Depth of a json tree
问题 I have a tree of the form: { "id":442500000904671234, "reply":0, "children":[ { "id":442500532536893440, "reply":1, "children":[ { "id":442500826561785856, "reply":1, "children":[ { "id":442501277688545280, "reply":1, "children":[ { "id":442501561940709376, "reply":1, "children":[ { "id":442501884709199872, "reply":1, "children":[ ] } ] } ] } ] } ] }, { "id":442500099315597312, "reply":0, "children":[ ] } ] } How do I find maximum depth of the tree in python? 回答1: You can parse JSON with