This tag is for questions about search algorithms, tools, and technologies.

learn more… | top users | synonyms

3
votes
1answer
44 views

jQuery Search Suggestion Generator

I'm currently using a PHP shopping cart, and finally decided to implement a search suggestion feature. There are some already available solutions out there, but I wanted to gain control over how mine ...
2
votes
2answers
117 views

Class name search algorithm

Here is a test task from a company, where I'd like to work eventually. I solved all they wanted to me to do, however failed to get an interview. I do not know what is wrong with my solution, because ...
1
vote
2answers
148 views

Binary search function in C#

I was wondering if I can make this better: ...
6
votes
2answers
60 views

Search for longest substring in alphabetical order in a given string

I would like some help with a review of a program that I wrote to identify the longest continuous sub-string that is in alphabetical order within a string. This is a JavaScript adaptation of an ...
0
votes
0answers
28 views
0
votes
0answers
52 views

Merging results of product searches by category, price, and manufacturer

Following is code which takes three arguments as String Map String now I already have some predefined methods which return the requirement of both String as ...
2
votes
1answer
75 views

File search program not efficient enough

I have created a program to search for a file in the computer. But I feel it can be improved. Can anyone help me with this? filesearch.py ...
2
votes
1answer
54 views

Filesystem search class in C#

Anyone can tell how to make this code faster? This search takes too much time... 700 000 files for 15 minutes... I will be grateful for each micro optimization! Search Class: ...
6
votes
2answers
66 views

Binary search a 2D array for multiple matching criteria fields

Here is what I came up with for a binary search of an array. It allows for searching one or many columns to match. It assumes that array being searched is sorted with the same sort priorities as the ...
1
vote
2answers
54 views

Searching local drive for multiple files

Well, I'm writing a piece of code that will take a list of file names and should search a local drive for each file, determine if it's there or not, and return an array of all the paths found. Right ...
4
votes
0answers
40 views

Unstructured quantum search algorithm for unknown solutions

This code was tested on IBM's 5-Qubit processor as an implementation of Grover's search algorithm, but for an unknown number of solutions. This code is based on Arthur Pittenger's book, "An ...
10
votes
3answers
488 views

Read file with over 300k words and filter through appropriate filter to return list of matching words

As a puzzle we were asked to bring out the possibilities in breaking a 4 letter wordlock combination. It was to be a four letter word from the English dictionary. There were 10 possible characters in ...
3
votes
2answers
59 views

Product search script Object Oriented PHP

I have made a search script in OO PHP that searches for products based on the inserted criteria, selects them and checks whether a sale is on, if it's in stock and other features. I am new to OOP so ...
5
votes
1answer
63 views

Determining whether a date is within a range

I am taking a user input which consists of a from date and a to date. Those dates are compared against 4 cells in a row - a post date, pause date, resume date, and a close date. My goal with this code ...
2
votes
0answers
71 views

Query for searching for the best transportation

I made a website where is possible to search for the best transportation from a place to another. For instance, if I need to go from Berlin to Bremen, the website will search in its internal database ...
4
votes
1answer
70 views

Prints Books from a HashMap that are complete or incomplete

This code is meant to display book titles that are incomplete. I have a HashMap with the book title and a number that represents the amount of the book that has ...
1
vote
2answers
91 views

Excerpt from a brute force Rubik's Cube algorithm

I have a program that brute force searches for a combination of inputted array elements by the user and when the program is searching all the for loops are nested for the brute search then I have this ...
1
vote
2answers
68 views

Python Search file for string and read into list

This function of my program is searching a file that is formatted as first_name last_name rate hours: John Smith 25 80 Mary Johnson 15.5 60.0 ... With one space ...
6
votes
1answer
64 views

Checking if a line in a file contains user.Handle and '-r'+any single digit number

The title pretty much explains everything. I'm try to check if a line in a file contains user.Handle and '-r'+any single digit ...
3
votes
1answer
72 views

Filtering a list for certain strings

I want to create a function that filters a list with the following criteria: Strings containing numbers should be removed Strings containing only one word and first letter of the word is not ...
5
votes
2answers
48 views

Search files from large directory and sub-directories

Essentially I have a large directory with many sub-folders and different formats of files. It reads through XML, JAVA, .txt, etc, in search of a selected String inputted by the user. The results ...
1
vote
5answers
97 views

Ruby array search, returning either a result with a good score or the last result

I have an array of hashes, each of which has two attributes: "title" and "Zscore". I want to return either the result of ...
-1
votes
1answer
76 views

Searching into a contact list

I am performing search in a contact list using linear search with complexity \$O(n)\$. Please suggest me how to improve search strategy in my code. ...
1
vote
1answer
34 views

Object key diff

I've been tasked with finding property differences in massive JSON structures and return them in a particular fashion ([key_1.key_2, key_1, etc]). Here's my code, which is focused on readability so ...
5
votes
1answer
74 views

Sort a strings collection by a search term

I'm trying to implement a search bar in which the user sends a search term and the search bar displays the results. I have a naive solution which separates the original list into three sublists: a ...
5
votes
3answers
121 views

Composing and executing a customer search

