Questions tagged [search]

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

Filter by
Sorted by
Tagged with
4 votes
0 answers
98 views

Performs interpolation binary search over an array. If value found returns found and index else returns not found and insertion index

Performs interpolation binary search over an array sorted in ascending order. If value found returns found and index else returns not found, the insertion index is returned. Assumptions : data is ...
Pragmatic's user avatar
3 votes
1 answer
69 views

Fast search for the longest repeating substrings in large text (Rev.4)

This is the forth iteration of the Fast search for the longest repeating substrings in large text (Rev.3) code review. Special thanks goes to G. Sliepen who conducted all the reviews. Functional ...
Damir Tenishev's user avatar
3 votes
1 answer
121 views

Incremental upper bound in sorted range

Since initial question Increasing binary search for mismatch in sorted range contained defects in code and can confuse the readers, here is the updated version of the question. Is the code below ...
Damir Tenishev's user avatar
2 votes
1 answer
94 views

Fast search for the longest repeating substrings in large text (Rev.3)

This is the third iteration of the Fast search for the longest repeating substrings in large text (Rev.2) code review. Special thanks goes to G. Sliepen who conducted the first two reviews. Functional ...
Damir Tenishev's user avatar
2 votes
1 answer
91 views

Fast search for the longest repeating substrings in large text (Rev.2)

This is the second iteration of the Fast search for the longest repeating substrings in large text code review. Special thanks goes to G. Sliepen who conducted the first review. Functional ...
Damir Tenishev's user avatar
3 votes
1 answer
173 views

Fast search for the longest repeating substrings in large text

