Data Structures & Algorithms in Kotlin by By Márton Braun & By Irina Galata

Data Structures & Algorithms in Kotlin by By Márton Braun & By Irina Galata

Author:By Márton Braun & By Irina Galata
Language: eng
Format: epub
Publisher: Ray Wenderlich


You set isTerminating to false so that the current node can be removed by the loop in the next step.

This is the tricky part. Since nodes can be shared, you don’t want to carelessly remove elements that belong to another collection. If there are no other children in the current node, it means that other collections do not depend on the current node.

You also check to see if the current node is a terminating node. If it is, then it belongs to another collection. As long as current satisfies these conditions, you continually backtrack through the parent property and remove the nodes.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.