Skip to content

JWseop/DataStructure_HW3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

DataStructure_HW3

Homework of lecture, Data Structure

Problem

2

3 dfs(3)

786 368 603

5 bfs(4)

825 162 768 724 635

The number in the first line (i.e., 2) shows the number of test cases to be processed. From the second line, test cases are given, and the information for each case is provided over two lines. In the first line (line number 2 in the example above), the first number (i.e., 3) indicates the number of integers in that case, and the next string (i.e., dfs(3)) shows the location of the target number that you need to look for. In this example, the target number is on the third node of DFS.

Algorithm

  1. scan input data
  2. build elements in BST form
  3. scan if the first three string input is bfs or dfs
  4. choose appropriate searching function to be called
  5. scan how many times to search in string
  6. search
  7. pass the result to output file

About

Homework of lecture, Data Structure

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages