From 6cda436872f70fa6532c7827cd4f80a5ae25247c Mon Sep 17 00:00:00 2001 From: kekeandzeyu Date: Wed, 24 Jul 2024 10:26:26 +0800 Subject: [PATCH] Add more notes in Data Structures and Algorithms! --- .idea/.name | 2 +- .../Data-Structures-and-Algorithms-2.md | 49 +++++++++++-------- 2 files changed, 30 insertions(+), 21 deletions(-) diff --git a/.idea/.name b/.idea/.name index 2dd35a1..5ac0781 100644 --- a/.idea/.name +++ b/.idea/.name @@ -1 +1 @@ -Computer-Architecture.md \ No newline at end of file +Cover.md \ No newline at end of file diff --git a/Writerside/topics/Data-Structures-and-Algorithms-2.md b/Writerside/topics/Data-Structures-and-Algorithms-2.md index b09c8a0..fb70574 100644 --- a/Writerside/topics/Data-Structures-and-Algorithms-2.md +++ b/Writerside/topics/Data-Structures-and-Algorithms-2.md @@ -3665,23 +3665,31 @@ class StronglyConnectedComponents: ### 16.1 Introduction to MSTs -* Def: Given an undirected graph G with positive edge weights, - (connected), a spanning tree of G - is both a tree (connected and - acyclic) and spanning (includes - all of the vertices). - -Alt text - -* Applications: Network design (communication, elctrical, hydraulic, - computer, road), dithering, cluster analysis, max bottleneck paths, - models of nature, medical image processing, real-time face - verification, etc. - -* Let G be a connected, edge-weighted graph with V - vertices and E edges. How many edges are in a minimum - spanning tree of G? -* Answer: V - 1. + +
  • +

    Definiton: Given an +undirected graph G with positive edge weights (connected), a +spanning tree of G +is both a tree (connected and +acyclic) and spanning (includes +all of the vertices).

    +MST +
  • +
  • +

    Applications: Network design +(communication, elctrical, hydraulic, computer, road), dithering, +cluster analysis, max bottleneck paths, models of nature, medical +image processing, real-time face verification, etc.

    +
  • +
  • +

    Let G be a connected, edge-weighted graph with +V vertices and E edges. How many edges are +in a minimum spanning tree of G ?

    +
  • +
  • +

    Answer: V - 1.>

    +
  • +
    ### 16.2 Greedy Algorithm @@ -3702,9 +3710,9 @@ class StronglyConnectedComponents: * Cut property: Given any cut in a graph, the crossing edge of min weight is in the MST. -Alt text +Greedy Algorithm - +

    Start with all edges colored gray.

    @@ -3713,7 +3721,8 @@ class StronglyConnectedComponents: min-weight edge black.

    -

    Repeat until V - 1 edges are colored black.

    +

    Repeat until V - 1 edges are colored black. +