I have a problem with Materialized path, so I thought may be here somebody can help me. I wrote a class which provides operations with Materialized path such as add, edit, delete and move. It’s pretty easy, but I have a problem with tree normalization.
Imagine we have the following tree:
1.1
1.2
1.4
1.4.1
1.6
1.8.2.1
and we need to change it to:
1.1
1.2
1.3
1.3.1
1.4
1.5
How can we do it? I mean can somebody give an algorithm?
If it were so simple, I wouldn’t have created the topic. I understand the need to go through the array and rebuild it, but you need to take into account the nesting level…