Git Product home page Git Product logo

cities2's Introduction

Cities2------ prefix filtering using concurrency HAmeR framework( handler+Message+Runnable)

cities 2

androide https://github.com/anggelo17/Cities2

In order to perform prefix filtering I have implemented a Trie Structure where each node represents a letter from a to z. Moreover each node has a flag endOfWord to tell the if the current node is the end of a word or not. Since we can found cities with the same name even in the same country; we can differentiate them having a list of id for the same name of city. For example city Athens,US and city Athens,Greece ; every time we insert the word Athens we will insert their id also because they are different cities. An arrayMap was also used because once we have the results(list of ids), we can get the whole information wit the id. This map has an id as key and a object Data as value. Another reason to use arrayMap is that is more memory efficient than a traditional HashMap.

For retrieving the cities given a prefix we have to traverse the trie in alphabetic order; looking from a to z; in that order . In this way we can get the cities ordered in alphabetic order. We will get a list of id as a result . this List will be used for getting the whole Data object info like name,country and coordinates.

Complexity for retrieving the cities given a prefix is O(P) + O(N); where P is the length of the prefix and N is the total number of nodes in the trie.

FUTURE WORK

Future work will be implementing diffutils, so we don't have to update the whole items in the list view every time there is a change.

cities2's People

Contributors

anggelo17 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.