Skip to content

Code for Graph Theory homeworks. Not for commercial use.

Notifications You must be signed in to change notification settings

pedro-volpi/graphs_ufrj

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About

This is a project for Graph Theory class @ UFRJ. No code here is intended to be used in a commercial way, be careful.

This is not a microlibrary, so I'll implement a lot of basic data structure, it is not just graph libraries that depends on data structure libraries.

Basic data structures

List

It is a simple linked list with reference to first element.

Creating a new list O(1):

List * list = list_new();

Checking list emptiness O(1):

list_is_empty(list); // => 1

Prepending elements to the list O(1):

void * data; //Inilialize it at somepoint
list_prepend(list, data);
liss_is_empty(list); // => 0

Get the first element of the list (the head) O(1):

list_first(list) // => data

Get the the nth element O(n):

list_prepend(list, another_data);
list_prepend(list, first_data);
list_get(list,1); // => another_data

About

Code for Graph Theory homeworks. Not for commercial use.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published