breadth-first traversal

Discussion in 'C++' started by xandra, Nov 7, 2006.

  1. xandra

    xandra Guest

    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.
    xandra, Nov 7, 2006
    #1
    1. Advertising

  2. xandra

    red floyd Guest

    xandra wrote:
    > 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.
    red floyd, Nov 7, 2006
    #2
    1. Advertising

  3. xandra wrote:
    > 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
    --
    Please remove capital 'A's when replying by e-mail
    I do not respond to top-posted replies, please don't ask
    Victor Bazarov, Nov 7, 2006
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Wynan James
    Replies:
    1
    Views:
    1,577
    Miguel De Anda
    Oct 6, 2003
  2. Big Jim

    Fous Traversal Policy

    Big Jim, Jan 27, 2006, in forum: Java
    Replies:
    0
    Views:
    397
    Big Jim
    Jan 27, 2006
  3. Replies:
    0
    Views:
    406
  4. News

    breadth first search

    News, Feb 8, 2006, in forum: Python
    Replies:
    9
    Views:
    6,784
    Charles Krug
    Feb 8, 2006
  5. Christian Rühl
    Replies:
    22
    Views:
    1,714
    Christian Rühl
    Dec 13, 2007
Loading...

Share This Page