i developed my own algorithm for optimizing the query in WSN. How to write the code in NS2 for that.I studied NS2 and have good knowledge of all programming language
You need to understand the source code add your developed code into the existing ns2 source code and again compile the whole code and run it. It required a good understanding of the ns2 source code and where to insert your own code.