<div dir="ltr">Let me explain better my problem.<br><br>Originally the protocol states that the data that I should get is:<br>
<br>
<div class="line" id="LC4"> 1) "CONFIG"</div>
<div class="line" id="LC5"> 2) "SET"</div>
<div class="line" id="LC6"> 3) "slowlog-log-slower-than"</div>
<div class="line" id="LC7"> 4) "1"</div>
<br>Now I wrote a function that on linear time add each element to a dynamic array, <br>so the parsing itself also will be linear, and simple, rather then a complex one.<br><br>However, I found a command that return undocumented result of:<br>
<div class="highlight"><pre><div class="line" id="LC1">1) 1) (integer) 0</div><div class="line" id="LC2"> 2) (integer) 1328734844</div><div class="line" id="LC3"> 3) (integer) 14</div><div class="line" id="LC4"> 4) 1) "CONFIG"</div>
<div class="line" id="LC5"> 2) "SET"</div><div class="line" id="LC6"> 3) "slowlog-log-slower-than"</div><div class="line" id="LC7"> 4) "1"</div></pre></div><br>The most left 1), is a list containing inside another list. The second list have element of 4) that contain additional list of another 4 elements.<br>
I need to rewrite the original function to be able to store this information. I must save the exact order of things, and also save the hierarchy <br>that is displayed here. <br><br>I'm looking not only for an elegant solution (I can think on at least 3 ways), but also for an efficient way, and little as <br>
possible in memory consumption (I don't have idea how to do that), and if I can do it in O(n) or better, then it's perfect.<br><br>How would you recommend me to solve this ?<br><br>Thanks,<br>Ido<br><br><div class="gmail_quote">
On Wed, Feb 8, 2012 at 17:25, ik <span dir="ltr"><<a href="mailto:idokan@gmail.com">idokan@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Hello,<br><br>I need to rewrite the way I split data today, after I found out that the specs and the reality of the content are different things.<br>At the moment I'm using a dynamic array of single dimension to store each element of a list, however the actual data can arrive as a list inside a list.<br>
Can I use dynamic array that is defined like so:<br><br>Array of String <br><br>As Multi-dimension array, and if I can' how can I figure out how much dimension it has ?<br><br>If not, is there a non balanced tree class that I can use instead to store information instead ?<br>
<br>Thanks,<br>Ido<br>
</div>
</blockquote></div><br></div>