What is the most efficient wildcard string matching algorithm? I am asking only about an idea, it is not necessary to provide actual code.
I'm thinking that such algorithm can be built with sorted suffix arrays, which can yield performance of O(log(n)).
Am I correct?
Edited:
I mean patterns like "A*B", "*sip*" or "A?B" where star mea...
I'm creating a word search and am trying to calculate quality of the generated puzzles by verifying the word set is "distributed evenly" throughout the grid. For example placing each word consecutively, filling them up row-wise is not particularly interesting because there will be clusters and the user will quickly notice a pattern.
...
This is a homework question. I'm not expecting an answer, just some guidance, possibly :) I am to show that log(n!) = Θ(n·log(n)).
A hint was given that I should show the upper bound with nn and show the lower bound with (n/2)(n/2). This does not seem all that intuitive to me. Why would that be the case? I can definitely see how to...
Is there any package/software which can do Meshing of Point Clouds in real time?
What is the data structure used to represent 3D Point Clouds ?
...
Hi all,
I've got a classification system, which I will unfortunately need to be vague about for work reasons. Say we have 5 features to consider, it is basically a set of rules:
A B C D E Result
1 2 b 5 3 X
1 2 c 5 4 X
1 2 e 5 2 X
We take a subject and get its values for A-E, then try matching the rules in sequenc...
I have some code to count permutations and combinations, and I'm trying to make it work better for large numbers.
I've found a better algorithm for permutations that avoids large intermediate results, but I still think I can do better for combinations.
So far, I've put in a special case to reflect the symmetry of nCr, but I'd still lik...
I'm trying to apply the simplified algorithm in Prolog, but I'm not a Prolog master. I need it without any mistakes, so I thought you guys might be able to help.
What is the implementation of DPLL algorithm in Prolog?
...
Given that I have m non-empty distinct sets (labeled Z[ 1 ], Z[ 2 ], ..., Z[ m ]), I aim to compute the sum of all possible subsets where there is exactly one element from each set. The size of each subset is defined to be the product of its members. For example:
Z[ 1 ] = {1,2,3}
Z[ 2 ] = {4,5}
Z[ 3 ] = {7,8}
Should result in:
1*4...
I need to find all sub-arrays which share any mutual element and merge them into one sub-array.
(Implementing in Python but any algorithmic idea would be helpful)
Multidimensional array structure:
categories = {'car':['automobile','auto'],
'bike':['vehicle','motorcycle','motorbike','automobile'],
'software':[...
I have found a way that improves (as far as I have tested) upon the quicksort algorithm beyond what has already been done. I am working on testing it and then I want to get the word out about it. However, I would appreciate some help with some things. So here are my questions. All of my code is in C++ by the way.
One of the sorts I ha...
I want to design an algorithm for allocating and freeing memory pages and page tables. What data structures would allow best performance and simplest implementation?
...
I have created a "blob" from Bezier curves (screenshot below) and would now like to shade it in such a way that it appears pseudo-3D, with darker shading on all "left" edges and lighter on all "right" edges, and perhaps pure white "light spots" on the surface itself. For example: I'd be interested in how to achieve the shading used in t...
Pardon me if this has been asked/answered before...my searches did not bring it up.
I have a collection of 2D co-ordinate sets (on the scale of a 100K-500K points in each set) and I am looking for the most efficient way to measure the similarity of 1 set to the other. I know of the usuals: Cosine, Jaccard/Tanimoto etc. However hoping f...
Set up(MySQL):
create table inRelation(
party1 integer unsigned NOT NULL,
party2 integer unsigned NOT NULL,
unique (party1,party2)
);
insert into inRelation(party1,party2) values(1,2),(1,3),(2,3),(1,4),(2,5),(3,5),(1,6),(1,7),(2,7),(5,7);
mysql> select * from inRelation a
-> join inRelation b on a.party2=b.party1
-...
I'm looking for a proper implementation of a work stealing queue in C/CPP. I've looked around Google but haven't found anything useful.
Perhaps someone is familiar with a good open-source implementation? (I prefer not to implement the pseudo-code taken from the original academic papers).
...
I found an interesting pairs matching game at http://xepthu.uhm.vn. The rule is simple, you have to find and connect two identical pokemon but the path between them is not blocked and the direction can't not be changed 3 times. Let's see an example:
I've think alot about the algorithm to check if the path between any 2 selected pokemo...
Is there anyway to ensure the that the fewest number of turns heuristic is met by anything except a breadth first search? Perhaps some more explanation would help.
I have a random graph, much like this:
0 1 1 1 2
3 4 5 6 7
9 a 5 b c
9 d e f f
9 9 g h i
Starting in the top left corner, I need to know the fewest number of steps it wou...
Each node of the tree might have an arbitrary number of children.
I need a way to construct and traverse such trees, but to implement them using one dimensional vector or a list.
...
We are building a sports application and would like to incorporate team colors in various portions of the app.
Now each team can be represented using several different colors.
What I would like to do is to perform a check to verify whether the two team colors are within a certain range of each other, so that I do not display two si...
The requirements of this are somewhat restrictive because of the machinery this will eventually be implemented on (a GPU).
I have an unsigned integer, and I am trying to extract each individual digit.
If I were doing this in C++ on normal hardware & performance weren't a major issue, I might do it like this:
(Don't hate on me for this...