Create tree data structures with breadth first search and depth first search algorithms

This project received 4 bids from talented freelancers with an average bid price of $20 USD.

Get free quotes for a project like this
Project Budget
$10 - $30 USD
Total Bids
Project Description

Write a function that will output breadth first search and depth first search order for a tree data structure. The tree shall only contain integers for it’s node. I expect the following:

(1) A PHP class that represents a tree data structure.

(2) A PHP function (BFS) that takes a tree as input and output the ordering of a breadth first search on the command line.

(3) A PHP function (DFS) that will output a depth first search on the same tree

(4) I should be able to run the class on the command line


- Ensure that your function can handle cycles

- Ensure that the nodes can only be integer

When you apply to this job, answer the following questions. IF YOU DO NOT ANSWER THESE QUESTIONS, YOU WILL NOT BE CONSIDERED.

(1) What is the complexity (O runtime) of BFS and DFS?

(2) What is the difference between a stack and queue data structure?

(3) How many hours will it take to do this job?

Skills Required

Looking to make some money?

  • Set your budget and the timeframe
  • Outline your proposal
  • Get paid for your work

Hire Freelancers who also bid on this project

    • Forbes
    • The New York Times
    • Time
    • Wall Street Journal
    • Times Online