1 / 7

To find Connected components for set of pairs

To find Connected components for set of pairs. By Suvarna Khadke. Input (set of pairs…). pairs.txt: Storing these pairs in my data structures as per below diagram 0 1 0 2 0 3 2 5 2 7 4 9 5 8 10 11 10 12. scan each list till end of list

jeb
Télécharger la présentation

To find Connected components for set of pairs

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. To find Connected components for set of pairs By Suvarna Khadke

  2. Input (set of pairs…) pairs.txt: Storing these pairs in my data structures as per below diagram • 0 1 • 0 2 • 0 3 • 2 5 • 2 7 • 4 9 • 5 8 • 10 11 • 10 12 scan each list till end of list |HEAD(LinkedList) |-----------------------|------| (next pointer)(Horizontal) 0 4 10 ------|-------- | --|-- | | | | | | 1 2 3 9 11 12 | ----- | | 5 7 | (List pointer (vertical) 8

  3. output • Output will be set of connected components shown below • 0: 0 1 2 3 5 7 8 • 1: 4 9 • 2: 10 11 12

  4. Data structure used for program typedef struct _GLL { struct _GLL *list; //LinkedList for storing connected component int element; struct _GLL *next ; //LinkedList for storing list of connected component } GLL, *PGLL; //pointer to GLL linkedlist

  5. Input.txt file

  6. Output.txt

  7. Thank You

More Related