Giter Club home page Giter Club logo

binary-search-trees's Introduction

This project helped me to understand data structers subject and how can we use the binary search trees with stack operations. We can explain the project this repo contains as something like this.

As the program runs, the Sayilar.txt file, which consists of numbers between 0 and 256 separated by spaces, will be read. Numbers will be added to the Stack as each line is read. If the newly read number from the file is even and greater than the number about to be popped from the currently processed Stack, it will be added to a new Stack. Otherwise, it will continue to be added to the existing Stack. In this way, after each line in the file is read, each Stack will be emptied and added to a separate binary search tree. If the same value exists in the tree, that value will not be added to the binary search tree. The number of binary search trees created should be equal to the number of Stacks found on a line. For each line, the binary search tree with the highest height will be selected. If the heights are equal, the tree with the larger sum of node values will be selected. Of the trees with equal total values, the first tree created will be selected. The selected binary search tree with the maximum height will be read in postorder and the ASCII character equivalents of the numerical values will be written to the screen. The program will then sleep for 10 milliseconds (using the sleep function) and the same operations will be applied for the next line and the characters will be written to the screen again. The program will terminate when the file reading is finished.

binary-search-trees's People

Contributors

itsmsefa avatar

Watchers

 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.