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

learn more… | top users | synonyms

1
vote
1answer
21 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
60 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 ...
4
votes
3answers
107 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
159 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 ...
1
vote
0answers
43 views

Searching a Maze Using DFS [closed]

I am new to recursion and searching algorithms and am trying to implement a maze searching program using DFS. I have tried troubleshooting the issue, but there seems to be an error with my code. Any ...
2
votes
3answers
150 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
70 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
140 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 ...
3
votes
2answers
62 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: ...
7
votes
1answer
127 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 ...
1
vote
0answers
39 views

Depth Limited Search for Map Coloring Graph in Python [closed]

Hey I'm trying to solve the Map Coloring Problem using a Depth Limited Search. I found an example of the problem here (https://courses.cs.washington.edu/courses/cse473/10au/slides/chapter05-6pp.pdf), ...
3
votes
2answers
66 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
147 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
61 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 ...
4
votes
1answer
41 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
52 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
214 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
229 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
83 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
430 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 ...
-3
votes
1answer
286 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
79 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 ...
4
votes
1answer
78 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
107 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 ...
12
votes
0answers
125 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
140 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
434 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
52 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. ...
1
vote
2answers
40 views

Searching for an object in a list returning boolean and referencing variable

My method searches through an list of accounts which have the property "Name". ...
12
votes
2answers
119 views

“Vc” as in Vancouver, or Valencia?

It is common to shorten city names when writing, or at least in Sweden. "Göteborg" (Gothenburg) is often referred to as "Gbg" "Uddevalla" is commonly written as "Ua" "Trollhättan" is often written ...
3
votes
1answer
97 views

Finding nearest float values corresponding to a data point (of three variables) in a table with multiple columns using C++

I have a data file which contains floating point data arranged in 4 columns. Each row represent a specific data point. The first column(X) is made up of 100 different values but the values are ...
6
votes
1answer
100 views

Bash command helper in C++

I'm writing a program to help with remembering complex bash commands. On invoking the program, it asks for a description of the desired operation, e.g., "increase volume" or "find orphaned packages", ...
2
votes
3answers
142 views

Finding Egyptian fractions with A* search

I've written an A* search to find the optimal solution to the equation $$ \dfrac{4}{n} = \dfrac{1}{x} + \dfrac{1}{y} + \dfrac{1}{z} $$ with \$n, x, y, z\$ positive integers, and \$n\$ given; the ...
0
votes
0answers
192 views

Laravel 5 Search

I think I could improve this code a lot, especially this part: if($month !== "") { AppointmentsController: ...
1
vote
1answer
37 views

Searching and replacing text

Simple Playlist Modifier This program is a search and replace program for text based files. The main goal of the program is to replace directory paths to music files. The idea is to have the program ...
1
vote
1answer
23 views

Implementing BST in javascript

Is this an efficient and clean implementation? ...
1
vote
1answer
65 views

Array search algorithms: performance comparison

I'm making a program that compares multi-key sequential search and Interpolation search in a sorted array by the number of array accesses for my assignment. ...
3
votes
0answers
87 views

Trinary Search Tree

I'm probably not the first to think this up, but here we go. An trinary search tree is a generalization of a binary search tree in the sense that instead of a comparison function returning true or ...
8
votes
1answer
450 views

Generic domain independent Monte Carlo Tree Search methods library

I've written this small generic library for the purpose of my Bachelor's thesis. It's fully functional and unit tested and I want to get as many opinions as possible regarding overall code quality ...
2
votes
2answers
232 views

Breadth-First Search heuristics to find solution to Water Jug Challenge

I started learning AI recently. In AI, searches should be avoided and everything in AI is a search problem. One of the easiest problem where we could use general AI search techniques is the water jug ...
4
votes
2answers
191 views

Calculating the number of steps it takes to get from point S to F

I have following Java class called TheNewMario. It reads a String path and iterates through the path from ...
6
votes
1answer
113 views

Implementing a (small) full-text search in Ruby

I'm trying to implement a small full-text search in Ruby. I feel like I've laid down the foundation but I've encountered a blocker that has gotten me thinking that something with the design is ...
3
votes
1answer
339 views

Breadth-first tree cutting

I have a working solution for 'Cut the tree' problem but it is not fast enough. Problem Statement: Atul is into graph theory, and he is learning about trees nowadays. He observed that the ...
3
votes
2answers
193 views

Searching within multiple objects of the bucket

I have millions of files in the Google cloud storage's bucket. I want to search within files with a .index extension and retrieve the contents. This is currently what I am doing, but the time ...
0
votes
1answer
290 views

Laravel Controller including sort and search

I am using this code on my own personal website (my personal administration site) so it doesn't need any security and so on. I am not into learning everything about that yet, and although I do know a ...
3
votes
1answer
60 views

Small BM25+ implementation for probibalistic result ranking

I came up with this small implementation of an Okapi BM25+ ranker using Ruby. I cooked it up in a very short time so it's very simple but I'm trying to think whether there's a better way to write it. ...
2
votes
1answer
66 views

Pattern search in a text

Is this a practical algorithm for pattern matching in a text? Assume text can be very large, is there anything I can do to speed up the performance? ...
6
votes
2answers
269 views

Contact search application

Create a C++ program which will act like contact search app in mobile. For example, if the following contacts are saved in contact list: Massi Pradip Prasad Praveed Raju ...
1
vote
1answer
85 views

Search module in JavaScript

I implemented search module, but I'm a novice in programming and I'm not sure about public and private functions that I coded. Did I do it right? ...