Click here to Skip to main content
15,498,622 members
Home / Discussions / Algorithms
   

Algorithms

 
QuestionCalculate time complexity step by step of given two program program Pin
Member 1151248623-Sep-20 1:22
MemberMember 1151248623-Sep-20 1:22 
AnswerRe: Calculate time complexity step by step of given two program program Pin
Richard MacCutchan23-Sep-20 4:34
mveRichard MacCutchan23-Sep-20 4:34 
AnswerRe: Calculate time complexity step by step of given two program program Pin
trønderen23-Sep-20 5:07
Membertrønderen23-Sep-20 5:07 
AnswerRe: Calculate time complexity step by step of given two program program Pin
Gerry Schmitz24-Sep-20 14:01
mveGerry Schmitz24-Sep-20 14:01 
QuestionRandom File & Folder Names Pin
Richard Andrew x6422-Sep-20 11:42
professionalRichard Andrew x6422-Sep-20 11:42 
AnswerRe: Random File & Folder Names Pin
Victor Nijegorodov22-Sep-20 11:56
MemberVictor Nijegorodov22-Sep-20 11:56 
GeneralRe: Random File & Folder Names Pin
Richard Andrew x6422-Sep-20 12:06
professionalRichard Andrew x6422-Sep-20 12:06 
QuestionHow can I calculate time complexity and compare between given two algorithms? Pin
Member 1151248618-Sep-20 19:12
MemberMember 1151248618-Sep-20 19:12 
I want to calculate the time complexity and show by the equation for both algorithms. Also, I need a comparison between the two algorithms to show which one is better and why. Could you please help with that? It would be beneficial for me and very much appreciable.

Algorithm-1
--------------------------
1.for 1 to m
   for 1 to n
	if (some condition)
      do something
	else
	  do something
   end for
  end for
2.for 1 to m
   for 1 to n
    do something
   end for
  end for
3.for 1 to m
	if (some condition)
      do something
  end for
4.do something
5.for 1 to m
   for 1 to m
    if (some condition)
      do something
   end for
  end for
6.for x to y
   for 1 to x
    if (some condition)
      do something
   end for
  end for

Algorithm-2
--------------------------
1.for 1 to m
   for 1 to n
	if (condition)
     do something
	else
	 do something
   end for
   if (condition)
    do something
  end for
2. do something
3.for 1 to m
   for 1 to m
    if (condition)
      do something
	  for 1 to x
	    if (condition)
		  do something
		  break
	  end for
	  if (condition)
		do something
   end for
  end for


Thanks, Advance
QuestionRe: How can I calculate time complexity and compare between given two algorithms? Pin
Richard MacCutchan18-Sep-20 22:42
mveRichard MacCutchan18-Sep-20 22:42 
AnswerRe: How can I calculate time complexity and compare between given two algorithms? Pin
Member 1151248619-Sep-20 1:45
MemberMember 1151248619-Sep-20 1:45 
AnswerRe: How can I calculate time complexity and compare between given two algorithms? Pin
trønderen19-Sep-20 3:43
Membertrønderen19-Sep-20 3:43 
GeneralRe: How can I calculate time complexity and compare between given two algorithms? Pin
Richard MacCutchan19-Sep-20 4:01
mveRichard MacCutchan19-Sep-20 4:01 
GeneralRe: How can I calculate time complexity and compare between given two algorithms? Pin
trønderen19-Sep-20 8:06
Membertrønderen19-Sep-20 8:06 
GeneralRe: How can I calculate time complexity and compare between given two algorithms? Pin
Richard MacCutchan19-Sep-20 22:05
mveRichard MacCutchan19-Sep-20 22:05 
AnswerRe: How can I calculate time complexity and compare between given two algorithms? Pin
Sandeep Mewara19-Sep-20 1:12
mveSandeep Mewara19-Sep-20 1:12 
GeneralRe: How can I calculate time complexity and compare between given two algorithms? Pin
Member 1151248619-Sep-20 1:55
MemberMember 1151248619-Sep-20 1:55 
GeneralRe: How can I calculate time complexity and compare between given two algorithms? Pin
Gerry Schmitz19-Sep-20 4:00
mveGerry Schmitz19-Sep-20 4:00 
GeneralRe: How can I calculate time complexity and compare between given two algorithms? Pin
trønderen19-Sep-20 8:03
Membertrønderen19-Sep-20 8:03 
GeneralRe: How can I calculate time complexity and compare between given two algorithms? Pin
Gerry Schmitz20-Sep-20 5:52
mveGerry Schmitz20-Sep-20 5:52 
QuestionMy implementation of Eratosthenes sieve is horribly slow. But why? Pin
Member 149328737-Sep-20 23:00
MemberMember 149328737-Sep-20 23:00 
AnswerRe: My implementation of Eratosthenes sieve is horribly slow. But why? Pin
Richard MacCutchan7-Sep-20 23:38
mveRichard MacCutchan7-Sep-20 23:38 
GeneralRe: My implementation of Eratosthenes sieve is horribly slow. But why? Pin
Richard Deeming8-Sep-20 0:59
mveRichard Deeming8-Sep-20 0:59 
AnswerRe: My implementation of Eratosthenes sieve is horribly slow. But why? Pin
Dave Kreskowiak8-Sep-20 7:46
mveDave Kreskowiak8-Sep-20 7:46 
GeneralRe: My implementation of Eratosthenes sieve is horribly slow. But why? Pin
Richard Andrew x6422-Sep-20 11:36
professionalRichard Andrew x6422-Sep-20 11:36 
GeneralRe: My implementation of Eratosthenes sieve is horribly slow. But why? Pin
Dave Kreskowiak22-Sep-20 17:25
mveDave Kreskowiak22-Sep-20 17:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.