Giter VIP home page Giter VIP logo

autocomplete's Introduction

Binary Search Tree implementation of the 'Autocomplete as you type' feature found on popular search engines. 

Program demonstrates the following Binary Search Tree (BST) concepts / operations:
-inserting into a BST
-recursive and higher level traversals of BSTs to find nodes
-calculating depth and height of BSTs

There are 3 source files. Compile and run using:
gcc main.c bst.c -o Autocomplete -Wall
./Autocomplete

1. when the program starts, enter the name of the file you want to use:
cities.txt
cities2.txt
cities-by-population.txt
fortune-1000.txt
fortune-1000-by-revenue.txt

the program will use the text file to generate a Binary Search Tree.

******
EXAMPLE
******
if the user enteres:
suggest 5 Chi
this means they want to be show the top 5 weighted queries that start with the prefix Chi:

**Sample Run**

** Starting Autocomplete **
Please enter a file name: 
 cities.txt 
 cities-by-population.txt 
 fortune1000.txt 
 fortune1000-by-revenue.txt 
cities.txt
** Ready **
add 4000000 ChinaTown
**Added
suggest 5 Chi
** [Sub-tree root:  (Chittagong, Bangladesh,3920222)]
** [Sub-tree count: 69]
** [Num matches:    49]
ChinaTown - 4000000
Chittagong, Bangladesh - 3920222
Chicago, Illinois, United States - 2695598
Chiba-shi, Japan - 919729
Chihuahua, Chihuahua, Mexico - 708267

autocomplete's People

Contributors

seanwalker909 avatar josean555 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.