Welcome to the Monastery | |
PerlMonks |
Includes within includesby msk_0984 (Friar) |
on Dec 23, 2006 at 05:02 UTC ( [id://591418]=perlquestion: print w/replies, xml ) | Need Help?? |
msk_0984 has asked for the wisdom of the Perl Monks concerning the following question:
Hi Respected Monks,         I have been assigned a task to open a File which contains of some lines of code ( rules not much to worry about) and the main ones are the include lines which is nothing but as
        So these kind of include statements which consists of path about another device rules file and we have to open this file i.e think we have got the first inlcude statement from the file since its a inlcude statement grep out the complete file path and Open this file and see if it too contins any other inlcude statements in it if it has open them too and if it does not then start BAcking up the File and then agian back track and back up the main file too... So back up all the file ...........         So what i went for the solution is used up a Recursive type of method but my sir says that IF in the first file there r "n" number of inlcude statements and in the first inlcude statemanet after u open it agiang think there are another "n" inlcude statements then the completxity of the program would be come to order of O(n2) n square so he wants to reduce the complexity to O(n log n) and proposed me to go for THREADS but i did not feel the complexity would be reduced but the Memoru allocation and time complexity would be imporved ....         So monks i need ur suggestions is there any other idea or we have to go by the recursive on or by the Threaded concpets.
Work Hard Party Harderrr!! Sushil Kumar
Back to
Seekers of Perl Wisdom
|
|