|
Andrew Rissing wrote: I would assume the best way, is the following.
This is a way, it may not be the best way. The reason is that it there is no guarantee that it will work. When you find a clash you make a decision as to what swap to make to resolve it. There are probably many ways to resolve each clash - you choose one. If you make the wrong choice your algorithm may get stuck (i.e you end up with a clash that you cannot resolve - all the elements you have left to swap with clash as well) - there is no way of backtracking in your algorithm to change those earlier choices. If you include backtracking to try all the choices you can make - then you have a simple exhaustive search.
Peter
"Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."
|
|
|
|
|
Ah, this should be easy.
Assume you have list1 fully filled.
list2 = new list<char>();
for (int i = 1; i < list1.size(); i++)
{
list2.push_back(list1.at(i));
}
list2.push_back(list1.at(0);
</char>
Basically, you're shifting indices by one, and keep doing it for every index. The theoretical maximum number of lists you can make is the size of the initial list, since you can only shift indices that much before they repeat again (informal proof). I can demonstrate this more formally, but I won't write it here.
|
|
|
|
|
hi!
i have a question. that is we have ha a problem "which one is smaller n pow 2, 1000 pow n, n pow n, n pow 1000 , when n value is nearer to infinite" plz also give reason along with answer
Best Regards,
Huma Satti
|
|
|
|
|
Exponential functions are larger then powers of a number when n is nearer infinity
Giorgi Dalakishvili
#region signature
my articles
#endregion
|
|
|
|
|
He's not comparing exponential functions.
|
|
|
|
|
|
Try looking at the logarithms of these values and comparing them. You should easily see the answer.
|
|
|
|
|
THNX ALOT 4 UR HELP SO NICE OV U
|
|
|
|
|
I assume you mean the derivatives? Once upon a time I learned about something that I recall as l'Hôpital's rule[^]. On the other hand, I have no clue what the hell the derivation of n log n is. Do you think Ilidiot knows?
--
Kein Mitleid Für Die Mehrheit
|
|
|
|
|
My guess is
n pow 2
your task is to proof it (by induction?)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
SO NICE OV U THNX ALOT OV UR HELP
|
|
|
|
|
huma satti wrote: when n value is nearer to infinite
Is n interger? real number? complex number? What interval are we talking about? Positive or negative infinity? I'd give it back to teacher and say that (s)he formulated the problem too vaguely :P
[ My Blog] "Visual studio desperately needs some performance improvements. It is sometimes almost as slow as eclipse." - Rüdiger Klaehn "Real men use mspaint for writing code and notepad for designing graphics." - Anna-Jayne Metcalfe
|
|
|
|
|
huma satti wrote: when n value is nearer to infinite
(just for the sake of argumentation, I'm pretty certain there are some mathematical proof of each ...)
Does it really make a difference when n is near infinity ? the results will be infinity anyway.
|
|
|
|
|
Maximilien wrote: Does it really make a difference when n is near infinity ? the results will be infinity anyway.
I think the question is about the asymptotic properties of the various quantities. In a practical sense the exercise is useful for comparing orders of algorithms. Aside from that, if n is infinity then you can't compare them, no. "Close to infinity" just means "very large but not infinity".
|
|
|
|
|
Hi,
I have a laplace function:
<br />
30/(3+s)^2<br />
I am trying to find the inverse of it.
I know the answer from (MATLAB) is
<br />
30*exp(-3*t)*t<br />
Could anyone lend a hand on getting from A to B on this one?
I know that to get the answer above, the original equation must be re-arranged to be:
<br />
30/(s+3)*(1/s^2) <- this is wrong :-(.<br />
<br />
where:<br />
<br />
30/(s+3) transforms to 30*exp(-3*t)<br />
(1/s^2) transforms to t<br />
Any help would be appreciated.
Cheers,
modified on Sunday, May 4, 2008 3:11 AM
|
|
|
|
|
Isn't this just the nth power with frequency shift transform?
i.e: 1/(s+a)^(n+1)
In this case, a=3 and n = 1
the transform is t^n/n! * exp(-at) so with a = 3 and n = 1:
t^1/1! * exp(-3t)
=texp(-3t)
Since 30 is a constant it doesn't affect the transform and we just put it back in:
30*t*exp(-3t)
This is just an application of the shifting theorem:
For an arbitrary constant a > 0
L{exp(-at)f(t)} = F(s+a)
|
|
|
|
|
Yea it was the 1st shifting theorom. (like you said above).
Cheers,
|
|
|
|
|
Meh, Freud would laugh at me..
I read "Need help inverting a LAPDANCE function"
|
|
|
|
|
haha, math would be bigger than sport if that was the way of things
|
|
|
|
|
How can i make good s-box easily (against linear and differential attacks)? If i used prepaid one that may belongs to someone or standard ciphers then it would be plagiarism right? So i need to make own s-box (8 bit input, 8 bit output (16x16)). Please Please suggest me any way to decide it.
Thank you.
|
|
|
|
|
Bimbaa wrote: How can i make good s-box easily (against linear and differential attacks)?
I think that's a rather non-trivial exercise.
Bimbaa wrote: If i used prepaid one that may belongs to someone or standard ciphers then it would be plagiarism right?
Plagiarism? In what sense? Is this a homework assignment? If so, then simply copying and pasting an s-box implementation would be plagiarism, yes. If it's for personal use, I don't think it would be plagiarism if referenced accordingly.
This[^] could be of use to you.
|
|
|
|
|
WELL I HOPE ALL USERS ARE IN GOOD SPIRITS...FOR TOMORROW IS A FRIDAY AND RELIEF TO A WEEK.
I'M A FRIENDLY NEWBIE POWERUSER WITH AN OPEN MIND AND WEAK HEART.
I have a project for c++ and I need help for the first time. Source CODE IN C++
the word problem:
the department of motor vehicles administers a written driver's exam consisting of 20 multiple choice questions. an applicant for the drivers license exam answers these questions electronically and the answers are stored in a file named xxxxyyy.dat (where xxxx are the last four digits of the ID number, and the yyy are the first three letters of their last name) in other words, each applicants file will be uniquely named. the file containing the correct answers to questions is named ANSWERS.DAT
write a program that will read the contents of the ANSWERS.DAT file into an array (with the size of 20). program should read the applicants answer file into a second array (also 20) the logic of the program should the 'check' the applicants answer to a question and compare it to the 'correct' answer. the program should keep a tally of the number of questions correctly answerd, and the tally of incorrect answers. Finally the program should cout whether or not the applicant 'passed' or 'failed' the exam. they must answer at least 15 questions correctly to pass. program should indicate "PASS" or "FAIL" along with the number of INCORRECT and CORRECT.
following layout for program centered:
Department of Motor Vehicles
Driver's Exam
answered 99 questions correctly.
answered 99 questions incorrectly.
results for this portion of exam: XXXX
AND THATS ALL ALSO FOR AN EXAMPLE .DAT FILE '1278BOB.DAT' AND MULTIPLE CHOICE a,b,c,d
|
|
|
|
|
See this[^] thread - we covered it all there.
Peter
"Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."
|
|
|
|
|
See here [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
It's the weekend and the lazy assed homework seekers have started coming out of the woodwork.
Doing my part to piss off the religious right.
|
|
|
|