Questions tagged [search]

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

Filter by
Sorted by
Tagged with
1 vote
0 answers
26 views

`e WORD` option to search for a word in the target file

I have the following program (grep) that performs a multi-word search, use the -e WORD option to search for a word in the target ...
user avatar
  • 91
1 vote
1 answer
31 views

Sort and search vectors by different criteria

Class class Player { std::string name; int score; int id; }; I thought about how to write a code to sort and search vector ...
user avatar
  • 11
3 votes
1 answer
64 views

Algorithm Challenge: Fuzzy Search

I recently took part in an algorithm challenge to create a Fuzzy search with the following criteria: Given a set array, create a function that receives one argument and returns a new array containing ...
user avatar
1 vote
1 answer
80 views

Shorten code in search function of an inventory app

Introduction I want to create an Inventory App in C#. I was thinking of someone who sells a few products and only needs to have a few product properties in the program to search or sort by, and then ...
user avatar
  • 175
0 votes
1 answer
79 views

Search Engine in PHP having new architecture

I have invented and implemented a new search engine architecture. This search engine has been developed mainly for English Alphabet. This search engine is based on the fact that no letter in English ...
user avatar
-2 votes
1 answer
199 views

Fastest string search algorithm invented by me. It is called ""Choudhary String Search Algorithm""

I have invented the fastest string search algorithm. It is called ""Choudhary String Search Algorithm (choudharyStringSearchAlgorithm)"". I have compared my algorithm with Brute ...
user avatar
3 votes
2 answers
70 views

Search code that performs in-memory search

This is the code I came across in our repository. This performs search in-memory and is invoked on service layer code. In our front end operators like EQUAL_TO and ...
user avatar
1 vote
1 answer
81 views

Get Interval by specific value from List using JAVA 8

First let's introduce the problem: I have a list like [{10,18}, {19,25}, {26,50}] and i have an input (n), when (n) inside one of objects in a list i will get this ...
user avatar
  • 113
1 vote
2 answers
79 views

Requiring query field to not be empty on search api

we have a RESTful API that includes an endpoint for search apiserver/v5/search?q=[search text] for any query, it passes it off to solr and returns the result like ...
user avatar
2 votes
1 answer
53 views

Please verify Jump searching algorithm

Please verify jump searching algorithm that I have written and let me know if any bugs are present. I have tested it from my end, but still would like to get it verified for any missing corner ...
user avatar
  • 121
0 votes
0 answers
128 views

Simple Inverted Index made in python

So I made an inverted index following a tutorial online and was wondering if I can improve it by implementing one or more algorithms or reduce code or maybe make the processing files faster. I am ...
user avatar
  • 31
1 vote
1 answer
749 views

Finding nodes with 0 or 1 parents - DFS or BFS

I completed the following question but it seems a lot of space complexity. Do you think is there a way to complete it with graph search or so? Thanks for the comments. Suppose we have some input data ...
user avatar
0 votes
1 answer
210 views

Fastest string search algorithm

I have invented the fastest string search algorithm. Can someone prove that it is not fastest? I am not considering worst case scenarios. The algorithm can be found here: https://sourceforge.net/...
user avatar
  • 17
1 vote
1 answer
46 views

Python Prime Search Slower Optimization

I have these 2 version of code. Both are looking for all primes under a certain ceiling value. The first is testing against the set of all odd numbers. The second in testing against the set of all 6k-...
user avatar
2 votes
1 answer
66 views

Rxjs search in Angular

I created an rxjs search for a hiring company, but I got rejected for the following reason: -performance issue on a bigger data set. -bugs My question is how can I make this code better for the next ...
user avatar
4 votes
1 answer
66 views

Find optimum teams given calendar availabilities

I'm designing an algorithm that creates optimum teams based on everyone's availabilities (maximizes the amount of shared availability). To this end, I've made a function that takes in a dictionary of ...
user avatar
7 votes
6 answers
3k views

