Skip to content

Conversation

@adikul30
Copy link

No description provided.

@adikul30 adikul30 changed the title Add : fibonacci.py, dfs.py and bfs.py Add : fibonacci.py, search.py [DFS and BFS] Aug 27, 2018
def test():
fibonacci(5)

test() No newline at end of file
Copy link
Owner

Choose a reason for hiding this comment

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

Thank you so much for your merge request. There are a couple of comments:

  • performance: this isn't a very efficient way to calculate the fibonacci since we'll have to calculate each element multiple times. You might want to use memoization. See more here: https://stackoverflow.com/a/18172463
  • style: please use spaces instead of tabs, since tabs get converted weirdly on GitHub.

visited = []
bfs(1)

test() No newline at end of file
Copy link
Owner

Choose a reason for hiding this comment

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

Please follow PEP8 style guide!

q = queue.Queue(MAX)

def dfs(s):
if s in visited :
Copy link
Owner

Choose a reason for hiding this comment

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

no space after 'visited'

@adikul30 adikul30 closed this Jul 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants