... $tcp0
set telnet [new Application/Telnet]
$telnet attach-agent $tcp0
NS-2 Tutorial
Kameswari Chebrolu
Dept. ofComputerScienceand Engineering,
IIT Bombay
Reference Material
●
http://www.isi.edu/nsnam/ns/
●
Marc ... conditions
–
Repeatability helps aid debugging
●
Disadvantages: Real systems too complex to
model
Creating TCP Connections
●
Create TCP agent and attach it to the node
●
Create a Null Agent and attach ... Structure
●
Create the event scheduler
●
Turn on tracing
●
Create network topology
●
Create transport connections
●
Generate traffic
●
Insert errors
Sending data
●
Connect two agents
●
Start and stop of data
$ns...
... DataIn)
4. else
1. return duplicate_error
5. End recursive_Insert
Faculty ofComputerScienceandEngineering
Department ofComputerScience
2/4
Return element of s is appended into q with ... (compute(a,n)>compute(a,n-1))?compute(a,n):compute(a,n-1)
3233
6,5,4
4,5,6
Faculty ofComputerScienceandEngineering
Department ofComputerScience
1/4
DATA STRUCTURES & ALGORITHMS
Tutorial 3 Questions
Recursion and Binary Tree
Part ...
Faculty ofComputerScienceandEngineering
Department ofComputerScience
4/4
Part 2. Binary Tree
Required Questions
Question 8.
For each of the following key sequences...
...
Faculty ofComputerScienceandEngineering
Department ofComputerScience
2/3
Question 6.
Suggest a data structure that supports the following operation and given time complexities: ... Comparable<E>> {
private class Node {
E data;
Node left, right;
}
Node root;
}
Faculty ofComputerScienceandEngineering
Department ofComputerScience
3/3
Write a recursive ... root element of the tree generated
in the all cases of the previous question.
Advanced Questions
Question 9.
The following class definition will be used for the problem that follow:
public...
... Faculty ofComputerScienceandEngineering
Department ofComputerScience
Page 1/5
LAB SESSION 1
BASIC OPERATIONS ON LINKED LIST
1. OBJECTIVE
The objectives of Lab 1 are (1) ... pTemp->data = 5;
pTemp->next = NULL; //
pHead = pTemp; // the list now is {5}
pTemp = new Node;
count++;
Faculty ofComputerScienceandEngineering
Department ofComputerScience ... ordered list). This method will return:
Faculty ofComputerScienceandEngineering
Department ofComputerScience
Page 2/5
pTemp->data = 3;
pTemp->next = pHead;
pHead = pTemp;...
... is sorted in ascending order and n is added successfully.
Faculty ofComputerScienceandEngineering
Department ofComputerScience
Page 2/7
pTemp->data = 3;
pTemp->next = pHead; ... if n is a
square number. In that case the returned result is 1, otherwise 0.
Solution:
Faculty ofComputerScienceandEngineering
Department ofComputerScience
Page 5/7
int addFirstIfPerfectSquare(int ... addEventFirst(int n){
if(n mod 2 == 0)
addFirst(n);
else
Faculty ofComputerScienceandEngineering
Department ofComputerScience
Page 6/7
addLast(n)
}
3.6. Write for the class...
...
Faculty ofComputerScienceandEngineering
Department ofComputerScience
3/3
Listing 3 gives a scenario in which we try to develop a method getSize() to count the
number of nodes of the ...
Faculty ofComputerScienceandEngineering
Department ofComputerScience
2/3
}
//
Tree::~Tree() {
destroy(root);
root = ...
(http://en.wikipedia.org/wiki/Heap_%28data_structure%29) or not.
4.6. Write methods to travel the tree in LNR and put all data in a linked list. The order of
elements in the list should be the same with that of the result of...
...
Faculty ofComputerScienceandEngineering
Department ofComputerScience
Released on 03/09/2012 10:09:56 1/5
DATA STRUCTURES & ALGORITHMS
Tutorial 1 Questions
COMPUTATIONAL COMPLEXITY ... Faculty ofComputerScienceandEngineering
Department ofComputerScience
Released on 03/09/2012 10:09:56 4/5
Advanced Questions
Question 8.
Prove that for any positive functions f and ... Faculty ofComputerScienceandEngineering
Department ofComputerScience
Released on 03/09/2012 10:09:56 5/5
2 loop (j < i)...
...
Faculty ofComputerScienceandEngineering
Department ofComputerScience
Released on 24/08/2012 20:06:39
2/4
Question 5.
If the algorithm doIt has an efficiency factor of 2n, calculate the ...
Faculty ofComputerScienceandEngineering
Department ofComputerScience
Released on 24/08/2012 20:06:39
3/4
Advanced Questions
Question 8.
Prove that for any positive functions f and ... corresponding to n
1 if (n <= 1)
1 return 1
2 else
Faculty ofComputerScienceandEngineering
Department ofComputerScience
Released on 24/08/2012 20:06:39
4/4
1 return f(n – 1)...
...
Faculty ofComputerScienceandEngineering
Department ofComputerScience
Page 2/10
a. f – k
b. f *k
c. f\ 10
d. f\ x
e. f* f
2
Faculty ofComputerScienceandEngineering ... s2{1,9,4,2}
s1{7,10}
s1{2,4,9,1,7,10}s2{rong}
s1{9,1,7,10}
s2{4,2}
pop(SourceStack,x)
pop(SourceStack,y)
Push(SourceStack,x)
Faculty ofComputerScienceandEngineering
Department ofComputerScience
Page 9/10
Two ways of queue implementation
Basically, the principle of a queue is first in first ... ScienceandEngineering
Department ofComputerScience
Page 1/10
x
x
4
3
2
- 5
+
x
2
+ 4
x
2
4x
3
-
3x
2
-5
+
-
-4x
19
2X
2
+1
3/2x
3x
3
-1/2
Faculty ofComputerScienceand Engineering...
... la-
bel of a node and input features of other argument
nodes. The features are specified by instantiation of
templates and the value of a feature is the number of
times a particular pattern occurs ... template, that extracts PATH from every node in
the candidate argument sequence and concatenates
it with the label of the node. Both a feature with
the specific argument label is created and a feature
with ... se-
quence feature template that extracts the labels of
all argument nodes, and preserves information about
the position of the predicate. The template also
includes information about the voice of the...
... input data, process data and output
data, accurately andat great speed. Data are any kind of information that can be codified in some
manner and input into the computer. Normally, we think of data ... 551
Section B: A ComputerScience Example 557
Cs12a — Arrays of Strings 557
Section C: Engineering Examples 564
Matrix Algebra 564
Matrix Math Operations Summary 565
Mathematical Theorems of Determinants ... More Compact Loop That Detects End of File 165
Applications of Loops 166
Application: The Summation of a Series 166
Counters and Totals — Grand Totals 167
Finding the Maximum and Minimum Values...
... on the right-hand side represents the rate of
formation of particles of volume v due to coagulation, and
the second term that rate of loss of particles of volume v by
coagulation with all ... Natural Systems for
Wastewater Treatment. Planning Water Supply and Sanitation Projects in Developing Nations. Small Flow
Wastewater Treatment for Domestic and Special Applications. Water and ...
the response of a plant to a particular exposure incident is
dependent upon the concentration and duration of exposure
and, because of the opening and closing patterns of stomata,
also on...
... variety of electronic formats. Some content that appears
in print may not be available in electronic books.
Library of Congress Cataloging-in-Publication Data
Handbook of photovoltaic scienceandengineering ... publication is designed to provide accurate and authoritative information in regard to the subject
matter covered. It is sold on the understanding that the Publisher is not engaged in rendering
professional ... without operating at high temperature and without
mobile parts. These are the salient characteristics of photovoltaics that explain safe, simple,
and reliable operation.
At the heart of any solar...
... Definitions of Capacity and State of Charge 907
20.3 Typical Operation Conditions of Batteries in PV Applications 908
20.3.1 An Example of an Energy Flow Analysis 908
20.3.2 Classification of Battery ... edition of the Handbook of Photovoltaic ScienceandEngineering was published in 2003.
It described the results of 50 years of research, technology, product development, and applications
of solar ... exploitation may be attractive.
Wind is generated by the solar energy (through the differential heating of the Earth in
equatorial and polar regions). It has been calculated [3] that about 1% of...