Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [search]

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

1
vote
2answers
85 views

Calculating the minimum and maximum of a byte array [on hold]

I've been working with binary files with this last assignment and part of it was to determine the maximum and minimum byte. Initially this was 2 functions but a bonus portion was to make them into 1 ...
2
votes
1answer
47 views

Locate substrings within a file

Here, I am reading in a newline delimited file that can be millions of repeating lines that looks like this: ...
0
votes
1answer
61 views

PHP code for search page

Want to show you part of code that I wrote to process search request. User commit search by articles (codes) of products. The goal is to allow user write his search request to textarea element in any ...
4
votes
0answers
38 views

Improved Knuth-Morris-Pratt over a source of indeterminate length

Following the successful review of my previous implementation. Please review my new, generic implementation of the Knuth-Morris-Pratt algorithm. Its modified to search a source of indeterminate ...
4
votes
2answers
92 views

Knuth-Morris-Pratt over a source of indeterminate length

Please review my generic implementation of the Knuth-Morris-Pratt algorithm. Its modified to search a source of indeterminate length in a memory efficient fashion. ...
3
votes
2answers
71 views

Go grep command clone

I am trying to make a simple clone of the command line utility grep. I'm working on it just for fun and to practice Go. The thing is, I am trying to make it in a way that if several files are given at ...
1
vote
1answer
66 views

Scheme: FSM substring search

I have been working on a function that return a FSM that searches a specific word based on the argument of the constructor. The idea was to use those routines as means to learn about regular ...
3
votes
1answer
47 views

Search indexing of Battle Mech Loadouts

Background I am since a long time ago developing a JavaFX application for creating and analysing 'Mech loadouts for Mechwarrior Online. I previously had a very crude search function based on a ...
0
votes
1answer
64 views

Generic Binary Search Tree Implementation in Java

There is an implementation of Binary Search Tree. This is kind of based on Set Theory that duplicates are not allowed but an attempt to adding the same node twice will replace the older node. BSTNode ...
-1
votes
1answer
118 views

Rabin-Karp String matching

I am learning algorithms and have implemented the Rabin-Karp string search algorithm. I didn't implement a rolling HashCode, but it's judged correct by this ...
3
votes
1answer
137 views

Search for rows in a 2D array that contain a given sequence

I have a 2d array of m * n dimension (m and n can vary from 1 to 100000). The following snippet of code checks if the sequence exists in the row and stores the index if it exists. The time taken by ...
2
votes
1answer
203 views

String search algorithm for finding if a long list of long strings string exists in a similarly sized haystack

My use case is that I have a list of emails and I need to find if the email is in the chain: ...
1
vote
2answers
617 views

Finding specific small byte arrays in large binary files

I'm trying to quickly and efficiently find every recurring position of small byte arrays (4 bytes) in large binary files (several GBs). My current method is as follows: ...
2
votes
2answers
79 views

Check if specific pattern exists in another array and save the index

Let's say I have this pattern and a large array: ...
1
vote
0answers
110 views

React widget to display, sort and search remote data

I've created a React widget that pulls data on crypto-token pairs from a remote API and makes that data sortable by headers and searchable. You can view a demo of it here. Is this a maintainable way ...
5
votes
1answer
67 views

Personal School Course Scheduler

A good friend of mine had the challenge of trying to build a schedule using all available times and classes through a spreadsheet... by hand. He asked me if I could build a program to generate valid ...
3
votes
1answer
46 views

A-Star Search with 3D Universe

I am attempting to write up a program in Python that will find the shortest path between two nodes in 3D space. The actual domain is the EVE-Online Universe, which is composed of systems connected by ...
2
votes
3answers
478 views

Insertion of a node in M-way search tree

I am currently studying data structures and i am looking to see if my implementation of the insertion method in an M-way search tree is good and i am looking forward to improving my coding approach. ...
6
votes
2answers
318 views

Find the second largest number in an array with at most n + log2 n - 2 comparisons

This exercise is from Roughgarden's (excellent) course on algorithms on Coursera: You are given as input an unsorted array of n distinct numbers, where n is a power of 2. Give an algorithm that ...
3
votes
1answer
65 views

Finding an index in an array of objects with 3 possible outcomes

currentUserPosts will have a post object with an id that either matches a tempId, an ...
2
votes
0answers
290 views

C++ implementation of Monte Carlo Tree Search with Python wrapper

Important Prebuilt Python Extensions built for Python 3.6 Includes Python f-strings (3.6+) Complementary GitHub link https://github.com/thejhonnyguy/CPyMCTS Notable: Previous attempt with stock ...
-5
votes
2answers
363 views

Searching with multiple filters [closed]

I was looking for optimizing a search method for an assignment where I had to search a file for employees, I should be able to search by having any of the four filters or even none; I've imagined it ...
6
votes
2answers
1k views

DFS in a binary tree

Problem statement: Perform a depth first traversal on a BST and print the elements traversed. ...
2
votes
4answers
6k views

Searching for a specific object in an ArrayList [closed]

Is this an efficient way to search for a specific object in an ArrayList? Product is the superclasS. Mobo, CPU, RAM, GPU... are the subclasses. ArrayList(called stock) stores Product objects. I ...
3
votes
1answer
241 views

Knuth–Morris–Pratt string search algorithm

