数据结构–图的存储 十字链表、邻接多重表

十字链表存储有向图




空间复杂度:O(|V|+|E|)
如何找到指定顶点的所有出边?——顺着绿色线路找
如何找到指定顶点的所有入边?——顺着橙色线路找
注意:十字链表只用于存储有向图
\color{red}注意:十字链表只用于存储有向图
注意:十字链表只用于存储有向图
邻接多重表存储无向图




每条边只对应一份数据 \color{red}每条边只对应一份数据 每条边只对应一份数据
空间复杂度:O(|V|+|E|)
删除边、删除节点等操作很方便
注意:邻接多重表只适用于存储无向图 \color{red}注意:邻接多重表只适用于存储无向图 注意:邻接多重表只适用于存储无向图
知识回顾与重要考点


