Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
9 views
12 pages
DS Week 12
ds week 12
Uploaded by
bonthugoutham
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download
Save
Save DS Week 12 For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
9 views
12 pages
DS Week 12
ds week 12
Uploaded by
bonthugoutham
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Carousel Previous
Carousel Next
Download
Save
Save DS Week 12 For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 12
Search
Fullscreen
235C1202- DATA STRUCTURES WEEK -12 Lab Session: ihe Session__to__ Date of the Session: _/__/ eon Pre requisi © Non-linear data structure! | * Graphs having edges and nodes © Structure definition for nodes © Traversals of a graph © Shortest path algorithm, directed graph that corresponds to this adjacency matrix: 2.Define minimal spanning tree? MST 448 a gebvet He eds + a conneded ) en's hted greph — uwheds —cenreds ol He vedicer — duscther utter ony ade R minim total edse welshis. 3.Define adjacency Matrix of a graph? Ace SACO maltn Ok malt, oy whith ds edge fom ore vedtr AD othen gap eed ak os S47 abhor wire oo *Q’ 4. In How many ways you can represent a graph? Adjacent, mebrix | toked List » ify Aen Seanad ith Comscaner238C1202- DATA STRUCTURES InLab Task 1 Construct the adjacency matrix and adjaceney List for given graph ? | J | sentation/iworiald Link: https:/Avww.hackerearth,com/prac Program: mje HL 8 yt Joann nr) \ 06O _ 2! 0 Oo o \ ' \ 0 oO | w) o 1 oO o Sample Input and Output Seanad ith Comscaner238¢1202- DATA STRUCTURES matrix given below. A non-zero v djacency Mex in the column and apply DFS tp 2.Construct the weighted directed graph represented by the adjacetny 7 at [row, column] indicates that the vertex in the row is adjacent to the the graph A ecve RADE A05800 B30600 co3 410 po6700 E00000 Solution: 192 Seanad ith Comscoer238C1202- DATA STRUCTURES, 3. What is transiti transitive closure? Construct transitive closure matrix for given graph? ‘Solution: HM, hosd et Trawitie doa jo defred os dhe he path bebeeen le were wa one ap o fo 70 9 8 1 fio! ° 2 | oO \ ° 2 Jo 0°° 2 o 1 I 193 Seanad with Comsconer23SC1202- DATA STRUCTURES Post-Lab Task 5h? 1 Apply Prim’s Algorithm to generate minimum Spanning Tree for the following grap! ‘Solution: . ay nee Uwe eet AG herent] vot Cote 8 © ; 6 le ©) hq 9 aot 3) '* qt veishk > joxtt? avelts VOT = ae “st . 194 Seanad ith Comscaer238C1202- DATA STRUCTURES and 12 edges. And you will create a minimum spanning tree Twill be 6 and edges will be (6X). 2The graph GO, E Ww Ee E) given below contains 6 vertio 3(VE) such that the mumber of 6 Graph G(V, E) Solution: - Leg KKrechhal Alge nth: Elye a gerkd odde: Cae wrest . PA or £_{p) e-€ \y 7 are 2 © 0-F aT € Q c-F om 3 c-¥ 4 p-9 6- Yer, ah do posible ge dieeck Ae B ae a MST atthe 6 £ edsa a Ale g° c. TR abe AIT Ab he answer. 195 Seanad ith ComscaerDASCLIOD Oth SRE Vind the Trnsitive Closure for the following Dingraph QE © .O) af\ yo J b ,oyo ood o0o0°0 °°? (ot 4 4 Disconnected Graph, Find the reachability /Graph Traversal using DFS or Depth First Scares start Solution: ee ee eo: . 25 0—> | -—y 2 196 Seanad with Comscaner1238C1202- DATA STRUCTURES 3.Find Mini, inimum Cost Spanning Tree (MST) ofa given connected undirected graph using Kruskal’ algorithm Soli Edge? Else vt mt ja an y-2 3% 3-2 3~ | s-) de | y-3 5 * | a-6 tr 3-6 &* | gow 1% | MST: Hain Cyt 2 M+here Behe a 197 Seanad ith Comscaner235C1202- DATA STRUCTURES 4.Prim's (MST): (MST): Consider the following graph as an example for which we need to find the Minim ‘um, Spanning Tree (MST). Xt ©) | “ | 4 i \ “O@- @- oO Example of a Graph Hrorltet Qei3 FF 7 i 38° => 198 Seanad ith Comscaner238C1202- DATA STRUCTURES §. Constr "1 Het the adjacency matrix. and adjaceney List for graph given below? ® Link: q Ink: httpe:// www hackerearth,com/practice/algorithms/graphs/zraph-representation Program: Adjacerg Prod tOr e Taye 2 24 [ ote) 2 tay e 3 o1 oO ! 4 {Oe Adyecenty lots ALA 27 Yy ALA 1-3 AR D294 AI 193 Sample Input and Output 199 Seanad with Comscaner239C1202- DATASTRUCTURES 6 Find the MST and it’s total weight for the given graph using Kruskal algorithm? Solution: Edges yn ecend'es onder: ce no Ease weigh — ie lo an. o 4-3 Ve “+ 4 a4 \6 wv gor J o-% 22 em PS Sf p23 8 ve @ éée vi FHT Kynoned , coz for a wade 200 Seanad ith Comscaner23SC1202- DATASTRUCTURES vi \-Q kyrored peor it jor a wade. Tod uveisht= oa 25 rd r2ar4l6 ~ 72) (for Evaluators only) ‘Comment of the E\ Gf_Am Evaluator’s Observation Marks Secured: out of Full Name of the Evaluator: Signature of the Evaluator Date of Evaluation: 04 Seanad ith Comscaner
You might also like
Data Structures Unit 4
PDF
No ratings yet
Data Structures Unit 4
43 pages
Design & Analysis of Algorithms: Lecture#10 Graph Introduction, BFT, DFT, MST, Shortest Path
PDF
No ratings yet
Design & Analysis of Algorithms: Lecture#10 Graph Introduction, BFT, DFT, MST, Shortest Path
115 pages
UNIT 4-Graph-1
PDF
No ratings yet
UNIT 4-Graph-1
59 pages
GRAPHS
PDF
No ratings yet
GRAPHS
15 pages
DSA Lab-9: - Arjav Kanadia IEC2020101
PDF
No ratings yet
DSA Lab-9: - Arjav Kanadia IEC2020101
17 pages
6 Graphsssssss
PDF
No ratings yet
6 Graphsssssss
93 pages
Week 5 Graph Algorithms
PDF
No ratings yet
Week 5 Graph Algorithms
42 pages
Ds Unit 4
PDF
No ratings yet
Ds Unit 4
5 pages
Unit-5 Graph - Hashing - Student
PDF
No ratings yet
Unit-5 Graph - Hashing - Student
46 pages
Unit 6
PDF
No ratings yet
Unit 6
53 pages
Unit V
PDF
No ratings yet
Unit V
40 pages
DS Unit Iv
PDF
No ratings yet
DS Unit Iv
32 pages
DS9B
PDF
No ratings yet
DS9B
30 pages
Week 5 - Graph Algorithms
PDF
No ratings yet
Week 5 - Graph Algorithms
123 pages
Data Structure and Algorithms - BFS and DFS
PDF
No ratings yet
Data Structure and Algorithms - BFS and DFS
8 pages
DSA Unit-5
PDF
No ratings yet
DSA Unit-5
227 pages
Example:: Connected Graph Complete Graph - Weighted Graph - Digraph
PDF
No ratings yet
Example:: Connected Graph Complete Graph - Weighted Graph - Digraph
2 pages
Csn-261 (Data Structures Laboratory)
PDF
No ratings yet
Csn-261 (Data Structures Laboratory)
51 pages
Graph Algorithms 10 271709207487730
PDF
No ratings yet
Graph Algorithms 10 271709207487730
21 pages
Graphs
PDF
No ratings yet
Graphs
51 pages
Aphs
PDF
No ratings yet
Aphs
118 pages
Graphs & Algorithms
PDF
No ratings yet
Graphs & Algorithms
14 pages
SE E&TC DS Unit6 D.F.raka Watermark
PDF
No ratings yet
SE E&TC DS Unit6 D.F.raka Watermark
46 pages
UNIT V - Graphs
PDF
No ratings yet
UNIT V - Graphs
18 pages
Lec 10 Graphs S22
PDF
No ratings yet
Lec 10 Graphs S22
50 pages
DSA
PDF
No ratings yet
DSA
48 pages
19 Finalreview
PDF
No ratings yet
19 Finalreview
20 pages
Dsa Assignment 3 2024
PDF
No ratings yet
Dsa Assignment 3 2024
5 pages
Assign3 Attempt
PDF
No ratings yet
Assign3 Attempt
14 pages
DSA Unit-5
PDF
No ratings yet
DSA Unit-5
230 pages
DSAL-assignment No-7-8-9-10
PDF
No ratings yet
DSAL-assignment No-7-8-9-10
25 pages
Lecture Graph
PDF
No ratings yet
Lecture Graph
16 pages
Assignment 2
PDF
No ratings yet
Assignment 2
33 pages
Dsa24 8
PDF
No ratings yet
Dsa24 8
43 pages
Assignment 03 MDMH
PDF
No ratings yet
Assignment 03 MDMH
5 pages
Ads 5 Graph
PDF
No ratings yet
Ads 5 Graph
42 pages
Unit-4 Dsa
PDF
No ratings yet
Unit-4 Dsa
7 pages
CS6103 SS Lab Problem Set 1c: Data Structures 09-Aug-2016
PDF
No ratings yet
CS6103 SS Lab Problem Set 1c: Data Structures 09-Aug-2016
6 pages
Graph
PDF
No ratings yet
Graph
52 pages
Unit 5 DS
PDF
No ratings yet
Unit 5 DS
30 pages
Graphs
PDF
No ratings yet
Graphs
46 pages
Slide 2 Onenote
PDF
No ratings yet
Slide 2 Onenote
40 pages
Slide 11 - Graph
PDF
No ratings yet
Slide 11 - Graph
32 pages
Graphs
PDF
No ratings yet
Graphs
26 pages
Lecture 24
PDF
No ratings yet
Lecture 24
27 pages
Dhiraj
PDF
No ratings yet
Dhiraj
9 pages
Lab9 Graph
PDF
No ratings yet
Lab9 Graph
74 pages
Week 14
PDF
No ratings yet
Week 14
38 pages
Module 5 Ds
PDF
No ratings yet
Module 5 Ds
17 pages
Review 4: CSCI 2720: Data Structures
PDF
No ratings yet
Review 4: CSCI 2720: Data Structures
33 pages
Institute of Technology: Programming and Data Structures - II
PDF
No ratings yet
Institute of Technology: Programming and Data Structures - II
88 pages
Graph
PDF
No ratings yet
Graph
62 pages
Unit IV College Notes
PDF
No ratings yet
Unit IV College Notes
12 pages
Dsa Assignment2
PDF
No ratings yet
Dsa Assignment2
8 pages
Graphs Sample
PDF
No ratings yet
Graphs Sample
15 pages
Ankur Graph
PDF
No ratings yet
Ankur Graph
12 pages
Unit 4 Data Structure
PDF
No ratings yet
Unit 4 Data Structure
19 pages
Chapter9 Part1 Graph Basics
PDF
No ratings yet
Chapter9 Part1 Graph Basics
16 pages
AD3251 - DS - Unit 5 - Graph Structures
PDF
No ratings yet
AD3251 - DS - Unit 5 - Graph Structures
67 pages