I was wondering if someone could help me refactor this code. Although I know this looks bad, it works. Now I would like to refactor it so I would respect the open/closed principle in SOLID. Let's say ...
5
votes
3answers
179 views

Interview coding test: Searcher

I did a task for an interview and the solution was not accepted. The task was to implement the class search function by name. The number of classes in the input data from 0 to 100000. Class names are ...
3
votes
3answers
169 views

Search in a big dictionary Python

I have a big Python dictionary with more then 150,000 keys every key has list value. This dictionary contains infinitive words as key and all grammatical forms of these words as values: ...
4
votes
0answers
112 views

Shortest path navigation across a grid using Best First Search

The code below is an implementation of the Best First Search algorithm for navigation of the shortest path across a 2D NxN matrix. As a heuristic for the search I use the standard distance formula. ...
10
votes
1answer
153 views

Fuzzy grep for fuzzy bears in pure Python

I am aware of the Python modules galore to do this, but this was partially a learning experience and partially all the functionality I need and no more. I'm writing a simple interpreter for a Forth-...
3
votes
2answers
99 views

Search algorithms in julia

I've been trying to implement the basic search algorithms: Sequential search for ordered and unordered arrays and the binary search algorithms, as part of a package. So, this is the implementation: <...
8
votes
1answer
308 views

Fuzzy / approximate text matching program in Python

I'm trying to build a program that will find approximate text matches between two texts. Basically, I'd like to find a way of identifying quotations, so that when an author quotes, say, the King James ...
3
votes
2answers
105 views

Most efficient dict filter on key tuple?

I have a dict wherein a value needs to be retrievable by any one of several keys. It seemed that making multiple dictionaries or multiple entries in a single ...
5
votes
2answers
227 views

Exponential search

I recently discovered the exponential search algorithm which can be used to find whether a value exists in an ordered range. An exponential search checks whether a value is smaller than the \$2^n\$th ...
5
votes
1answer
86 views

Implementing a Property Searcher

I want to search some or all public properties of a class and for this requirement I have implemented a Property Searcher. The Input for a ...
6
votes
1answer
71 views

TrieSet with Wildcard Search

What I'm ultimately trying to accomplish is a tool in which I pour some documents. Then I mark #x documents as desired and #y documents as undesired. My tool now is to analyse and compare the ...
0
votes
1answer
118 views

Umbraco Examine Search for Full Site

I have a macroscript which reads a query string for search term parameters, and then does a multiple word GroupedOr search through UmbracoExamine / Lucene.NET. Because this is a full site search, I ...
8
votes
2answers
254 views

Calculating the fastest strategy in OGame

For a game I am playing, OGame, I am trying to calculate the fastest strategy to reach a certain state in the game, relevant parts of the game for this question are: You can build different types of ...
4
votes
2answers
430 views

Search word in multiple files

I am writing a brute-force method to search for a word. Please review my code and tell me how I can improve it. ...
2
votes
2answers
136 views

Counting the occurrences of a string in each file

I am trying to find a phrase or a string in file and count the number of occurrences of that string: ...
10
votes
1answer
439 views

Bash command helper in C

Previously, I had written this program in C++ and asked about it here on Code Review. After spending some time with C++, I desired to become more familiar with its namesake. This is my first C program....
-3
votes
1answer
459 views

Mapping phone numbers to names [closed]

Problem description: You are given a phone book that consists of your friend's names and their phone number. After that you will be given your friend's name as query. For each query, print the ...
4
votes
3answers
112 views

Replacing multiple search strings simultaneously

A utility method StringUtils.replace to replace multiple search strings simultaneously. I'm looking for a review of any and all aspects, but especially: Is there'...
4
votes
1answer
87 views

Search file for keyword program

Just looking for some advice and I know using std namespace is bad but I didnt have the time to do all the using stuff. I want help on what here is good and what is bad practice :). ...
12
votes
1answer
112 views

To read a book thou should have it bought, to buy a book thou should have it found! (Search Abstraction)

I started a hobby project to find the books that I read (paperbacks) so that I can keep track of them (reading start date, finish date, number of pages, etc..) The first challenge was to find the ...
13
votes
2answers
259 views

A* search in MATLAB

I have implemented A* search in MATLAB, but I am looking for ways to increase the speed and optimize it. I have tried using a priority queue but I found it doesn't work that well, so I am using a ...
11
votes
4answers
151 views

Let's play Find that File

Isn't it annoying when you can't find a file you recently created? Especially when you either have a very disorganized drive or a directory with lots of files. Even if you don't care, isn't it nice ...
9
votes
1answer
462 views

Scanning multiple huge files in Python

I'm trying to implement an algorithm able to search for multiple keys through ten huge files in Python (16 million of rows each one). I've got a sorted file with 62 million of keys, and I'm trying to ...
0
votes
2answers
62 views

Command line google searching

I have a bash script that is meant to start a google search from the command line. I am also looking to implement a way of getting source code for the search page possibly through a subscript. This is ...
5
votes
1answer
63 views

SQLite search disregarding spaces and Pinyin tones

I have a column where, pretty much, each entry has numbers (specifically #1-4) and spaces (' '). I wanted to make a query that could avoid having to know these numbers and spaces. ...