C++ implementation of depth-first search

I got the C++ implementation of depth-first search (DFS) from here and made slight modifications to it. The modified code is as follows: ...
user avatar
  • 425
4 votes
1 answer
196 views

Indexing and searching an list of rectangles to see if they contain a point

I have a flat list of rectangles, in the following format (id, x co-ord, y co-ord, height and width): ...
user avatar
2 votes
2 answers
143 views

Searching database of books

The application I'm making a small app (currently ~500 lines) to manage and download books and other media items. Each item is uniquely identify by its ...
user avatar
2 votes
0 answers
145 views

2D Array Word Search: Complexity and Optimization

🧩 Objective Determine whether a given word is contained in a 2D Array word search. 🔎 Question 1. What are the time and space complexities of the current algorithm? Time complexity Linear: \$O(2(r * ...
user avatar
1 vote
1 answer
110 views

Search by parts of Arabic word on JSON

I've just implemented a search box, so I can search on employee object by (name, part of the name, phone, email ...). Ex. if the name: Moamen Abdulraouf Mansour, I can search with ( moamen | moa | ...
user avatar
  • 209
0 votes
2 answers
520 views

Sum of 2 numbers in an array [closed]

I have this problem to solve: Given an integer \$z\$ and an array \$a\$ of distinct integers sorted in ascending order, find two numbers, \$x\$ and \$y\$, belonging to the array such that \$x + y = z\...
user avatar
2 votes
0 answers
103 views

Trie to index files and search for them

Basic idea (foo and foa are filenames): ...
user avatar
2 votes
1 answer
162 views

How to sort and search in JavaScript large set

The array "scores" tells the total points for each person involved in a contest. So for example: ...
user avatar
  • 163
1 vote
1 answer
73 views

recursive file search, C , linux

hi guys this script recursively searches for files with a certain extension and possibly in a directory passed by the terminal ....(In case no directory has been passed, search from the current one) I ...
user avatar
2 votes
2 answers
84 views

Basic binary search in python

I just started learning to code during quarantine and whilst learning python, I created this program for a binary search. This is really basic so I assume that there is a way easier method. If anyone ...
user avatar
2 votes
1 answer
110 views

Searching in Multidimensional Array

I was wondering about the Array built in methods in java 8. As there is no specific method other than Arrays.binarySearch. So for multidimensional array I wrote ...
user avatar
2 votes
2 answers
86 views

Run dir scan as fast and efficient as possible / clean code

I'm not a very experience python programmer. But I want to make my code as fast and efficient as possible as well as write it clean and therefore got the advice to share it here. So I'm having the ...
user avatar
  • 161
3 votes
1 answer
50 views

Brute-force electronic component selection space search

Yesterday I hacked up a simple component selection program. An example is shown at the bottom for the application, though this can be used generally for a lot of different simple circuits I come ...
user avatar
  • 47.6k
1 vote
1 answer
155 views

Performance: Use plain for loops to look for (existence of) string in string array?

I timed a few ways to look for a string in a string array (with 82 elements in the example) in a case sensitive manner plus ignoring case. I am kind of suprised, that the plain for loops are faster ...
user avatar
  • 435
3 votes
1 answer
287 views

Elegant Method for Sleeping with Selenium Webscraper

My goal is to scrape the no. 1 suggestion of the suggestion list on https://finance.yahoo.com for any entry. If there is no suggestion the code should write ...
user avatar
  • 43
4 votes
2 answers
89 views

Search engine that looks through files

For my programming class, at the start of the semester before we learned about object oriented coding, I was supposed to make a small program that searches through a bunch of files, being graded on ...
user avatar
  • 802
2 votes
2 answers
150 views

Searching within a data model using an array matching multiple terms

I have a standard tableview app that displays information from a data model array that uses a custom class. There is a UISearchController to filter the data. A ...
user avatar
  • 226
2 votes
1 answer
63 views

Is this breadth-first search correct?

I wrote a program that is supposed to be a breadth-first search algorithm, but I'm very new to search algorithm so I don't know if my method is very effective or if there is a simpler way to do this. ...
user avatar
  • 29
7 votes
1 answer
188 views

Boyer Moore Horspool Search Algorithm in Go

I am practicing Go and try to implement Boyer Moore Horspool Algorithm in Go, It returns all ocurrance of a "phrase" in a given text. This code is working, but I would be pleased to have any feedback ...
user avatar
  • 191
3 votes
3 answers
74 views

Find a String in an Array

This program is used to get names and numbers of N person, print out the numbers of a person. Please help me improve this code. Additional Question: To avoid a very long name that exceeds char's ...
user avatar
  • 189
1 vote
1 answer
99 views

Check if is it possible to get to a point that is presented by a number [closed]

Problem description from an Iranian online course, translated with the help of Google Translate: Tired of coding, Mehdi has gone on to his childhood games. But because he doesn't know who to play ...
user avatar
4 votes
1 answer
106 views

Comparing game tree search AI algorithms in Java

(The entire project lives here.) I have a program that benchmarks three game tree search algorithms: Minimax, Alpha-beta pruning, Alpha-beta pruning with move ordering. So here is my code: ...
user avatar
  • 25.3k
9 votes
4 answers
242 views

Stream text scanning

I've written some utilities to read text from streams. One of these, the ReadTo method, is to read text from a specified stream until a given text is encountered, ...
user avatar
1 vote
0 answers
270 views

Fast text search in Rust

I have a large file that I want to search for text as fast as possible. There is not a memory contraint, so I am loading the entire file into memory so that I can use the rayon parallelism crate in ...
user avatar
  • 1,323
1 vote
1 answer
43 views

How can I make my filter search code more efficient?

Here is App.js ...
user avatar
6 votes
2 answers
1k views

Javascript - Find a deepest node in a binary tree

Problem Statement Given the root of a binary tree, return a deepest node. For example, in the following tree, return d. a / \ b c / d My ...
user avatar
  • 1,545
5 votes
4 answers
243 views

C-based hash matching cracker

How can I improve this hash matching program using either abstraction or search/sort algorithms? We briefly were introduced to searching methods such as bubble sort and merge sort, but I'm not sure ...
user avatar
3 votes
1 answer
187 views

String.IndexOfAny(string, string[]) (lowest position for group of needles in haystack)

This is a follow-up to this question with bug fixes, question and code improvements from @dfhwze, @PieterWitvoet, @HenrikHansen, @t3chb0t. I am still hoping for an improved approach or algorithm ...
user avatar
  • 412
2 votes
2 answers
893 views

Best C# implementation of IndexOfAny(string, params string[])

Follow-Up question .Net provides String.IndexOfAny(string, char[]) but not String.IndexOfAny(string, string[]). The existing ...
user avatar
  • 412
1 vote
1 answer
85 views

Inventory system codebase

I'm here looking for a review over my current code-base. Please: Ignore using namespace std; this is for educational purposes mostly so the usage of using namespace std; does not matter for this ...
user avatar
8 votes
3 answers
1k views

Java TreeMap.floorKey() equivalent for std::map

I wanted something equivalent to this Java program: ...
user avatar
5 votes
0 answers
266 views

Rabin-Karp algorithm implementation

This code uses the Rabin-Karp algorithm to compare two text files. It takes a few minutes when both files contain around 1000 words. How can it be improved? ...
user avatar
  • 51
4 votes
1 answer
450 views

Enhancing search using Fuzzy Logic in NodeJS

Brief Description: In my NodeJS Application, I have a model called User. User.js ...
user avatar
3 votes
0 answers
251 views

reverse recursive search on an object with javascript - like tree search

I implemented a tree search with JavaScript. It has below basic rules. It will search over an array of objects which has recursive(like fractal) If it found a according data in a leaf(the final ...
user avatar

1
2 3 4 5
8