Skip main navigation
PLUSSA
v1.11.4
COMP.CS.300 COMP.CS.300 Tietorakenteet ja algoritmit 1 / Data Structures and Algorithms 1
Begin by enrolling in a course.
Toggle navigation
Log in
Skip course navigation
Language
Change language
suomi
suomi
Course
COMP.CS.300
Course materials
Your points
Form a group
Videos
Panopto-en
(opens in a new tab)
Panopto-fi
(opens in a new tab)
Specifications
prg-EN
(opens in a new tab)
prg-FI
(opens in a new tab)
Teams
Teams
(opens in a new tab)
Zoom (exercise sessions)
Zoom
(opens in a new tab)
Site
Home
Begin by enrolling in a course.
Log in
You need to sign in and enrol to submit exercises.
Skip course navigation
Language
Change language
suomi
suomi
Course
COMP.CS.300
Course materials
Your points
Form a group
Videos
Panopto-en
(opens in a new tab)
Panopto-fi
(opens in a new tab)
Specifications
prg-EN
(opens in a new tab)
prg-FI
(opens in a new tab)
Teams
Teams
(opens in a new tab)
Zoom (exercise sessions)
Zoom
(opens in a new tab)
This course has already ended.
«
7.1 Course topics 10, 11 and 12
Course materials
7.2 Course topic 10 exercises
»
COMP.CS.300
7. Graphs
7.1 Course topics 10, 11 and 12
7.1.2 Breadth first search (BFS)
Assignment description
My submissions (0/3)
No submissions yet
You cannot submit this assignment
You need to sign in and enrol to submit exercises.
Show anyway
Breadth first search (BFS)
*
Question 1
2 points
Suppose a BFS algorithm starts from node
\(s\)
. Suppose
\(x\)
is some other node and a path from
\(s\)
to
\(x\)
exists. Why does the BFS algorithm assign different colors to
\(x\)
?
To indicate the number of adjacent nodes to
\(x\)
.
To monitor whether the path from
\(s\)
to
\(x\)
has been discovered and whether
\(x\)
has been completely processed.
To ensure that when BFS is finished no two adjacent nodes have the same color.
To ensure that in the queue used by BFS, no two nodes have the same color.
*
Question 2
2 points
Suppose a directed graph has 4 nodes
\(s\)
,
\(a\)
,
\(b\)
and
\(c\)
. Suppose in addition the graph has all possible edges except 2: the edge from
\(s\)
to
\(a\)
and the edge from
\(a\)
to
\(b\)
. What are the distances from
\(s\)
to each of the other nodes?
from
\(s\)
to
\(a\)
2, from
\(s\)
to
\(b\)
2, from
\(s\)
to
\(c\)
1
from
\(s\)
to
\(a\)
1, from
\(s\)
to
\(b\)
2, from
\(s\)
to
\(c\)
1
from
\(s\)
to
\(a\)
2, from
\(s\)
to
\(b\)
1, from
\(s\)
to
\(c\)
2
from
\(s\)
to
\(a\)
2, from
\(s\)
to
\(b\)
1, from
\(s\)
to
\(c\)
1
Posting submission...
Earned points
0
/ 4
Exercise info
Assignment category
_theory
Your submissions
0 / 3
Deadline
Sunday, 24 November 2024, 23:59
Total number of submitters
40
«
7.1 Course topics 10, 11 and 12
Course materials
7.2 Course topic 10 exercises
»
Loading...
Loading...
×
None
×
No matches