kromitj / graph_data_struct

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build an Abstract Data Structure

  • Ruby provides Arrays and Hashes
  • Other types of data structures include
    • Graph
      • A set of Objects where some points of the objects are connected
      • Vertices: The point where objects connect
      • Edges: The links that connect vertices
      • Adjacency: Two nodes connected by a edge
      • Path: Folling a connected nodes from one to the other
      • A graph is basically a group of sets of (V, E)”s
      • Directed Graph: Edges have direction
      • Undirected Graph: Edges don’t have direction
      • Complete Graph: all Vertices are connected to each other

 V = {a,b,c,d,e} E = { ab, ac, bd, cd, de}

Basic Operations:

Add Vertex: add a vertex to the graph Add Edge: Add an edge between two vertices of a graph Display Vertex: Display a vertex of a graph

* Map
* Set
* String
* Tree

About


Languages

Language:Ruby 100.0%