Posted by Anonymous on Sun 14th Jan 12:09 (modification of post by Anonymous view diff)
diff | download | new post
- count = 0
- List IDs
- int noParts (Part p) {
- if(p.subParts != null){
- IDs.push(p.id)
- counter++
- }
- noSubParts(p.subParts);
- return count;
- }
- void noSubParts (Node n) {
- if (n != null) {
- if(n.next != null)
- noSubParts(n.next)
- if(n.part != null && isNew(n.part)){
- count++
- noSubParts(n.part)
- }
- }
- }
- bool isNew(Part p){
- if(p.id == i.id){
- IDs.push(p.id)
- return false
- }
- }
- return false
- }
Submit a correction or amendment below. (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.