CSE 274 Lecture Notes - Lecture 15: Adjacency List, Adjacency Matrix, Insertion Sort

55 views2 pages

Document Summary

Array: typically a two-dimensional array called an adjacency matrix. List: referred to as an adjacency list. In this example, the matrix has the node on the left and puts a true to the things that is connected to on the right. In this example, we see a node for each vertice that has a list of adjacent nodes that are the connected vertices. Items can be added anywhere is list. Advantages of linked implementation: uses memory only as needed, when an entry is removed, unneeded memory is returned to the system, and it avoids moving data when adding or removing entries. Collection of pairs (k, v) of objects k and v. Choses one entry in array called the pivot. Pre-order traversal: visit root before we visit the root"s subtrees. In-order traversal: visit root of binary tree between visiting nodes in root"s subtrees. Post-order traversal: visit root of binary tree after visiting nodes in root"s subtrees.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents