Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can there be any simpler logic or more faster way

 
vanlalhmangaiha khiangte
Ranch Hand
Posts: 170
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

I create some program where i want to display all the combinations of String a,b,c,d.This strings can contain N number of items.



Pseudo Code:-
for i in 0 to a.length
for j in 0 to b.length
for k in 0 to c.length
for l in 0 to d.length
call input(a[i],b[j],c[k],d[l]);

Can there be any easier way to do this?
Is there any faster way than this?

Thanks in advance,
 
Bill Shirley
Ranch Hand
Posts: 457
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
that's as fast as it can go,

and you'll want 0 to length-1 on each of those,
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic