Rust challenge 45/100 - a new day a new challenge
Table of content
What is this
The rules of the game are explained in my original post.
45th Challenge
Challenge
Recently I discovered code wars. Since then I have done a lot of challenges on that platform. It was ok for me for the moment. I don’t feel like I have broken the rules of this challenge, but I’m keeping at it doing what ever I’m motivated to do. I’m starting to reach my limitations and I see I have a gap in algorithms and how they work.
I feel like my solutions are limited by the fact that I do not know how to use fundamental algorithms. I have two new challenges, a series of algorithms is the first.
So where to start? I started my search by looking for some good cheat sheets on algorithms here is what I found: a good Overview of various algorithms
Graph theroy has inspired be most. I want to learn it, so from my overview I go on a further search and find (an online presentation of the basics)[https://web.stanford.edu/class/cs97si/06-basic-graph-algorithms.pdf]
GRAPH consists of nodes and one or bidirectional vertices
What do we need as storage?
nodes can be stored in arrays
edges can be stored in either adjacency matrix or adjacency list. Matrix lists each connection and a 1 if it exists and a 0 if it does not. Matix uses lots of memory O(n^2). Adjacency List uses less space. Each node has a list of nodes it points to.
Today’s challenge: Prepare a storage for a graph using an adjacency list that consists of arrays and an array of Nodes.