Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Translate the puesodo code into C++. blockDFS(v) Connectivity in undirected graphs pred(v) num(v) i++ push edge(vu)) blockDFS(u); e pop); for all vertices u adjacent to

Translate the puesodo code into C++.

image text in transcribed

blockDFS(v) Connectivity in undirected graphs pred(v) num(v) i++ push edge(vu)) blockDFS(u); e pop); for all vertices u adjacent to v if edge(vu) not on stack if num(u) is 0 /! if there is no edge from u to /l a vertex above V, output a block /l by popping all edges off the stack // until edgetvu) is popped off if pred(u) 2 num(v) while e edge(VU) output e e pop) // e == edge(vu); output e pred(v) min(pred(V),pred(u); /I take a predecessor higher up in else if u is not the parent ofv the tree; predv) min(predv),num(u):// update when back edge(vu) is found; blockSearch0) for all vertices V num(v) = 0; while there is a vertex V such that num(v)0 blockDFS(v); Connectivity in undirectedpreda) Connectivity in undirected blockDES(a) ush edge (ac) graphs: example ush edge(ce) ckDES(e,red(e) = 3 nume 1 1)b(5,4) lockDES(d push edge(da) pred(d)min ush edge(db) 22) d(4 4) ipredid),num(a))-1 lockDFS(b push edge(bf) blockD numm h(8 8) push edge(fd) pred(h-min(pred(f),num(d)) = 4 push edge(fg) blockDFS(g) eage num(g output edge(fg) blockDFS(h) output edge( fh) pred(e)-min(pred(e)Pred( d )) push edge(fh eage(ac num(h)- pred(h) = 8 pred(b) minkpred b) pred(f output edge(fd), edge(bf), edge db) 4 red(C) min(pred(C),pred(e)) = utput edge(da), edgeled), edge(ce), edge(ac) blockDFS(v) Connectivity in undirected graphs pred(v) num(v) i++ push edge(vu)) blockDFS(u); e pop); for all vertices u adjacent to v if edge(vu) not on stack if num(u) is 0 /! if there is no edge from u to /l a vertex above V, output a block /l by popping all edges off the stack // until edgetvu) is popped off if pred(u) 2 num(v) while e edge(VU) output e e pop) // e == edge(vu); output e pred(v) min(pred(V),pred(u); /I take a predecessor higher up in else if u is not the parent ofv the tree; predv) min(predv),num(u):// update when back edge(vu) is found; blockSearch0) for all vertices V num(v) = 0; while there is a vertex V such that num(v)0 blockDFS(v); Connectivity in undirectedpreda) Connectivity in undirected blockDES(a) ush edge (ac) graphs: example ush edge(ce) ckDES(e,red(e) = 3 nume 1 1)b(5,4) lockDES(d push edge(da) pred(d)min ush edge(db) 22) d(4 4) ipredid),num(a))-1 lockDFS(b push edge(bf) blockD numm h(8 8) push edge(fd) pred(h-min(pred(f),num(d)) = 4 push edge(fg) blockDFS(g) eage num(g output edge(fg) blockDFS(h) output edge( fh) pred(e)-min(pred(e)Pred( d )) push edge(fh eage(ac num(h)- pred(h) = 8 pred(b) minkpred b) pred(f output edge(fd), edge(bf), edge db) 4 red(C) min(pred(C),pred(e)) = utput edge(da), edgeled), edge(ce), edge(ac)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Current Trends In Database Technology Edbt 2006 Edbt 2006 Workshops Phd Datax Iidb Iiha Icsnw Qlqp Pim Parma And Reactivity On The Web Munich Germany March 2006 Revised Selected Papers Lncs 4254

Authors: Torsten Grust ,Hagen Hopfner ,Arantza Illarramendi ,Stefan Jablonski ,Marco Mesiti ,Sascha Muller ,Paula-Lavinia Patranjan ,Kai-Uwe Sattler ,Myra Spiliopoulou ,Jef Wijsen

2006th Edition

3540467882, 978-3540467885

More Books

Students also viewed these Databases questions

Question

Were they made on a timely basis?

Answered: 1 week ago

Question

Did the decisions need to be made, or had they already been made?

Answered: 1 week ago