DistanceVectorandPathVectorRouting
Reading:Sections4.2and4.3.4
COS 461: Computer Networks
Spring 2008 (MW 1:30-2:50 in COS 105)
Jennifer Rexford
Teaching Assistants: Sunghwan Ihm and Yaping Zhu
http:/www.cs.princeton.edu/courses/archive/spring08/cos461/
1
Name or Student ID: _
CNT 4007C
Computer Networks Fundamentals
Prof. Ahmed Helmy
Midterm Exam Tuesday October 25th, 2011
Instructions:
1. Write your name and student ID on this page. Also write your name (or last 4 digits
of your ID) at the top of every p
COMP171
Fall 2006
Pointers
and
dynamic objects
Pointers and dynamic objects/ Slide 2
Topics
Pointers
Memory addresses
Declaration
Dereferencing a pointer
Pointers to pointer
Static vs. dynamic objects
new and delete
Pointers and dynamic objects/ Slide 3
C
COMP171
Fall 2006
Stacks and Queues
Stack and Queue / Slide 2
Stack Overview
Stack ADT
Basic operations of stack
Pushing, popping etc.
Implementations of stacks using
array
linked list
Stack and Queue / Slide 3
Stack ADT
A stack is a list in which insert
COMP171
Fall 2006
Analysis of Algorithms
Analysis of Algorithms / Slide 2
Introduction
What is Algorithm?
a clearly specified set of simple instructions to be followed to
solve a problem
Takes a set of values, as input and
produces a value, or set of val
15.Dynamic Programming
IVPL
Dynamic programming is typically
applied to optimization problems. In
such problem there can be many
solutions. Each solution has a value,
and we wish to find a solution with the
optimal value.
Chapter 15
P.2
IVPL
The developme
16.Greedy algorithms
IVPL
16.1 An activity-selection
problem
Chapter 16
Suppose we have a set S = cfw_a1, a2, ., an of n
proposed activities that with to use a
resource. Each activity ai has a start time si
and a finish time fi, where 0 si < fi < .
If sel
Backtracking and Branch-andBound
Expected Outcomes
Constrained Satisfaction Problems
Describe the ideas of backtracking
and branch and bound techniques
Solve some difficult problems by
the backtracking technique
2
Example: Map Coloring
Variables: WA, NT,
CMP3005
Design & Analysis of
Algorithms
Nafiz ARICA
Week-2
Analysis of Algorithms
Analysis of Algorithms is the area of computer
science that provides tools to analyze the efficiency of
different methods of solutions.
There are two aspects of algorithmic
CMP 3005
Analysis of Algorithms
Heap Sort
Outline
Heaps
Priority Queues
Heap sort
Priority Queues
Many applications require that we process records
with keys in order, but not necessarily in full sorted
order.
Often we collect a set of items and proces
0-1 Knapsack problem
1
Knapsack problem
Given some items, pack the knapsack to get
the maximum total value. Each item has some
weight and some value. Total weight that we can
carry is no more than some fixed number W.
So we must consider weights of items
12.Binary Search Trees
12.1 What is a binary search
tree?
Binary-search property:
Let x be a node in a binary search tree. If
y is a node in the left subtree of x, then
key[y] key[x]. If y is a node in the right
subtree of x, then key[x] key[y].
Chapter 1
Dynamic Programming
Dynamic Programming
Dynamic Programming is a general algorithm design
technique.
Invented by American mathematician Richard Bellman in
the 1950s to solve optimization problems
Main idea:
solve several smaller (overlapping) subproblems
Dynamic Programming
Dynamic Programming
Dynamic Programming is a general algorithm design
technique.
Invented by American mathematician Richard Bellman in
the 1950s to solve optimization problems
Main idea:
solve several smaller (overlapping) subproblems
BG 412
Recurrences
Math Background: Review & Beyond
1. Asymptotic notation
2. Math used in asymptotics
3. Recurrences
4. Probabilistic analysis
Recursion
When an algorithm contains a recursive call to itself,
its running time can often be described by a
CMP3005
Design & Analysis of
Algorithms
Nafiz ARICA
Course Overview
Course Schedule
Monday
14.30-17.30 D311
Tuesday
14.30-17.30 G102,
Textbooks
Cormen, T. H., Leiserson, C. E., Rivest, R. L. and
Stein, C., Introduction to Algorithms (3rd Edition),
MIT
BG 412
Asymptotic Notation
Math Background: Review & Beyond
1. Asymptotic notation
2. Math used in asymptotics
3. Recurrences
4. Probabilistic analysis
2
Asymptotes: Why?
How to describe an algorithms running time?
(or space, )
How does the running time d