as ed - PowerPoint PPT Presentation

1 / 19
About This Presentation
Title:

as ed

Description:

?a? ?? (degree) e??? ?? ??: a??? ?? t?? pa?d??? t??. ... lc. ? a??????? s??s? ?s??e? ??a d?ad??? d??t?a e n ?? ??? t??? ?p????? t? ???? e??a? h ... – PowerPoint PPT presentation

Number of Views:39
Avg rating:3.0/5.0
Slides: 20
Provided by: christosp1
Category:
Tags: degree

less

Transcript and Presenter's Notes

Title: as ed


1
?as???? ??µ?? ?ed?µ????
  • S??t?µ? epa?????? (??? 035).

2
?e??????
  • G?aµµ???? ??µ?? ?ed?µ????
  • ???a?e?
  • ??ste?
  • St??ße?
  • ?????
  • G??f??
  • ???t?a

3
G?aµµ???? ??µ??
  • ???a?a? (array)
  • ? ?????? p??sßas?? (access time) se ?p???d?p?te
    st???e?? t?? p??a?a e??a? sta?e???, a?e???t?ta
    ap? t? ??s? t??
  • S??dedeµ??? ??sta (Linked List)


Item 0
  • ?? p???a????sµ??? ????t???t?ta
  • ? ?????? p??sßas?? se ?p???d?p?te st???e?? t??
    p??a?a p??a??? ?a e?a?t?te ap? t? ??s? t??
  • ??? p??s??t??µe ?a? d?a???f??µe st???e?a st?? p??
    p??? d?µ??

4
St??ßa
  • ?as???? ?e?t?????e?
  • Push
  • Pop
  • ???p???s? µe p??a?a
  • A, top.
  • A, top.
  • ??e???? ??a ?a µ?? ?epe?ast??? ta ???a t??
    p??a?a.

5
St??ßa
  • ???p???s? µe s??dedeµ??? ??sta
  • top.
  • top.
  • ??e???? ??a µ? ???sµ????? (null) de??te?.

6
???? (FIFO Queue)
  • ?as???? ?e?t?????e?
  • enQueue
  • deQueue
  • ???p???s? µe p??a?a
  • Q, head, tail.
  • Q, head, tail
  • ?pa?a?t?t?? ??e????

7
???? (FIFO Queue)
  • ???p???s? µe s??dedeµ??? ??sta
  • head, tail.
  • enQueue(item)
  • head, tail.
  • deQueue()
  • ?pa?a?t?t?? ??e????

8
G??f?? (Graphs)
  • G(V, E)
  • V s????? ??µß?? (????f?? vertices/nodes)
  • E s????? t?? a?µ?? (t???? edges/arcs)
  • ?ate?????µe?e? ?a? µ? ?ate?????µe?e? a?µ??
    (directed and undirected edges)
  • ?a??de??µa
  • Va,b,c,d
  • E(a,b), (a,c), (b,c), (b,d)

9
G??f?? (Graphs)
  • Ge?t?????? ??µß?? (neighboring/adjacent) ??µß??
    s??dedeµ???? µe µ?a a?µ?
  • ????p?t? (path) µeta?? 2 ??µß?? ????????a ap?
    ?e?t??????? ??µß??? p?? ?e???? ap? t?? ??a ?a?
    ?ata???e? st?? ????.
  • ?p?? (simple) µ???p?t? ????p?t? st? ?p??? ????
    ?? ??µß?? eµfa?????ta? µ??? µ?a f??? µe p??a??
    e?a??es? t?? p??t? ?a? te?e?ta?? ??µß?.
  • ??????? d?ad??µ? (cycle) ?p?? µ???p?t? st? ?p???
    ? p??t?? ?a? te?e?ta??? ??µß?? e??a? ? ?d???

10
G??f?? (Graphs)
  • S??dedeµ???? (connected) ???f?? G??f?? st??
    ?p??? ?p???e? µ???p?t? µeta?? ?p????d?p?te d??
    ??µß??.
  • ??????? (acyclic) ???f?? G??f?? st??? ?p?????
    de? ?p?????? µ???p?t?a p?? ?a ep?st??f??? st??
    ??µß? ap? ?p?? ?e????sa?.
  • G??f?? µe ß??? (weighted graph) G??f?? st??
    ?p??? ???e a?µ? s?s?et??eta? µe ??p??? ß???? (?
    ??st??).
  • ??a??? (sparse) ???f?? ???f?? µe s?et??? ???e?
    a?µ??
  • ?????? (dense) ???f?? µ? a?a??? ???f??
  • ????st?? a???µ?? a?µ?? (de? ep?t??p??ta?
    self-loops)

