|
"greedy algorithm" - that's not even an algorithm, that's a whole class of algorithms, actually containing Prim's because it constructs the MST by growing it one edge at the time where that edge is the smallest edge that can be added. Having one option contain the other is, well, bad.
Topological order is just some order with some constraints on it, neither an algorithm nor a class of algorithms. Of course, there are algorithms that find a topological order, but they wouldn't be one. This shouldn't even be in the list.
Kosoraju is spelled Kosaraju.
4/10 bad question, you can tell your teacher I said so.
|
|
|
|
|
|
I have a very annoying problem ever since I started using Chrome. When I click on a link to open a new tab the screen flashes white or blinks in an annoying way slightly upsetting my eyes.
My ASP.NET project when run in Chrome browser shows this problem but using another browser such as Firefox or IE there is no problem.
How do you fix this problem?
|
|
|
|
|
ahasan nahid wrote: How do you fix this problem? You start by going to the correct forum[^] and posting there. You will also need to provide more information than this, to identify where the problem occurs in your code.
|
|
|
|
|
Hello I would like to ask a question about the following expressions, which I have to tell, whether they are true or false and why:
(1) n-2logn = Ω(n)
(2) n^2logn = Θ(n^2)
(3) 2n^2 + 4n - 17 = O(n^3)
(4) n^3 + 7n - 21 = Θ(n^2)
I would be really thankful is somebody could help. Thanks in advance.
|
|
|
|
|
Looks like just the sort of question for research.
|
|
|
|
|
I would say
True, False, False, False
But 3 and 4 are True if you swap the answers.
Patrice
“Everything should be made as simple as possible, but no simpler.” Albert Einstein
modified 4-Dec-15 18:59pm.
|
|
|
|
|
These are not algorithms, they are just expressions and have nothing to do with Algorithm running time.
|
|
|
|
|
Requirement: using recursion, size of array is an even number.
For example:
0 1 2 3 4 5 (order of index)
a b c d e f (array before arrange)
a c e b d f (array after arrange)
0.......1.......2......3.......4......5.......6......7 (order of index)
a1....b1....a2....b2....a3....b3....a4....b4 (array before arrange)
a1....a2....a3....a4....b1....b2....b3....b4 (array after arrange)
The problem looks easy to solve if we dont care about optimization, we can use temp array or use recursion combine with a loop to shift items ... I think this way is not best solution ....I try to use recursion combine with swap operation, without using loop ... but I fail.
Hope someone suggests me an idea to resolve the problem, thanks any help
modified 1-Dec-15 4:30am.
|
|
|
|
|
It is a fairly straghtforward matter of taking all the even numbered items (0, 2, 4 etc) first, followed by the odds.
|
|
|
|
|
can you show what you have done so far ?
Your request look like HomeWork !
Patrice
“Everything should be made as simple as possible, but no simpler.” Albert Einstein
modified 1-Dec-15 16:51pm.
|
|
|
|
|
I have been developer for 5 years, I am not a student, so it's not homework ...
|
|
|
|
|
Hồng Chấn Phát wrote: I have been developer for 5 years, I am not a student, so it's not homework ... Can you show what you have done ?
Patrice
“Everything should be made as simple as possible, but no simpler.” Albert Einstein
|
|
|
|
|
I don't know if there is a general solution, but using swaps I have come up with:
N = 2 requires 0 swaps (obviously)
N = 4 requires 1 swap
N = 6 requires 3 swaps
N = 4 requires 4 swaps
N = 10 requires 6 swaps
...
Basically, moving the N/2 first elements of the pairs to the beginning requires N/2-1 swaps. The N/2 second elements are "nearly" in order, requiring only a few additional swaps.
If you have an important point to make, don't try to be subtle or clever. Use a pile driver. Hit the point once. Then come back and hit it again. Then hit it a third time - a tremendous whack.
--Winston Churchill
|
|
|
|
|
using System.Linq;
private int[] ints = new int[]{0,1,2,3,4,5,6,7,8,9,10};
int[] sints = ints.Where(val => (val%2 == 0)).Concat(ints.Where(val => (val%2 == 1))).ToArray(); I'm not claiming that is optimal in terms of speed of code execution; but it's faster in terms of my valuable time writing code !
If I could not use Linq:
private string[] strs = new string[]{"a1","b1","a2","b2","a3","b3","a4","b4"};
private string firstOddValue = strs[1];
List<string> strList = new List<string>{strs[0]};
for (int i = 1; i < strs.Length; i++)
{
if (i%2 == 1)
{
strList.Add(strs[i]);
}
else
{
strList.Insert(strList.IndexOf(firstOddValue), strs[i]);
}
}
«I want to stay as close to the edge as I can without going over. Out on the edge you see all kinds of things you can't see from the center» Kurt Vonnegut.
|
|
|
|
|
Hi
I have a dataset and I want to perform Association Rules on it.
In other for it to predict accurately, the algorithm should have the ability to look at each attribute and decipher their association which mostly is a result of activities between each attribute in the form of multiplication, addition, subtraction, re-appearance of common patterns etc
Common association algorithms follow a basic pattern deciphering method...'comparing the re-occurrence of item sets'....
The association algorithm I have in mind should have a dynamic god capability....it should be able to determine the relationship between the attributes by going deeper such as finding out if the multiplication of the data 'value' of an instance in one attribute with another data value of an instance in another attribute has a higher rate of predictive accuracy....my workflow is in WEKA and so a compatible algorithm is needed.
I will love to interact with any coder who believes such a task can be accomplished.
cheers
|
|
|
|
|
Have you done something or it is just an idea ?
Patrice
“Everything should be made as simple as possible, but no simpler.” Albert Einstein
|
|
|
|
|
Its an idea for mining out patterns that is evident in football data.
|
|
|
|
|
Its an idea for mining out patterns that is evident in football data.
|
|
|
|
|
Its an idea for mining out patterns that is evident in football data.
|
|
|
|
|
How do I solve the recurrence T(n) = T (n - 1) + c substitution method?
|
|
|
|
|
Looks like a partial definition of a linear suite.
What do you want to solve ?
Patrice
“Everything should be made as simple as possible, but no simpler.” Albert Einstein
|
|
|
|
|
I have thought of an algorithm that would really aide the work I am doing but cannot think of a name for it to search if there is an online algorithm created for it that I could use.
Algorithm example + explanation: For the work I am doing I have lots of different amounts of money and a total figure. I know that the sum of some of these amounts will equal the total figure but I have no clue which amounts they are and am not too sure how many of these figures would reach the total. I would input the amounts of money and the total figure and the algorithm would have to evaluate every single combination of these amounts of money until it reached the total amount and would output which amounts of money were used to create that total.
I am not asking anyone to create this algorithm I am just asking whether there is a website with this algorithm on it that I could use or if this algorithm is really easy to create + therefore I could create it for myself.
Any comments would be helpful + please ask if you have any queries for clarity! Many thanks!
|
|
|
|
|
this is the "coin change problem".
but, it's not an exceptionally hard problem. and it's probably worth trying to think it through on your own.
|
|
|
|
|
You have a set of data, and you search which subset will match a criteria.
This is a classical problem, I am not sure there is a name to this problem, or as mentioned in previous answer, it is related to the coin change problem.
Patrice
“Everything should be made as simple as possible, but no simpler.” Albert Einstein
|
|
|
|