Skip to main content

Questions tagged [searching]

0 votes
6 answers
404 views

I'm doing a search problem over 18-tuples of non-negative integers. Some tuples are GOOD and some tuples are BAD, and I'm trying to list all of the GOOD tuples exactly once. It turns out that if a ...
user326210's user avatar
1 vote
0 answers
121 views

Classic searching algorithms such as binary searching and dictionary searching search sorted arrays based on a given element and make estimations on their own. What I'm looking for is a list of more ...
requiemman's user avatar
0 votes
1 answer
197 views

Given an array unsorted P of integers and a number m. I am trying to write a code that returns indices ...
five_star_021's user avatar
0 votes
0 answers
48 views

The object I am studying is a bit more complicated than a bidimensional function, but I think I can explain what I need better with a simplified example. I can provide more details if asked. So ...
Filipe Miguel's user avatar
1 vote
1 answer
263 views

Let's have a static function f(n) which for a given n returns only these answers "lower" or "higher" comparing against an imaginary number x In a sorted list ...
nehem's user avatar
  • 111
0 votes
1 answer
237 views

I confused about the description & definition of "key" occuring as terminology for databases and b-trees. In first case dealing with theory of databases a key is defined as a choice for ...
user267839's user avatar
0 votes
2 answers
1k views

You are given an infinite chessboard, a knight, a source and a destination.(Normal chess rules apply) we are required to get move knight from source to destination in minimum moves possible. I can ...
Aditya Powale's user avatar
4 votes
1 answer
1k views

Both randomized and normal binary search takes O(log n) time complexity but why does the randomized version exist? In other words what is the advantage of randomized binary search even if it has same ...
mahesh 2222's user avatar
1 vote
0 answers
78 views

I am searching for a data structure that can capture a database, which is consisted of one column of intervals (like [0, 2], [4, 6]) and one/two columns of keys (...
ysig's user avatar
  • 11
1 vote
1 answer
2k views

I've seen correctness proofs for other searching algorithms; however, for this particular algorithm: search in a row-wise and column wise sorted matrix, I'm not able to generate a proper proof. ...
user avatar
3 votes
5 answers
6k views

There are tones of solutions for Knights tour or shortest path for Knights movement from source cell to destination cell. most of the solutions are using BFS which seems the best algorithm. Here is ...
Amir-Mousavi's user avatar
1 vote
2 answers
418 views

I have been puzzling over an algorithm that decides whether a sorted array of numbers contains two numbers that differ by k. I do not intuitively understand why ...
Jon Deaton's user avatar
3 votes
1 answer
2k views

I know that for an array of size n distinct elements, the Average Case complexity for linear search is as follows: A(n) = $\frac{n + 1}{2}$ However, I am having trouble coming up with the Average ...
M. Twain's user avatar
1 vote
1 answer
2k views

The Answer here shows a way to solve the problem with O(1) space. The approach uses Binary Search. I am finding really hard to wrap my head around why it works. I get why we did low + (high-low)/2 ...
AAB's user avatar
  • 119
0 votes
1 answer
1k views

The following graph has consistent heuristic. An A* algorithm will alter its first guess ACD to the correct shortest path ABD... if it has consistent heuristic, doesnt it mean, that AB should be found ...
toto8080's user avatar

15 30 50 per page
1
2 3 4 5 6