breadth-first traversal

X

xandra

i have 2 question in breadth-first traversal.your help will be
appreciated.
1. what is the purpose of the queue in breath-first traversal?
2 suppose you had a function call displayAtDepthN which when given a tree
and depth would display only the nodes at that depth. explain how this
could be used to give a breadth-first traversal of the tree,and why it
would not be as efficient as one using a queue.
 
R

red floyd

xandra said:
i have 2 question in breadth-first traversal.your help will be
appreciated.
1. what is the purpose of the queue in breath-first traversal?
2 suppose you had a function call displayAtDepthN which when given a tree
and depth would display only the nodes at that depth. explain how this
could be used to give a breadth-first traversal of the tree,and why it
would not be as efficient as one using a queue.
Tell you what, xandra, send us your instructor's email address, and
we'll just send the answers directly to him.
 
V

Victor Bazarov

xandra said:
i have 2 question in breadth-first traversal.your help will be
appreciated.
1. what is the purpose of the queue in breath-first traversal?
2 suppose you had a function call displayAtDepthN which when given a
tree and depth would display only the nodes at that depth. explain
how this could be used to give a breadth-first traversal of the
tree,and why it would not be as efficient as one using a queue.

I think you need to ask about it in 'comp.programming'. We here
discuss C++ _language_ and you don't seem to have any language query.

Also, read FAQ 5.2, while you're at it.

V
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,007
Messages
2,570,266
Members
46,864
Latest member
DaniEbswor

Latest Threads

Top