This tag is for questions about search algorithms, tools, and technologies.
-1
votes
0answers
11 views
Forming a word parsing algorithm for a word search puzzel [on hold]
I'm working on a wordsearch program in C that takes in a grid of chars with given dimensions that parses string chucks from each row, column, and diagonal directions and compares the chuck to a ...
0
votes
0answers
16 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 ...
7
votes
2answers
167 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
72 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
58 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
418 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
185 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
64 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
57 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
94 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 ...
9
votes
0answers
62 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
125 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
413 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
45 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 ...
4
votes
1answer
44 views
php sqlite query with mulitple replaces
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. This is my working ...
1
vote
2answers
37 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
116 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
95 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
91 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
134 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
129 views
Laravel 5 Search
I think I could improve this code a lot, especially this part:
if($month !== "") {
AppointmentsController:
...
1
vote
1answer
30 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
19 views
1
vote
1answer
53 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
71 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
347 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
186 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
187 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 ...
5
votes
1answer
79 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
261 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
188 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
179 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
46 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
52 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
190 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
70 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?
...
2
votes
1answer
89 views
Graph, and a search that visits each edge exactly once in each direction
My assignment was to write a method that is capable of visiting each edge in a graph in each direction exactly once.
With it, I included a basic Graph class to test it with.
What I'd like a review ...
3
votes
1answer
70 views
Substring searching with Knuth–Morris–Pratt
My program uses the Knuth–Morris–Pratt algorithm to search for a particular substring in a .txt file and then store it in a binary search tree.
Note that ...
10
votes
2answers
261 views
Minimum sub-array challenge
Below is my solution to finding the minimum product sub-interval. It passed 8/12 or so test cases, but the other test cases timed out if they hadn't finished within 2 seconds. When I compile this code ...
3
votes
1answer
609 views
Hackerrank's Sherlock and Array
Challenge can be found here
Problem Statement
Watson gives Sherlock an array A of length N. Then he
asks him to determine if there exists an element in the array such
that the sum of the ...
2
votes
1answer
459 views
Laravel 4 search function
I am using this code in my controller and would like to know if this is good code to use or if I can write it better, or more compact, and so on. I am just trying to learn from this. It does work, so ...
5
votes
2answers
82 views
Wildcard string search with capture
My goal was to create a function as performant as possible with results being:
True/False as to whether wild matches str.
...
7
votes
3answers
442 views
Search string for a substring - indexOf
I am trying to write my own implementation of indexOf for learning purposes. I have an implementation of as follows. I'm sure a more efficient and shorter ...
5
votes
1answer
102 views
First attempt at weighted search
My concern is speed, since this may be used in an e-commerce website I want it to be as quick as possible. Where can I improve?
...
3
votes
2answers
196 views
Multi-threaded domain status checking in Java
I'm tinkering with the idea of crafting a search engine in my spare time. More of a learning experience than anything at this point, but still a project. A key aspect of this system is checking ...
3
votes
1answer
48 views
Yellow Pages Search
I've written code in Free Pascal based on a contest problem (The contest insists that I have to write with Pascal). It works like charm, but I think it still need some improvements, from memory usage ...
2
votes
3answers
188 views
Searching a string of consecutive characters in a binary bar code
I am writing a program that will take a binary bar code and convert it to a zip-code. I need to validate the bar code. A valid binary bar code contains no more and no less than two 1s in any position ...
3
votes
2answers
82 views
Search key in a rotated sorted array without repetition of elements
Is there any improvement possible in this implementation?
...
6
votes
2answers
1k views
Find largest block in matrix
(Largest block)
Given a square matrix with the elements 0 or 1, write a program to find a maximum square submatrix whose elements are all 1s. Your program should prompt the user to enter the ...
3
votes
2answers
41 views
Search utility that searches through source code files
I'm working on a search utility that searches through source files. It's only the beginning of the project. It lacks a lot of features, but a backbone of the project works and it would be great if you ...