I finally think I've implemented the Knuth–Morris–Pratt string search algorithm correctly, now time for that lovely criticism that causes me to learn! The code doesn't look all that pretty however it ...
4
votes
1answer
152 views

Filling a string at minimal cost

I'm solving the following problem. Here is the problem statement: You are given a string with wildcards, e.g. X***Y*Z. Your goal is to print an input string ...
12
votes
5answers
773 views

Find all words that satisfy unknown letters (Hangman)

I have been working on a function which might be used to solve a word game like Hangman or "Wheel of Fortune". Basically, I wish to search from a very large ...
1
vote
1answer
606 views

Searching for column-indices of a multi-dimensional array that match multiple conditions (one condition per row)

I have written a script that I believe works and covers all edge-cases. I am curious about ways to improve upon speed. While the given example below covers a multi-dimensional array of ...
4
votes
1answer
346 views

Nearest Neighbor Algorithm (general nearest, forward-nearest, or backward-nearest)

I am trying to write an algorithm that can find user-specified nearest neighbors. By user-specified, I mean that the user can specify whether it's a general nearest neighbor, a forward-nearest ...
3
votes
2answers
302 views

C# A* Pathfinding implementation, focusing on reusability and efficiency

I wrote a C# A* pathfinding (Though, it's generic enough that it could be used for other search purposes) implementation. I started this when I found that existing implementations often didn't support ...
0
votes
3answers
68 views

Equals and Contains for text search

I am trying to implement a search routine for an application written in C#. The requirements are as follows: The user can select one of the following options for search: ...
2
votes
3answers
73 views

search for text across multiple tables

I've got the following query. ...
1
vote
2answers
95 views

Search a unique list and search a larger list to set dictionary with keys of binary values

I would like to search a list of unique values and create a dictionary with those unique values as keys, and a binary list for whether those values occur. I have successfully solved this, but would ...
0
votes
2answers
50 views

SQL Server Multi Term Wildcard Search on Multiple Fields with Ranking

I've built up this search query for searching airport locations on multiple fields, but I don't particularly like the way it works in practice. Even though it is fairly cool. I'll be reverting back to ...
2
votes
1answer
1k views

Filtering parent and children elements of list of dictionaries

I have a list of dictionaries and its elements has id and parent_id fields. Main purposes: If the parent_id field of an element is defined, it should be returning the rest of elements except itself. ...
2
votes
1answer
84 views

Which is the best approach for searching the dictionary items?

We can search for the list of dictionaries using the below some approaches, Can one please help me, which one is the memory efficient approach to use? Provided that: ...
3
votes
3answers
153 views

Case insensitive sub-string search

I found myself in a need of a function that checks whether a string is a sub-string of another string, in a case-insensitive manner. I found that there's no standard function to do this, so I wrote my ...
4
votes
1answer
119 views

QuickSearch for files and directories

I have a project where I need to search for directories and files. In fact I'm searching for paths in other projects. I don't want to just find files but I also want to exclude some directories or ...
2
votes
1answer
177 views

Searching for an object with spectific property, using user input

I have just started my adventure with C#. Below you can find a code written for my school assigment. The homework task had 3 major elements: building a class book creating a metod for changing the ...
3
votes
0answers
161 views

Search GitHub users when text field changes in Kotlin Android app

Problem: Search for users by their name using the GitHub API (sorted by the number of followers) and display the results in a RecyclerView. Implementation: Hitting the GitHub API every time when user ...
2
votes
2answers
85 views

A linear search implementation for any data type in C

I performed an "experiment" to test my understanding of pointers in C. I decided to write a linear search function that can work on any array provided there is an existing function to compare the ...
20
votes
2answers
3k views

Search a big (13 GB) Outlook PST file

I have an Outlook PST file of a pretty big size (13 GB). For some indexing purpose I needed to scan through the full PST file to get all the PR_SEARCH_KEY and then ...
7
votes
1answer
2k views

Approximate string search in Python

I have a long text (about 6,000,000 chars) and a short text (about 6,000 chars). The long text contains the short text, but not exactly - a small number of words are missing, abbreviated or just ...
3
votes
2answers
170 views

Variadic function to find the first matching (string) argument in a larger array

Playing around with parsing a data buffer I wrote a small search function to find the first complete match out of a set of (string) arguments. The (simplified) buffer class with the find function: <...
3
votes
2answers
300 views

Is given pattern a subString of given input string? KMP implementation

My implementation of Knuth Morris Pratt algorithm. Looking forward for code review comments. Let me know of there is a better way to implement this algorithm. ...
4
votes
1answer
363 views

Smalltalk (Squeak) - String parsing

I'm learning Smalltalk programming as I think its way ahead as an OOP programming tool. I would appreciate feedback regarding my coding of the following problem. I have a sequence of letters ...
3
votes
1answer
111 views

Multi search bar

This searches within three search engines. I would like if you could tell me any ways to make this better: ...
3
votes
1answer
92 views

Slow execution time of search algorithm

I have solved a problem of a game named 'Set'. The full problem is detailed on it's website: https://www.urionlinejudge.com.br/judge/en/problems/view/1090 However my code for the search algorithm is ...
7
votes
2answers
1k views

Find and rename all png files

I have such problem : find all png files to disk and rename them as I did: ...
5
votes
1answer
108 views

Selecting site to browse in python

This code is for part of my first major contribution to open-source, for the socli project. The purpose is to allow the user to select a site from the stack exchange network to browse and fill two ...