Is there a chance to implement the code below better with the features of recent C++ versions? Functional specification Having a large text and already built prefix array find the longest substrings (...
Damir Tenishev's user avatar
5 votes
1 answer
78 views

Local Search Engine in Rust

I made a simple search engine using the xkcd API in Rust which turned out better than I'd hoped for! I decided to use tf-idf as a way to rank results, which I feel like has some room for improvement. ...
joeymalvinni's user avatar
4 votes
2 answers
469 views

Spatial radius search in Boid simulation

I am working on a Boid simulation with 10,000 boids. I've successfully utilized geometry shaders and an array<GLfloat[3], MAX_BOIDS> for vertices to enhance ...
nowox's user avatar
  • 1,099
2 votes
0 answers
76 views

Javascript basic search engine recipes

I have made a search engine for recipes. Requirements for this JS Project are as follow: Create a function called searchRecipes that takes all recipes and an ...
Yass's user avatar
  • 21
4 votes
1 answer
49 views

JavaScript search algorithm to find a town in a particular state

I built a function in JavaScript which executes a search algorithm to find a town in a particular state. The dataset, referenced by the variable townsAndStates is ...
code writer 3000's user avatar
5 votes
2 answers
453 views

Optimizing a node search method given a 2-D spatial point

I have a tree-like structure called grid. I have designed it as a structured numpy array. Each element of grid is a tree-node. ...
matts's user avatar
  • 53
2 votes
2 answers
65 views

Given a sorted list of integers, find the highest count of elements between an indeterminate but fixed size range

I'm trying to optimize a function that takes a sorted list of integers and tells me what is the maximum number of elements in the list between any definite size range. To be clear, the range itself ...
Tyler Schuster's user avatar
7 votes
2 answers
465 views

Copy file with text replacement

I am currently learning C++. I coded a tiny program for school and I wonder if there could be issues (like bugs or security issues) with it. Any ways to make it have weird behaviours would be very ...
BobDeTunis's user avatar
2 votes
1 answer
88 views

python function for searching videos in Vimeo

https://github.com/floris-vos/vimeo_search_python I made a small function that takes search terms as arguments and returns a dictionary with items, each holding an URL, title, duration, channel, and ...
Willem van Houten's user avatar
3 votes
1 answer
265 views

`nov.el` function to search the entire `epub` ebook

nov.el does not provide an easy function to search the whole of the ebook content. Every search performed on buffer only applies to the "document" or ...
Sati's user avatar
  • 417
3 votes
1 answer
145 views

Swift - efficient array searching

I am trying to find a way to search an Int array (all numbers are > 0) and identify sequences where the sum of each element is a specific number. One element can ...
koen's user avatar
  • 179
1 vote
0 answers
25 views

Optimizing search algorithm for guessing list of strings via function returning bool if substring is in list [duplicate]

I trying to figure out the most effective way to accomplish this task: A function, check(), contains a list of strings. Calling the function with a string as ...
user avatar
3 votes
3 answers
352 views

Most effective search algorithm for guessing list of strings via function returning bool if substring is in list using Python

I trying to figure out the most effective way to accomplish this task: A function, check(), contains a list of strings. Calling the function with a string as ...
n0k's user avatar
  • 31
6 votes
4 answers
906 views

Counting the number of patterns that exist in a particular string

I am solving this problem where the function returns the number of times a pattern is found in a said string word. It could be easily solved via ...
xyf's user avatar
  • 508
1 vote
2 answers
505 views

Find the newest file that contains a specific string in every subdirectory of the path using the least resources

I have a server side logs folder that contains many hundreds of logs most of which are in subdirectories according to the machine the logs have come from. The task is to extract the full path of the ...
Richard Payne's user avatar
6 votes
1 answer
141 views

Implementation and Testing of Exponential Search for scenario where we search the same array/list many times

Exponential Search is an optimization over binary search. Conceptually, when searching for a number target in a list of numbers ...
joseville's user avatar
  • 456
1 vote
1 answer
565 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 ...
MeoH's user avatar
  • 11
3 votes
1 answer
317 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 ...
James Ward-Sinclair's user avatar
1 vote
1 answer
103 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 ...
Daniel's user avatar
  • 219
0 votes
1 answer
97 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
2 answers
388 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
91 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 ...
user251118's user avatar
1 vote
1 answer
271 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 ...
Akram's user avatar
  • 113
1 vote
2 answers
417 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 ...
AwokeKnowing's user avatar
2 votes
1 answer
59 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 ...
Ravi Jain's user avatar
  • 121
1 vote
1 answer
2k 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 ...
Neslihan Bozer's user avatar
0 votes
1 answer
837 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
1 vote
1 answer
53 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-...
Desmond Rhodes's user avatar
2 votes
1 answer
179 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 ...
Gábor Pehl's user avatar
4 votes
1 answer
84 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 ...
Trustworthy's user avatar
7 votes
6 answers
4k 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: ...
a_sid's user avatar
  • 425
4 votes
1 answer
327 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): ...
AncientSwordRage's user avatar
2 votes
2 answers
409 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 ...
ChocolateOverflow's user avatar
2 votes
0 answers
188 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 * ...
AdamHurwitz's user avatar
1 vote
1 answer
344 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 | ...
Moamen's user avatar
  • 209
0 votes
2 answers
917 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\...
Alberto Ursino's user avatar
2 votes
0 answers
146 views

Trie to index files and search for them

Basic idea (foo and foa are filenames): ...
user227408's user avatar
2 votes
1 answer
227 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: ...
oderfla's user avatar
  • 163
1 vote
1 answer
136 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 ...
checcasio 's user avatar
2 votes
2 answers
92 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 ...
Anonymous's user avatar
2 votes
1 answer
170 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 ...
Ashish Pawar's user avatar
2 votes
2 answers
194 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 ...
BenjaminK's user avatar
  • 161
3 votes
1 answer
63 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 ...
Reinderien's user avatar
  • 61.2k
1 vote
1 answer
969 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 ...
embert's user avatar
  • 445
3 votes
1 answer
792 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 ...
MaGarb's user avatar
  • 43

1
2 3 4 5
8