FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Unique array of arrays - how can I do this?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Unique array of arrays - how can I do this? [message #181315 is a reply to message #181308] Sun, 05 May 2013 22:06 Go to previous message
Thomas 'PointedEars'  is currently offline  Thomas 'PointedEars'
Messages: 701
Registered: October 2010
Karma:
Senior Member
thomas(dot)lehmann(dot)private(at)googlemail(dot)com wrote:

> While calculation I get a solution as an array of integers.
> There're many solutions and I would like to keep them in an array.
>
> Because of the algorithm there are different paths to get to
> the same solution but I want to have it once only.
>
> I know that I can use array_unique but that's too slow
> when called too often. I can't wait until end of calculation
> because then I run into memory problems.
>
> So I need an efficient way to add elements once only to
> an array while calculation with an array as element.
>
> How can I do this?

You need to be more specific about your problem. What is the calculation?
What kind of integers are in one array? How do you add them? How many
integers? How many arrays of integers in your array?

And please get a real name. That said, avoid Google Groups for posting; use
a newsreader instead.

<http://www.catb.org/~esr/faqs/smart-questions.html>


PointedEars
--
> If you get a bunch of authors […] that state the same "best practices"
> in any programming language, then you can bet who is wrong or right...
Not with javascript. Nonsense propagates like wildfire in this field.
-- Richard Cornford, comp.lang.javascript, 2011-11-14
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: replacing spaces with newline
Next Topic: changing video source from youtube to my site
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed Nov 27 23:02:53 GMT 2024

Total time taken to generate the page: 0.04548 seconds