1694 - I2P(II)2019_Lee_HW8 Scoreboard

Time

2019/05/19 00:00:00 2019/06/19 00:00:00

Clarification

# Problem Asker Description Reply Replier Reply Time For all team

# Problem Pass Rate (passed user / total user)
12279 Binary Search Tree With Iterator (Preorder)

12279 - Binary Search Tree With Iterator (Preorder)   

Description

* 5/19 update main function.

Try to visit binary search tree in preorder ~

This is simple problem, but you should implement iterator to accept this problem.

Here is a template, you should implement all member functions in class iterator.

 

#include "function.h"

struct Content
{
    // something 
};

Iterator::Iterator(Node *root)
{
    // data = new Content;
}

Iterator::Iterator(const Iterator &other)
{
    
}

Iterator::~Iterator()
{

}

int Iterator::operator*() const
{

}

bool Iterator::operator!=(const Iterator &it) const
{

}

void Iterator::operator++(int)
{

}

Input

First line has 2 number N, Q

N it list length, Q is garbage value

Next  line has N intergers, all values will insert to binary search tree in input order.

 

* 2 <= N <= 2000

Output

Output all node values in preorder

Some garbage value will be added in the result to prevent some hack skill :)

Sample Input  Download

Sample Output  Download

Partial Judge Code

12279.cpp

Partial Judge Header

12279.h

Tags




Discuss