thanks lynn,
following is what i want..
2323 (2323 should have childs like 23231000,23232,23233000,232390 as its child))
23231000 ( should have nothing)
23232 (should have 232321,232329 as its child)
23233000(should have 23239010,23239020,23239030,23239040,23239090 as its child)
232390 ( should have nothing)
232321 (should have 23232110,23232190 as its child)
232329 (should have 23232910,23232990 as its child)
so the expected op is
2323,23231000,23232(232321(23232110,23232190),232329(23232910,23232990)),23233000(23239010,23239020,23239030,23239040,23239090),232390