Giter VIP home page Giter VIP logo

treeexercise's Introduction

TreeExercise

How to use this program.

  1. Compile it first (using Visual Studio 2017).
  2. Once you run exe, the program will request user input to define the depth of tree in which you want it to generate.
  3. Enter an integer then program will generate tree structure then save it as result.txt at the relative location.

High Level Program Structure.

There are three main steps in the program.

  1. Generate the tree sequence
  2. Generate position(position in which these elements need to be printed onto the result.txt file) of each element in the tree.
  3. Create/save the result as a result.txt file.

#include is used for general purpose of using the console application. #include is used for creating and saving the text file. #include is used for handling the tree data #include is used for handling the data of positions of the tree in which the tree's elements need to be printed onto the tree.

Interesting optimization.

Program doesn't create "a node". It prints the result as "tree format". Instead of generating the tree pattern based on the "nodes" it creates a list of integer for each generation. As the result, first and second generation of the tree are given as a seed for this program to work. First generation of the tree is {1} Second generation of the tree is {1,1} From there, third and so on generations are created by the program by looking at the patterns in which the numbers are generated based on the previous generation. However the user demands the format to be displayed as the "tree", so it prints out the result into a tree format.

treeexercise's People

Contributors

kyung01 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.