SsssComplement?
- To: mathgroup at smc.vnet.net
- Subject: [mg37831] SsssComplement?
- From: "Mozalev Vasil" <mvp at snklik.ryazan.ru>
- Date: Thu, 14 Nov 2002 06:11:53 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
Hi. Excuse me for poor-quality English language. My question about "Complement" and "UnsortedComplement". Function " UnsortedComplement [list, listi] " working more slowly then function " Complement [list, listi] " because deletes elements "listi" behind many passes, whereas " Complement [list, listi] " it makes for one pass. What kind of procedure I can use to write " SssssComplement [list, list1] " for maintenance of removal elements "list1" from "list" without sorting, but for one pass? The specified lists already are sorted before their processing by function " SssssComplement [list, list1] ". It is necessary for acceleration of accounts. Example for check of correctness of work of required function: SssssComplement [{1,3,5,7,10}, {3, 7,10}] should give {1,5}. But SssssComplement [{1,3,5,7,10}, {7,3,10}] should give {1,3,5}, as for one pass the number 3 will not leave. Thank you. Vasil.