Posts

How to install NS2 2.34 on ubuntu 10.04

Download ns-allinone-2.34 and Install I downloaded from https://sourceforge.net/projects/nsnam/files/allinone/ns-allinone-2.34/ns-allinone-2.34.tar.gz/download Cut the downloaded file from the Downloads folder and paste it to your desired folder for installation $ tar -xzvf ns-allinone-2.32.tar.gz $ cd ns-allinone-2.32 (before install ns-2 you will need the packages that are shown below ) $ sudo apt-get install build-essential autoconf automake libxmu-dev $ sudo apt-get install libx11-dev libxmu-dev libxmu-headers libxt-dev libtool $ sudo apt-get install dpkg-dev g++ libc6-dev make $ sudo apt-get install tcl8.4 tk8.4 $ sudo apt-get install build-essential These packages might be dependent on each other so I remember installing the packages in reverse order. Install the development files for X Windows plus the g++ compiler: sudo apt-get install xorg-dev g++ xgraph Fix the error in the linking of otcl by editing line 6304 of otcl-1.13/configure so that it reads

Create a new agent for NS

In the new header file 'X.h' I copied contents from existing file ping.h and saved it

Finding the subtree with maximum imbalance.

This was given in the written test for Goldman Sach and I have solved this question in O(n) time complexity, as per my knowledge. If  any one could do better or would require my code. Contact me at pushpita1988@gmail.com  . I cannot attach the c code here.

Nicholas Sparks...whose words I admire :)

"“And when her lips met mine, I knew that I could live to be a hundred and visit every country in the world, but nothing would ever compare to that single moment when I first kissed the girl of my dreams and knew that my love would last forever.” Words and wonders all together, love could be defined with none tethered.

UGLY NUMBERS

Even numbers could be ugly!!!! I suddenly find number systems and C to be greatly interesting :) :) Recently going through the net I found a question... Ugly numbers are numbers whose only prime factors are 2, 3 or 5. The sequence 1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, ... shows the first 11 ugly numbers. By convention, 1 is included. We need to find 1500'th ugly number. ---------------------------------------------Best solution according to me--------------------------------------------------  if x is ugly, then so are 2x, 3x and 5x. So we can use a min-heap. Start with 1 in the heap. Now if we do the following in a loop: x = Heap.PopCurrentMin(); Heap.Insert(2x); Heap.Insert(3x); Heap.Insert(5x) I believe this will work. Not sure what the time complexity will be, but my guess is that this is reasonably efficient. :) If any one finds a better solution....Please do post!!!!

How to install leach protocol on ns2.34 in ubuntu 9.10

I suppose that ns-2.34 is installed with the compiler gcc-4.3. The home directory of ns-2.34 is "/opt/ns-allinone-2.34" 1- download the package "ns-234-leach.tar.gz" into the directory "/opt/ns-allinone-2.34/ns-2.34". https://docs.google.com/uc?id=0BzLWx...CNWG1NQK&hl=en 2- download the bash file "leach-setup.sh" into the directory "/opt/ns-allinone-2.34/ns-2.34". https://docs.google.com/uc?id=0BzLWx...CJSU5ZYG&hl=en 3- If the home directory of your "ns-2.34" is other than "/opt/...", then you need to find "/opt/ns-allinone-2.34" and replace with "yourpath/ns-allinone-2.34" for the file "leach-setup.sh". 4- move to the directory "/opt/ns-allinone-2.34/ns-2.34" and patch the file "leach-setup.sh" wsn@ubuntu:~$ cd /opt/ns-allinone-2.34/ns-2.34/ wsn@ubuntu:/opt/ns-allinone-2.34/ns-2.34$ bash leach-setup.sh 5- If the home directory of your "ns-2.34&