Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mharikmert/text-representation-with-bst
A simple word sorting algorithm with different Binary Search Trees and time complexities in C programming language
https://github.com/mharikmert/text-representation-with-bst
algorithm binary-search-tree c time-complexity time-complexity-analysis
Last synced: 4 days ago
JSON representation
A simple word sorting algorithm with different Binary Search Trees and time complexities in C programming language
- Host: GitHub
- URL: https://github.com/mharikmert/text-representation-with-bst
- Owner: mharikmert
- Created: 2021-03-15T14:27:06.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2021-03-15T17:03:49.000Z (almost 4 years ago)
- Last Synced: 2024-12-03T03:35:09.110Z (2 months ago)
- Topics: algorithm, binary-search-tree, c, time-complexity, time-complexity-analysis
- Language: C
- Homepage:
- Size: 12.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Text Representation with Binary Search Trees
## How it works?
It reads __number__, __word__, __frequency__ structured input files in files folder.
Firstly words are compared and be sorted in alphabetical order in a binary search tree.
Then frequencies are compared and words exchanes in the binary search tree according to their frequencies.
After the binary tree is created, total access time of the BST is also calculated.
Idea behind creating two BTS is to see the change of the total access time between two different BTS## Sample Inputs
| Number| Word | Frequency |
| ----- |:-------------:| ----------:|
| 1 | people |6|
|2| country|10|
| 3 | city |15|
| 4 | news |2|
| 5 | population |1|
| 6 | society |28|
| 7 | university |35|
| 8 | sports |62|
|9|basketball|28
## Outputs
#### First Binary Search Tree
![Screenshot from 2021-03-15 19-42-22](https://user-images.githubusercontent.com/42295478/111189086-c92b2980-85c6-11eb-8b32-7722fa42d945.png)#### Second Binary Search Tree
![Screenshot from 2021-03-15 19-42-34](https://user-images.githubusercontent.com/42295478/111189123-d2b49180-85c6-11eb-8f65-319ef4654fc8.png)## Clone, Compile and Run
```
-> git clone https://github.com/mharikmert/Text-Representation-with-BTS
-> gcc -o main main.c -lm
-> ./main
```