eldek-tad 0.9.1

A project for learning Abstract Data Types (ADTs) in Rust. Heavily inspired by Java's implementation.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use std::{hash::Hash};
use crate::linked_list::linked_list::LinkedList;

pub trait GraphTrait<T:Hash+Eq+Clone> {
    fn new()->Self;
    fn add_vertex(&mut self, vertex:T);
    fn add_edge(&mut self, source:T, destination:T, bidireccional:bool, weight:Option<i32>);
    fn has_vertex(&self, vertex:&T)->bool;
    fn has_edge(&self, vertex1:&T, vertex2:&T)->bool;
    fn get_neighbors(&self, vertex:&T)->LinkedList<T>;
    fn vertex_count(&self)->usize;
    fn edge_count(&self)->usize;
    fn is_empty(&self)->bool;
}