Algorithm - Numbering for TOC (Table of Contents)
- by belisarius
I want to implement a VBA function to number Excel rows based upon the grouping depth of the row.
But I think a general algorithm for generating TOCs is more interesting.
The problem is:
Given a list of "indented" lines such as
One
Two
Three
Four
Five
Six
(the "indentation level" may be assumed to be known and part of the input data)
…