Skip to content

Added Depth First Search in Every Language Article #329

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Oct 5, 2020
Merged

Added Depth First Search in Every Language Article #329

merged 6 commits into from
Oct 5, 2020

Conversation

mowies
Copy link
Contributor

@mowies mowies commented Oct 2, 2020

SOLUTION DESCRIPTION

This PR adds the article about depth first search in every language.

This PR resolves #327

@mowies mowies marked this pull request as ready for review October 4, 2020 15:10
@jrg94 jrg94 changed the title Feat: Article for depth first search Added Depth First Search in Every Language Article Oct 5, 2020
Copy link
Member

@jrg94 jrg94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great! How would a program go about parsing the input? In the past, we used serialized adjacency matrices for graphs, and I was wondering if we could do something similar.

@jrg94 jrg94 self-assigned this Oct 5, 2020
@jrg94 jrg94 added enhancement New feature or request project Project documentation and removed enhancement New feature or request labels Oct 5, 2020
@mowies
Copy link
Contributor Author

mowies commented Oct 5, 2020

This is great! How would a program go about parsing the input? In the past, we used serialized adjacency matrices for graphs, and I was wondering if we could do something similar.

Yes, I thought about that and didn't really come to a nice solution except for the one I pushed...

Do you mean like in the minimum spanning tree project [1] or the dijkstra project [2] for example?

[1] https://github.com/TheRenegadeCoder/sample-programs-website/blob/master/projects/minimum-spanning-tree/index.md#requirements
[2] https://github.com/TheRenegadeCoder/sample-programs-website/blob/master/projects/dijkstra/index.md#requirements

@mowies
Copy link
Contributor Author

mowies commented Oct 5, 2020

One problem I see in the adjacency matrix is that there is no clear way of adding data to the vertices. In order for a search program to be run on the graph/tree we need some vertex values to look for of course. So this would need to be added to the adjacency matrix in some form.

@mowies
Copy link
Contributor Author

mowies commented Oct 5, 2020

One way to adress this problem would be to have an additional input to programs that is the list of vertex values in the same order as they appear in the matrix.

@mowies
Copy link
Contributor Author

mowies commented Oct 5, 2020

@jrg94 I updated the article with requirements including an adjacency matrix now, please have a look :)

@mowies mowies requested a review from jrg94 October 5, 2020 17:37
Copy link
Member

@jrg94 jrg94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm trying to think if there is a cleaner way to represent the input, but this is probably as good as it's going to get from a parsing perspective (e.g. I'm thinking of lower level languages that might have to do a lot of work to process the input). If you're happy with this, I'll go ahead and merge it!

@jrg94
Copy link
Member

jrg94 commented Oct 5, 2020

Overall, I agree the adjacency matrix solution isn't great because it doesn't scale well. That said, the biggest issue is parsing, and I'm not sure there's a nice format beyond JSON or something like that.

Also, we want to avoid the requirement of nodes and whatnot for trees. Since most languages support a list-like structure, this is usually the safest bet.

@mowies
Copy link
Contributor Author

mowies commented Oct 5, 2020

I think I am happy with it so feel free to merge :)

@jrg94 jrg94 merged commit 51d4114 into TheRenegadeCoder:master Oct 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
project Project documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Depth First Search in Every Language Article
2 participants