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

learn more… | top users | synonyms

10
votes
2answers
130 views

Finding a word within a pre-defined set using a search string with wildcards

The other day I was intrigued by this question (originally from here): Write a program that answers YES/NO search queries containing * placeholders. Example: if the data you have is (hazem, ...
2
votes
2answers
55 views

A set of names and a request with asterisks

I have a set of names and a request with asterisks. An asterisk can be replaced with any letter. For example, there is a set of names: hasad, ahmed, fizo. And there are a few sample requests: hasad, ...
0
votes
0answers
22 views

Search box in JavaScript for blogger.com

I wanted to build a search box for Blogspot which goes through every label and filters them so remains just the match and every other label is hidden. I work with this through the firefox developer ...
6
votes
2answers
72 views

Find element in sorted matrix

Find an element in a MxN matrix where each row and column is sorted in ascending order. Any comments on my code? (I added some test cases on non square matrices which I did not copy here) ...
1
vote
0answers
46 views

Minimum amount of edges that needs to be traversed to visit all vertices… or something like that

So I have this problem, where I'm given m connections over n vertices. The vertices are labeled ...
7
votes
3answers
73 views

Recursive filename search

I have created a little program to search a set of folders holding documents scanned. The folder structure is as follows: c:\images\year\month\date\documenttype\firstpartofdocumentNo.\ the ...
5
votes
1answer
90 views

Java Word Search Solver

This is a challenge up on Programming Praxis, however there are no Java solutions, and there are few Java implementations elsewhere on the internet. Most of these implementations simply search the ...
8
votes
3answers
393 views

Get values between two dates

I have a search form where users can enter ValidFrom and ValidTo dates, There are three conditions: ...
4
votes
1answer
301 views

Powershell search millions of files as fast as possible

I once asked a similar question but in C#. Now I have the same problem in powershell.. What is the fastest way, to search files newer than 15 minutes, in a file system with more than 1 million files? ...
3
votes
3answers
122 views

Search through .xml files for text that exists anywhere in the file

I have about 1000 .xml files in different sub directories under one root folder. My root directory contains the below structure: RootDir\172\00ad8dc-bff\25.0.xml ...
2
votes
1answer
46 views

Small generic path search framework in Java

I have this small generic path search library. It's not perfect at all, so I need some comments as to have a chance to improve it. com.stackexchange.codereview.graph.model: ...
15
votes
4answers
284 views

Name Filtering using a Trie

This question suggests a different (improved?) implementation for searching/filtering names based on a search query. This is based on the question here: Name filtering in Java A Trie allows the ...
6
votes
2answers
92 views

Name filtering in Java

I have a search box for searching for people in a list of names. Here is the code that runs every time the query changes. I could not find anything open-sourced for this, so I wanted to make sure ...
10
votes
2answers
96 views

Karate Chop Kata

I had some time to kill today, and I found the Karate Chop Kata. Specification: Write a binary chop method that takes an integer search target and a sorted array of integers. It should ...
4
votes
1answer
159 views

Search algorithm to find a point from a given X value

I implement the following algorithm in order to find a point from a given X value in a sorted list with the same distance between each X values. Here's an example of my list content with a delta of ...
5
votes
3answers
170 views

Search arrays for values

I implemented a search function like this: ...
2
votes
2answers
113 views

Fastest way searching specific files

I got thousands of files with a specific file extension in thousands of sub folders. Now, what is the fastest way to search with a pattern? I tried the method ...
4
votes
5answers
770 views

String vs List to check if a country is part of a continent

I simply need to check if a country is part of a particular continent (only one). The continent has around 50 countries. The list is constant and must be initialized at the time of creation. Which one ...
3
votes
2answers
155 views

8 Puzzle solver A* search

I recently created this for a coursework assignment. I am always looking to learn and would like some feedback on my code. Is there any OO principles I'm going against or anything irritating I'm ...
2
votes
3answers
74 views

Searching text for a string

This is my current code: ...
8
votes
1answer
90 views

Karp-Rabin with bitwise hash

As a Rags-to-Riches re-implementation of the Karp-Rabin question here, from @tsleyson, I thought it would be interesting to understand the algorithm better, and to use bitwise-shifting instead of ...
1
vote
1answer
81 views

String search & replace in C

I created a function to do that, and I want to know if there is a problem I'm overlooking about it .. ...
6
votes
1answer
300 views

Excel VBA binary search class module [closed]

I have a long list of sorted strings in a Workbook, and I have to find a lot of values in it. I was hoping to build a binary search Class Module that will find them for me faster than Excel's built-in ...
5
votes
2answers
139 views

Simple search engine using TF-IDF (200 LOC)

I wrote simple search engine based on TF-IDF statistic and cosine similarity. I am still learning Scala, so would be glad to hear comments (here or at GitHub) regarding my code from Scala ...
2
votes
1answer
53 views

Saving search history with many checks and validations inside

I am absolutely confused by saveSearchHistory function. It seems dirty and unobvious. Should I refactor it, and how? SearchHistory.java ...
11
votes
1answer
180 views

Case-insensitive String search in Array

Wrote this function for a Stack Overflow answer. It started off pretty bad but in the end I polished it a bit and now I have something I think to be pretty clean. Actually, when I look at the code, ...
12
votes
5answers
321 views

Fastest way of removing a substring from a string

Taking a break from my C++ series, I recently reviewed the code in this question. I ended up writing my own separate derivation of the function so that I could remove all of the substrings from a ...
3
votes
0answers
67 views

Find binary sequence in NumPy binary array

As part of creating a software defined receiver and decoder, I want to find sync pulses in weather satellite data. The data is first digitized to a 0-1 array. The code below is working. The ...
2
votes
0answers
43 views

MySQL natural search and like search

I have written two queries for searching, but I want to simplify them as it seems needed. ...
3
votes
1answer
95 views

Test if two nodes in binary search tree are cousins

Cousins are nodes at the same level of the tree, with different parents. They don't have to share the same grandparent. My solution depends on having a binary search tree with unique elements. This ...
8
votes
2answers
385 views

Searching a Word Document from Excel

Today I created a script in Excel that migrates data from a specific Word document and copies a portion of it to a cell in Excel (the date to be specific). The file input is Last name, First ...
2
votes
1answer
470 views

Node.js JSON searching & updating

I'm working on a web-based on/off controller for multiple switches. I'm looking for a good way to manage the current state of a switch and updating the current state on change. So far I've got a ...
7
votes
1answer
253 views

Binary search an integer array

I'd like this code to be improved ...
3
votes
1answer
117 views

Simplifying linked list “search and delete” function

The function asks the user for a value to search for, then deletes all matching values in the list. The program runs flawlessly, but I can't figure out a simple/elegant way of separating cases for ...
4
votes
2answers
416 views

Searching through various PDF files

I'm just looking for advice on how I can get my code to operate faster. It's pretty quick right now with searching through 30 3-page PDFs, but I imagine once there gets to be thousands of files to ...
7
votes
2answers
102 views

Program to find the element in an array

I'd like this code to be improved. ...
4
votes
5answers
430 views

Search algorithm for specific values in a 3D array/matrix being super slow

I'm trying to create code that reads a text file (containing (double) numbers between 0 and 1) and filling up a 3D array/matrix (calling it matrix from now on) with ...
2
votes
1answer
279 views

Typeahead Talent Buddy

Problem is Talent Buddy. Your task is to write a function that prints to the standard output (stdout) for each query the user name that matches the query if there are multiple user names ...
1
vote
1answer
71 views

Search a file system for files that match a given pattern

My concerns with this code: Is there a more efficient way to find files by pattern in Python? Does os.walk() work in Windows? Is this code pythonic? Should ...
5
votes
2answers
98 views

Finding the best matching block/patch in Python

I wish to locate the closest matching NxN block within a WxW window centred at location (x,y) of a larger 2D array. The code below works fine but is very slow for my needs as I need to run this ...
5
votes
4answers
375 views

Faster method to find data using search word?

I need to search through a string array to find every occurrence of "Parameters Table", and between each "Parameters Table" and the next, get another string from a specified index (that remains ...
7
votes
2answers
2k views
7
votes
4answers
429 views

File text searcher

I have a working version of a logfile searcher that targets a specific directory by extension type, and searches the files for certain words. I'm wondering if my method is the most efficient ...
4
votes
1answer
76 views

“Good” Blob search

I written this code to search 'blob' items (text files) on the basis of their content. For example, if I search for "Good", then the names of files that contain "Good" or "good" should appear in the ...
6
votes
2answers
555 views

Z-Algorithm for pattern matching in strings

I was trying to refactor the following Python code (keeping the same time-complexity) which is an implementation of Z-Algorithm for pattern matching in strings. ...
1
vote
2answers
443 views

How to search for a word in a sorted text file efficiently?

I want to write my own program to search for a word in a sorted text file. In the text file each word is in one line. I want to write this myself because I did not find any simple program (without ...
8
votes
1answer
103 views

Speed up my search

I have a django app with search powered by haystack. The general search goes very quickly, but I need to filter the results by their model type. It works but is very slow. I've never really worked ...
1
vote
1answer
40 views

Correct use of Joins & Wheres

I have 3 tables, 1 where voters information is stored, 2 where their address is stored and 3 where voter id's are matched with address id's. I thought this approach was best as several voters can ...
14
votes
2answers
199 views

Hmm, a thoughtful library

I've been writing far too many routines in JavaScript that get a record from a an object or array based off a matching property, much like jQuery does with DOM elements. Since all the good names are ...