Giter Club home page Giter Club logo

triejava's Introduction

TrieJava

A trie class has been created as a priority. A key-value relationship was established by creating a HashMap array in it. The key value from this generated array structure was injected into the class's constructor. An insert method has been created. The first character of the value was taken by checking whether the word was entered with the if-else structure. If the child is null, it creates a new node and add the child to the children map. If the word is more than one character long, recursively it calls insert. Otherwise, it sets the isWord to true. If the root has no children, values return, for each child of the root. It also checks whether the prefix to be searched for exists by creating a find() method. Together with the suggestHelper() method, if the root is a word,it adds the word to the list. The values of root's children recursively call suggestHelper. An ArrayList object is created in suggest() methods. The root directory is assigned to the TrieNode class as a value. All values in toCharArray() are enclosed in children within the parameter in the TrieNode class. the resulting values of these parameters are returned to the list suggestHelper() method and the method is executed. A list is created in the main method and the names in the homework are written. The user is asked to enter a name to be added to the list. The resulting list is initially injected into it by deriving a new object from the Trie class we created. In addition, this list is used, which is injected to search for the desired word in the while cycle. The first method used during the search is the suggest() method, and the word to searched is applied to this method.

triejava's People

Contributors

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