cs112 data structure recitation
play

[CS112] Data Structure Recitation (Section 4, 15) Changkyu Song - PowerPoint PPT Presentation

[CS112] Data Structure Recitation (Section 4, 15) Changkyu Song cs1080@cs.rutgers.edu Office Hours: Tue 10:30~12:30 p.m. @ Hill 206 [CS112] Recitation #1 Weighted Adjacency Link List 1 W:0.2 W:0.7 2 3 3 1 2 2 3 T T 1 T T 1


  1. [CS112] Data Structure Recitation (Section 4, 15) Changkyu Song cs1080@cs.rutgers.edu Office Hours: Tue 10:30~12:30 p.m. @ Hill 206

  2. [CS112] Recitation #1 Weighted Adjacency Link List 1 W:0.2 W:0.7 2 3 3 1 2 2 3 T T 1 T T 1 null F w:0.2 w:0.7 w:0.2 w:0.7 T 1 2 2 T null F F w:0.2 w:0.2 3 1 T 3 T null F F w:0.7 w:0.7 Section 4, 15

  3. [CS112] Recitation #1 Weighted Adjacency Link List 1 W:0.2 W:0.7 2 3 class Edge { Node* neighbor; float weight; Edge* next; } 2 3 T T 1 null T 2 w:0.2 w:0.7 w:0.2 1 2 T null w:0.2 3 T 1 null w:0.7 Section 4, 15

  4. [CS112] Recitation #1 Weighted Adjacency Link List 1 W:0.2 W:0.7 n: # of nodes 2 3 e: # of edges n + 3 x 2e class Edge { Node* neighbor; 1 float weight; 2 Edge* next; 3 } 1 2 3 T T 1 null T 2 3 w:0.2 w:0.7 2 w:0.2 1 2 T null w:0.2 3 1 T null w:0.7 Section 4, 15

  5. [CS112] Recitation #1 Weighted Adjacency Link List 1 W:0.2 W:0.7 n: # of nodes 2 3 e: # of edges n 2 n + 3 x 2e 3 1 2 2 3 T T 1 T T 1 null F w:0.2 w:0.7 w:0.2 w:0.7 T 1 2 2 T null F F w:0.2 w:0.2 3 T 1 3 T null F F w:0.7 w:0.7 Section 4, 15

  6. [CS112] Recitation #1 Weighted Adjacency Link List 1 W:0.2 W:0.7 n: # of nodes 2 3 e: # of edges n 2 n 2 < n + 3 x 2e n + 3 x 2e 3 1 2 2 3 T T 1 T T 1 null F w:0.2 w:0.7 w:0.2 w:0.7 T 1 2 2 T null F F w:0.2 w:0.2 3 T 1 3 T null F F w:0.7 w:0.7 Section 4, 15

  7. [CS112] Recitation #1 Weighted Adjacency Link List 1 W:0.2 W:0.7 n: # of nodes 2 3 e: # of edges n 2 n 2 < n + 3 x 2e n + 3 x 2e (n 2 - n)/(3x2) < e min{e} = (n 2 - n)/(3x2) + 1 Section 4, 15

  8. [CS112] Recitation #2 Complement Graph 1 G = 2 3 3 1 2 2 3 T T 1 1 null T T F 1 2 2 T null T F F 3 T 1 3 null F T F Section 4, 15

  9. [CS112] Recitation #2 Complement Graph 1 G c = 2 3 3 1 2 1 1 1 T null F F T 2 3 T T 2 2 null F T T 2 3 3 T T 3 null T F T Section 4, 15

  10. [CS112] Recitation #2 Complement Graph T T 2 3 1 null 1 T 2 null T 1 3 null 3 1 2 1 T T F 2 T F F 3 F T F Section 4, 15

  11. [CS112] Recitation #2 Complement Graph 1 2 3 1 T T F 2 T F F 3 T F F 3 1 2 1 T F F 2 F T T 3 T F T Section 4, 15

  12. [CS112] Recitation #2 Complement Graph 3 1 2 1 F F T 2 F T T 3 F T T T 1 1 null T T 2 3 2 null T T 2 3 3 null Section 4, 15

  13. [CS112] Recitation #3 DFS vs. BFS S … 1 2 3 n T Section 4, 15

  14. [CS112] Recitation 1 st – #3 DFS vs. BFS 2 nd – DFS 3 rd – S 4 th – … … 1 2 3 n n+1 th – T Section 4, 15

  15. [CS112] Recitation 1 st – #3 DFS vs. BFS 2 nd – DFS 3 rd – S 4 th – … … 1 2 3 n n+1 th – T Section 4, 15

  16. [CS112] Recitation 1 st – #3 DFS vs. BFS 2 nd – DFS 3 rd – S 4 th – … … 1 2 3 n n+1 th – T Section 4, 15

  17. [CS112] Recitation 1 st – #3 DFS vs. BFS 2 nd – DFS 3 rd – S 4 th – … … 1 2 3 n n+1 th – T Section 4, 15

  18. [CS112] Recitation 1 st – #3 DFS vs. BFS 2 nd – DFS 3 rd – S 4 th – … … 1 2 3 n n+1 th – T Section 4, 15

  19. [CS112] Recitation 1 st – #3 DFS vs. BFS 2 nd – DFS 3 rd – S 4 th – … … 1 2 3 n n+1 th – T S S S … … … … 1 2 3 n 1 2 3 n 1 2 3 n T T T S S S … … 1 2 3 … n 1 2 3 … n 1 2 3 n T T T … … Section 4, 15

  20. [CS112] Recitation 1 st – #3 DFS vs. BFS 2 nd – DFS 3 rd – S 4 th – … … 1 2 3 n n+1 th – T 2 nd search is dependent to the 1 st choice. Permutation of (n) = n x (n-1) x (n-2) x (n-3) … x 1 = n! Section 4, 15

  21. [CS112] Recitation #3 DFS vs. BFS BFS S … 1 2 3 n T Section 4, 15

  22. [CS112] Recitation 1 st – #3 DFS vs. BFS 2 nd – BFS 3 rd – S … n th – … 1 2 3 n n+1 th – T Section 4, 15

  23. [CS112] Recitation 1 st – #3 DFS vs. BFS 2 nd – BFS 3 rd – S … n th – … 1 2 3 n n+1 th – T Section 4, 15

  24. [CS112] Recitation 1 st – #3 DFS vs. BFS 2 nd – BFS 3 rd – S … n th – … 1 2 3 n n+1 th – T Section 4, 15

  25. [CS112] Recitation 1 st – #3 DFS vs. BFS 2 nd – BFS 3 rd – S … n th – … 1 2 3 n n+1 th – T Section 4, 15

  26. [CS112] Recitation 1 st – #3 DFS vs. BFS 2 nd – BFS 3 rd – S … n th – … 1 2 3 n n+1 th – T Section 4, 15

  27. [CS112] Recitation 1 st – #3 DFS vs. BFS 2 nd – BFS 3 rd – S … n th – … 1 2 3 n n+1 th – T S S S … … … … 1 2 3 n 1 2 3 n 1 2 3 n T T T S S S … … 1 2 3 … n 1 2 3 … n 1 2 3 n T T T … … Section 4, 15

  28. [CS112] Recitation 1 st – #3 DFS vs. BFS 2 nd – BFS 3 rd – S … n th – … 1 2 3 n n+1 th – T n+1 nd search is dependent to the 1 st choice. Permutation of (n) = n x (n-1) x (n-2) x (n-3) … x 1 = n! Section 4, 15

  29. [CS112] Recitation #4 hasPath Section 4, 15

  30. [CS112] Recitation #5 Section 4, 15

  31. [CS112] Recitation #5 Section 4, 15

  32. [CS112] Recitation #5 Section 4, 15

  33. [CS112] Recitation Q & A Section 4, 15

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend