İ need a function for a search machine, that this function should find the most-looking like string values to the users input, example: if user writes "Math" this function must find the "mathematics" keyword and match it to the pertinent links and list them, then another function should list them on screen :d
are you assuming that they will provide input starting at the beginning of the string? Or could they enter "ematics" and expect to get "mathematics"? With out thinking about the problem much, it could be solved using trees. It is an interesting problem but if you are not extremely familiar with linear data-structures (arrays, stacks, queues) and recursion. You might want to start there and build up to recursively based non-linear data-structures. That said, using a tree is how I would solve the problem.
Word completions can be done with a Markov sequence. Finding words that can be extended from a partial like math could be done with a lexicon ( dictionary without definitions ) based on a set.
If you know the concepts of KARNAK - used in AJAX.. will help you to solve your problem..It is only possible if you are using code in some Web based Technologies like(JSP.STRUCTS,SERVLETS/PHP/C#) it is not possible to use with C,C++ since they are not web based. Better try using the Concepts of Binary trees where it uses the parsing of string w.r.t the give input string.. All the best
there are lot of string matching functions in algorithms like knuth-matt-pratt (KMP algorithm)...u can go thru book called algorithms by cormen...which gives u lot of info
Join our real-time social learning platform and learn together with your friends!