?? ?ate?????µe???
?ate?????µe???
11
?pe?????s? G??f?? (Graph Representation)
  • ???a?a? Ge?t??as?? (Adjacency Matrix)
  • A ???a?a? VxV
  • Ai,j 0 ??? de? ?p???e? a?µ? µeta?? t?? ??µß??
    i ?a? j
  • ??? p???e?ta? ??a ???f? µe ß???
  • Ai,j wij ?p?? wij e??a? t? ß???? t?? a?µ??
    µeta?? t?? ??µß?? i ?a? j
  • ??s?? ? e????st?? ????? p?? ??e???eta? ? p??a?a?
    (de? ep?t??p??ta? self-loops)

?? ?ate?????µe???
?ate?????µe???
12
?pe?????s? G??f?? (Graph Representation)
  • ??sta Ge?t??as?? (Adjacency List)
  • ??a d????sµa (µ???d??stat?? p??a?a?) µe??????
    V.
  • ?p? t? st???e?? i t?? p??a?a ?e???? µ?a
    s??dedeµ??? ??sta
  • ??? p???e?ta? ??a ???f? µe ß???
  • Se ???e st???e?? t?? ??sta? ?p???e? ep?s?? ?a? t?
    ß???? t?? a?µ?? p?? s??d?e? t??? ??µß???
  • ????? p?? ??e???eta? st? µ??µ?

13
?a??de??µa
14
?a??de??µa µe ß???
15
???t?a (Trees)
  • S??dedeµ???? ??????? G??f??
  • Se ??a d??t?? ?s??e? p??ta
  • ?p???e? ??a ?a? µ??? µ???p?t? µeta?? d?? ??µß??
  • ????µ??a (rooted) d??t?a d??t?a sta ?p??a
    a??a??eta ep????eta? ??a? ??µß?? sa? ???a (root)

??e??e?? d??t??
????µ??? d??t??
16
???t?a
  • ?a?µ?? (degree) e??? ??µß?? a???µ?? t?? pa?d???
    t??.
  • ?a?µ?? t?? d??t??? µ???st?? ßa?µ?? ap? t???
    ??µß??? t?? d??t???.
  • ????? (depth) e??? ??µß?? e??a? ? ap?stas? t??
    ??µß?? ap? t? ???a
  • ???? t?? d??t??? e??a? ? ap?stas? t?? ???a? ap?
    t? p?? ap?µa???sµ??? f????.

17
?pe?????s? ???t???
  • ??sd??stat??? ???a?e? (?p?? ?? ???f??)
  • ??? p??? ap?d?t???? ??s? af?? ??a d??t?? e??a?
    ??a? a?a??? ???f??!
  • ????d??stat?? ???a?a?
  • ?a pa?d?? ???e ??µß?? eµfa?????ta? se
    s???e???µ??e? ??se?? t?? p??a?a
  • G?a ap?d?t???te?? d?a?e???s? t?? ded?µ????, st??
    p??a?a eµfa?????ta? de??te? p??? ta ded?µ??a ?a?
    ??? ta ded?µ??a ta ?d?a.
  • ?a??de??µa d?ad???? d??t???
  • ? ????a? t?? ??µß?? j ß??s?eta? st? ??s?

18
?pe?????s? ???t???
  • ?? ??aµµ???? ??ste?
  • ???e ??µß?? µp??e? ?a ??e? ??a ? pe??ss?te?a
    pa?d??
  • ?a??de??µa d?ad???? d??t???
  • ? a??????? s??s? ?s??e? ??a d?ad??? d??t?a µe n
    ??µß??? t??? ?p????? t? ???? e??a? h

19
?a????µ?µ??a ???t?a
  • ??ad??? ta????µ?µ??a d??t?a
  • ?? ??e?d? t?? a??ste??? pa?d??? e??a? µ????te??
    ap? a?t? t?? ??????
Write a Comment
User Comments (0)
About PowerShow.com