<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Mini Coding Challenge - Binary Search (sort of) in BreakPoint</title>
    <link>https://ni.lithium.com/t5/BreakPoint/Mini-Coding-Challenge-Binary-Search-sort-of/m-p/3862057#M31029</link>
    <description>&lt;P&gt;My implementation (LV2018) is very similar to CA's except I used an enum to track progress.&lt;/P&gt;</description>
    <pubDate>Tue, 13 Nov 2018 23:33:27 GMT</pubDate>
    <dc:creator>GregSands</dc:creator>
    <dc:date>2018-11-13T23:33:27Z</dc:date>
    <item>
      <title>Mini Coding Challenge - Binary Search (sort of)</title>
      <link>https://ni.lithium.com/t5/BreakPoint/Mini-Coding-Challenge-Binary-Search-sort-of/m-p/3861555#M31006</link>
      <description>&lt;P&gt;I have a large cluster array. Many millions of elements. There is a field in the cluster that is a number. That number could be 0, 1, 2, 3, or 4. This value is &lt;U&gt;guaranteed to be in ascending order&lt;/U&gt; throughout the entire cluster array. So here are some possible values for that field for the entire array:&lt;/P&gt;
&lt;P&gt;0, 0, 0, ... 0&lt;/P&gt;
&lt;P&gt;4, 4, 4, ... 4&lt;/P&gt;
&lt;P&gt;1, 1, ... 1, 2, 2, 4, 4, ... 4&lt;/P&gt;
&lt;P&gt;0, 1, 2, 3, 4 ... 4&lt;/P&gt;
&lt;P&gt;0, 0, 0, ... 1, 1, 1... 2, 2, 2... 3, 3, 3... 4, 4, 4&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;1, 1, 1, ... 2, 2, 2, ... 3, 3, 3, ... 4, 4, 4&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to look for the scenario that is&amp;nbsp;&lt;STRONG&gt;bolded&lt;/STRONG&gt; above...in other words, I want to know if the values for that numeric field in that array start at 1, at some point transition to 2, at some point transition to 3, then at some point transition to 4. The number of times each value occurs between those transitions does not matter. Some restrictions I have:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;No brute forcing the array...&lt;U&gt;I need to iterate as few times as possible&lt;/U&gt;.&lt;/LI&gt;
&lt;LI&gt;No parallel For Loop.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's easy to check if the first cluster element is '1' and the last one is '4', but once I get that far, I'm getting wrapped around the axle with a binary search that goes in two directions looking for two values. I've got something that sorta works but I bet y'all can come up with something better. Best solution wins a high five from me and a shout-out in whatever NIWeek presentation(s) I give in 2019.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Nov 2018 04:22:40 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/BreakPoint/Mini-Coding-Challenge-Binary-Search-sort-of/m-p/3861555#M31006</guid>
      <dc:creator>Darren</dc:creator>
      <dc:date>2018-11-13T04:22:40Z</dc:date>
    </item>
    <item>
      <title>Re: Mini Coding Challenge - Binary Search (sort of)</title>
      <link>https://ni.lithium.com/t5/BreakPoint/Mini-Coding-Challenge-Binary-Search-sort-of/m-p/3861616#M31008</link>
      <description>&lt;P&gt;Would this be too slow ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Example.png" style="width: 358px;"&gt;&lt;img src="https://ip1.i.lithium.com/d3cc3d61d06a24957c57c3216ab133ce660838df/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f32333734333269463839453836343337323130463944312f696d6167652d73697a652f6c617267653f763d76322670783d393939" role="button" title="Example.png" alt="Example.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Nov 2018 08:15:22 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/BreakPoint/Mini-Coding-Challenge-Binary-Search-sort-of/m-p/3861616#M31008</guid>
      <dc:creator>JB</dc:creator>
      <dc:date>2018-11-13T08:15:22Z</dc:date>
    </item>
    <item>
      <title>Re: Mini Coding Challenge - Binary Search (sort of)</title>
      <link>https://ni.lithium.com/t5/BreakPoint/Mini-Coding-Challenge-Binary-Search-sort-of/m-p/3861645#M31009</link>
      <description>&lt;P&gt;It would help if you could define the problem in LabVIEW terms, e.g. by attaching a simplified VI that contains the correct datatype.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I understand this correctly, the array element of a 1D array&amp;nbsp;is a cluster of many completely uninteresting elements of any datatype, but one cluster element is a numeric (U8? I32?) that is guaranteed to only contain one of five values (0..4) AND is guaranteed to be in nondescending order and that's the only one we are looking at. (You say "guaranteed to be ascending" but your examples claim otherwise)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The result for any given input array is a boolean, either PASS (containing only 1, 2, 3, 4) of FAIL (otherwise). You already suggested an algorithm that checks the first and last for the correct values (1, 3, resp) and then &lt;U&gt;only needs to prove that 2 and 3 also exist&lt;/U&gt;. I think you can do a single binary search for "2" OR "3" and once you find one &lt;EM&gt;(stop now and return FAIL if none are found, of course!)&lt;/EM&gt;, do a second binary search for the other (= not yet found) value on the remaining range above or below it, depending on what you found (i.e. if you found a 2, search above for 3, if you found a 3, search below for 2, re-using and readjusting the bounds already established). If the second value is not found, return FAIL, else it's a PASS as soon as you find one of them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(Just thinking out loud, need to go to sleep now :D)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Nov 2018 09:13:21 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/BreakPoint/Mini-Coding-Challenge-Binary-Search-sort-of/m-p/3861645#M31009</guid>
      <dc:creator>altenbach</dc:creator>
      <dc:date>2018-11-13T09:13:21Z</dc:date>
    </item>
    <item>
      <title>Re: Mini Coding Challenge - Binary Search (sort of)</title>
      <link>https://ni.lithium.com/t5/BreakPoint/Mini-Coding-Challenge-Binary-Search-sort-of/m-p/3861682#M31010</link>
      <description>&lt;P&gt;According to Altenbach's post, I didn't fullly understand the task. I thought that it&amp;nbsp;is needed to know the indexes of the transitions. Furthemore&amp;nbsp;the code is really not optimized and&amp;nbsp;does nothing more than this&amp;nbsp;:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Example2.png" style="width: 327px;"&gt;&lt;img src="https://ip1.i.lithium.com/92d0c692869b90d4eb60d8ffadddfb05504d0e5e/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f32333734343969393643414631453743303443383445372f696d6167652d73697a652f6c617267653f763d76322670783d393939" role="button" title="Example2.png" alt="Example2.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Result is OK if all values&amp;nbsp;(1 to 4) exist&amp;nbsp;in the array. Is this correct ?&lt;/P&gt;
&lt;P&gt;If so, because the values are ordered :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;- first element must be 1 and last 4&lt;/P&gt;
&lt;P&gt;&amp;nbsp;-&amp;nbsp;check if 2 and 3 exist by the use of Search 1D Array&lt;/P&gt;
&lt;P&gt;Would this be an acceptable solution ? This is so&amp;nbsp;&lt;SPAN&gt;simple that I'm afraid to miss something obvious.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Nov 2018 10:40:45 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/BreakPoint/Mini-Coding-Challenge-Binary-Search-sort-of/m-p/3861682#M31010</guid>
      <dc:creator>JB</dc:creator>
      <dc:date>2018-11-13T10:40:45Z</dc:date>
    </item>
    <item>
      <title>Re: Mini Coding Challenge - Binary Search (sort of)</title>
      <link>https://ni.lithium.com/t5/BreakPoint/Mini-Coding-Challenge-Binary-Search-sort-of/m-p/3861869#M31015</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/7614"&gt;@altenbach&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;It would help if you could define the problem in LabVIEW terms...&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I thought I did. &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; Big array of clusters, one field is a number, values are in ascending order, tell me if those values transition between 1, 2, 3, and 4.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/7614"&gt;@altenbach&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;(You say "guaranteed to be ascending" but your examples claim otherwise)&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Which example is an exception? All of them have values in ascending order. Some only have one value. Some have values ascending but skip something.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/7614"&gt;@altenbach&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The result for any given input array is a boolean, either PASS (containing only 1, 2, 3, 4) of FAIL (otherwise). You already suggested an algorithm that checks the first and last for the correct values (1, 3, resp) and then &lt;U&gt;only needs to prove that 2 and 3 also exist&lt;/U&gt;. I think you can do a single binary search for "2" OR "3" and once you find one &lt;EM&gt;(stop now and return FAIL if none are found, of course!)&lt;/EM&gt;, do a second binary search for the other (= not yet found) value on the remaining range above or below it, depending on what you found (i.e. if you found a 2, search above for 3, if you found a 3, search below for 2, re-using and readjusting the bounds already established). If the second value is not found, return FAIL, else it's a PASS as soon as you find one of them.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Yup, that's what I need to do. And that's pretty much what I have right now. But this approach requires two passes. I was hoping somebody more clever than me could figure out a way to do it in one pass.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Nov 2018 16:27:08 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/BreakPoint/Mini-Coding-Challenge-Binary-Search-sort-of/m-p/3861869#M31015</guid>
      <dc:creator>Darren</dc:creator>
      <dc:date>2018-11-13T16:27:08Z</dc:date>
    </item>
    <item>
      <title>Re: Mini Coding Challenge - Binary Search (sort of)</title>
      <link>https://ni.lithium.com/t5/BreakPoint/Mini-Coding-Challenge-Binary-Search-sort-of/m-p/3861879#M31017</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/9546"&gt;@Darren&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Which example is an exception? All of them have values in ascending order. Some only have one value. Some have values ascending but skip something.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;In all your example the value sometimes stays the same between adjacent elements, i.e. is &lt;U&gt;not ascending&lt;/U&gt; but still nondescending. &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt; The "ascending" condition is not met. (&lt;A href="https://math.stackexchange.com/questions/1123292/why-do-some-authors-use-terms-non-ascending-and-non-descending-instead-of-as" target="_blank"&gt;see also&lt;/A&gt;). Your sentence probably would have worked better after including&amp;nbsp;one word&amp;nbsp;as in "... these values are guaranteed to be &lt;STRONG&gt;&lt;U&gt;sorted&lt;/U&gt;&lt;/STRONG&gt; in ascending order ...".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/9546"&gt;@Darren&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;Yup, that's what I need to do. And that's pretty much what I have right now. But this approach requires two passes. I was hoping somebody more clever than me could figure out a way to do it in one pass.&lt;/BLOCKQUOTE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;It really is only one pass, because the ranges are not overlapping. The second search is entirely in a region that has not been looked at before. We just need&amp;nbsp; to slightly switch logic as a function of what has been found so far. The quickly shrinking search boundaries continue to shrink, only the logic is swapped. At most, we need to inspect log2(N) elements, .i.e. about 24 for an array with 16M elements. That's peanuts. &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Nov 2018 16:54:02 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/BreakPoint/Mini-Coding-Challenge-Binary-Search-sort-of/m-p/3861879#M31017</guid>
      <dc:creator>altenbach</dc:creator>
      <dc:date>2018-11-13T16:54:02Z</dc:date>
    </item>
    <item>
      <title>Re: Mini Coding Challenge - Binary Search (sort of)</title>
      <link>https://ni.lithium.com/t5/BreakPoint/Mini-Coding-Challenge-Binary-Search-sort-of/m-p/3861898#M31018</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Example3.png" style="width: 330px;"&gt;&lt;img src="https://ip1.i.lithium.com/938975c26050ff6c2f8f56d39dd7e38004d56133/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f32333734363769374638393136434542413641363030362f696d6167652d73697a652f6c617267653f763d76322670783d393939" role="button" title="Example3.png" alt="Example3.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Doesn't this meet your requirements ? Is it not efficient enough ?&lt;/P&gt;
&lt;P&gt;I didn't make a benchmark to check if it would be faster to start the search of 3 at the index of 2.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Nov 2018 17:13:22 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/BreakPoint/Mini-Coding-Challenge-Binary-Search-sort-of/m-p/3861898#M31018</guid>
      <dc:creator>JB</dc:creator>
      <dc:date>2018-11-13T17:13:22Z</dc:date>
    </item>
    <item>
      <title>Re: Mini Coding Challenge - Binary Search (sort of)</title>
      <link>https://ni.lithium.com/t5/BreakPoint/Mini-Coding-Challenge-Binary-Search-sort-of/m-p/3861905#M31019</link>
      <description>&lt;P&gt;On my quite old machine,&amp;nbsp;check if sorted disabled&amp;nbsp;: 5ms for an array with 10M values and 47ms with 100M.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Nov 2018 17:26:04 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/BreakPoint/Mini-Coding-Challenge-Binary-Search-sort-of/m-p/3861905#M31019</guid>
      <dc:creator>JB</dc:creator>
      <dc:date>2018-11-13T17:26:04Z</dc:date>
    </item>
    <item>
      <title>Re: Mini Coding Challenge - Binary Search (sort of)</title>
      <link>https://ni.lithium.com/t5/BreakPoint/Mini-Coding-Challenge-Binary-Search-sort-of/m-p/3861921#M31020</link>
      <description>&lt;P&gt;@JB I like it.&amp;nbsp; You could use the delete from array to get the last element, at one point that was more efficient.&amp;nbsp; Also&amp;nbsp;I think an improvement could be to start the 2 Search at index 1, and start the 3 search at the index 2 was found +1, but only if 1 and 2 were found properly.&amp;nbsp; If they aren't then we don't need to search for 3.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Example_VI_BD.png" style="width: 662px;"&gt;&lt;img src="https://ip1.i.lithium.com/66d37369b0843834a542ff4728c30049f2b68986/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f32333734363869313043454645323730414436314237452f696d6167652d73697a652f6c617267653f763d76322670783d393939" role="button" title="Example_VI_BD.png" alt="Example_VI_BD.png" /&gt;&lt;/span&gt;_&lt;/P&gt;</description>
      <pubDate>Tue, 13 Nov 2018 17:52:49 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/BreakPoint/Mini-Coding-Challenge-Binary-Search-sort-of/m-p/3861921#M31020</guid>
      <dc:creator>Hooovahh</dc:creator>
      <dc:date>2018-11-13T17:52:49Z</dc:date>
    </item>
    <item>
      <title>Re: Mini Coding Challenge - Binary Search (sort of)</title>
      <link>https://ni.lithium.com/t5/BreakPoint/Mini-Coding-Challenge-Binary-Search-sort-of/m-p/3861925#M31021</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/10676"&gt;@JB&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Doesn't this meet your requirements ?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I'm dealing with an array of clusters, not an array of numbers. So the array primitives (including Search) won't help.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Nov 2018 18:00:12 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/BreakPoint/Mini-Coding-Challenge-Binary-Search-sort-of/m-p/3861925#M31021</guid>
      <dc:creator>Darren</dc:creator>
      <dc:date>2018-11-13T18:00:12Z</dc:date>
    </item>
    <item>
      <title>Re: Mini Coding Challenge - Binary Search (sort of)</title>
      <link>https://ni.lithium.com/t5/BreakPoint/Mini-Coding-Challenge-Binary-Search-sort-of/m-p/3861926#M31022</link>
      <description>&lt;P&gt;You can't use search array or sort array, because you are only interested in one particular cluster element. If this is just an integer array, you are still far from optimal. Search is linear and needs to inspect millions of values. If the 1-4 check fails, there is no need for any search. If 2 is not found, there is no need to search for 3.&lt;/P&gt;
&lt;P&gt;If 2 is found, that would be used as the start index for the 3 search. I am sure my suggestion is many orders of magnitude faster. (Currently on the bus. Will try something later ... You never need to inspect more than a few dozen elements to solve)&lt;/P&gt;</description>
      <pubDate>Tue, 13 Nov 2018 18:14:49 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/BreakPoint/Mini-Coding-Challenge-Binary-Search-sort-of/m-p/3861926#M31022</guid>
      <dc:creator>altenbach</dc:creator>
      <dc:date>2018-11-13T18:14:49Z</dc:date>
    </item>
    <item>
      <title>Re: Mini Coding Challenge - Binary Search (sort of)</title>
      <link>https://ni.lithium.com/t5/BreakPoint/Mini-Coding-Challenge-Binary-Search-sort-of/m-p/3861944#M31023</link>
      <description>&lt;P&gt;I would suggest a more generic formulation of the problem to make it more reusable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"Given a array of clusters containing an integer element that is non-descending, determine if all possible integer values between the values of the first and last array element are present."&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe for another time... &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Nov 2018 18:33:24 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/BreakPoint/Mini-Coding-Challenge-Binary-Search-sort-of/m-p/3861944#M31023</guid>
      <dc:creator>altenbach</dc:creator>
      <dc:date>2018-11-13T18:33:24Z</dc:date>
    </item>
    <item>
      <title>Re: Mini Coding Challenge - Binary Search (sort of)</title>
      <link>https://ni.lithium.com/t5/BreakPoint/Mini-Coding-Challenge-Binary-Search-sort-of/m-p/3861973#M31024</link>
      <description>&lt;P&gt;Alright array of cluster.&amp;nbsp; 1 and 4 still checked the same, 2 and 3 checking each element.&amp;nbsp; Is it possible to pull the cluster elements out efficiently and then use search 1D array?&amp;nbsp; I get that looking at each element when there are millions can be slow, and this is brute forcing the array.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Example_VI_BD.png" style="width: 999px;"&gt;&lt;img src="https://ip1.i.lithium.com/982c864dadb0535ec22446588bb90f30d0cb5317/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f32333734373669423030414134323931394430443844422f696d6167652d73697a652f6c617267653f763d76322670783d393939" role="button" title="Example_VI_BD.png" alt="Example_VI_BD.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Nov 2018 19:54:52 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/BreakPoint/Mini-Coding-Challenge-Binary-Search-sort-of/m-p/3861973#M31024</guid>
      <dc:creator>Hooovahh</dc:creator>
      <dc:date>2018-11-13T19:54:52Z</dc:date>
    </item>
    <item>
      <title>Re: Mini Coding Challenge - Binary Search (sort of)</title>
      <link>https://ni.lithium.com/t5/BreakPoint/Mini-Coding-Challenge-Binary-Search-sort-of/m-p/3861976#M31025</link>
      <description>&lt;P&gt;This approach would work, but if the&amp;nbsp;numeric values look like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1, 1, 1, .... 1, 2, 3, 4&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;...then we have to go through the entire array to find out it's legit. I need a solution that looks like a binary search, that goes through the array as efficiently as possible.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Nov 2018 19:58:22 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/BreakPoint/Mini-Coding-Challenge-Binary-Search-sort-of/m-p/3861976#M31025</guid>
      <dc:creator>Darren</dc:creator>
      <dc:date>2018-11-13T19:58:22Z</dc:date>
    </item>
    <item>
      <title>Re: Mini Coding Challenge - Binary Search (sort of)</title>
      <link>https://ni.lithium.com/t5/BreakPoint/Mini-Coding-Challenge-Binary-Search-sort-of/m-p/3861991#M31026</link>
      <description>&lt;P&gt;Sorry it took two pages of replies to finally show me what you are trying to do.&amp;nbsp; Yeah I think an intelligent binary search could be performed.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do we have some real world data to try the normal approach with first?&amp;nbsp; Is the non binary search fast enough with real world data?&amp;nbsp; I just tested with&amp;nbsp;10M values and worst case (like you showed) took around 70ms, 100M took around 700ms.&amp;nbsp; Maybe cluster complexity increases the time needed?&lt;/P&gt;</description>
      <pubDate>Tue, 13 Nov 2018 20:24:58 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/BreakPoint/Mini-Coding-Challenge-Binary-Search-sort-of/m-p/3861991#M31026</guid>
      <dc:creator>Hooovahh</dc:creator>
      <dc:date>2018-11-13T20:24:58Z</dc:date>
    </item>
    <item>
      <title>Re: Mini Coding Challenge - Binary Search (sort of)</title>
      <link>https://ni.lithium.com/t5/BreakPoint/Mini-Coding-Challenge-Binary-Search-sort-of/m-p/3861995#M31027</link>
      <description>&lt;P&gt;Sorry I keep moving the goalposts. The array of clusters is the easiest way conceptually to present the coding challenge. In reality, it's not exactly an array of clusters. Suffice to say that the binary search will definitely result in time savings much greater than an order of milliseconds. But whatever "binary search with logic to handle looking for two things" answer y'all come up with should be translatable to the situation I'm dealing with. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Nov 2018 20:28:51 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/BreakPoint/Mini-Coding-Challenge-Binary-Search-sort-of/m-p/3861995#M31027</guid>
      <dc:creator>Darren</dc:creator>
      <dc:date>2018-11-13T20:28:51Z</dc:date>
    </item>
    <item>
      <title>Re: Mini Coding Challenge - Binary Search (sort of)</title>
      <link>https://ni.lithium.com/t5/BreakPoint/Mini-Coding-Challenge-Binary-Search-sort-of/m-p/3862017#M31028</link>
      <description>&lt;P&gt;Here's a quick draft (LabVIEW 2015). A few microseconds (1-3us) for 10M million elements of an array containing a cluster with the "interesting number", three other random DBLs and a short string.&lt;/P&gt;
&lt;P&gt;(Sorry, the data generator ran out of memory for 100M but the analysis should still be in the low microseconds. We need to simplify the cluster for larger sizes...)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(Some things could be tweaked and there might be edge cases that need to be addressed. No failure for Size=1k and &amp;gt;1M trials: looks promising....:) The innermost case could also be wired directly to the number with one case "2" and the other "default"))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(Note that the data generation is significantly slower that the validity check. It takes about 10s to generate the 10M array ... &lt;span class="lia-unicode-emoji" title=":monkey_face:"&gt;🐵&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Nov 2018 22:17:07 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/BreakPoint/Mini-Coding-Challenge-Binary-Search-sort-of/m-p/3862017#M31028</guid>
      <dc:creator>altenbach</dc:creator>
      <dc:date>2018-11-13T22:17:07Z</dc:date>
    </item>
    <item>
      <title>Re: Mini Coding Challenge - Binary Search (sort of)</title>
      <link>https://ni.lithium.com/t5/BreakPoint/Mini-Coding-Challenge-Binary-Search-sort-of/m-p/3862057#M31029</link>
      <description>&lt;P&gt;My implementation (LV2018) is very similar to CA's except I used an enum to track progress.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Nov 2018 23:33:27 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/BreakPoint/Mini-Coding-Challenge-Binary-Search-sort-of/m-p/3862057#M31029</guid>
      <dc:creator>GregSands</dc:creator>
      <dc:date>2018-11-13T23:33:27Z</dc:date>
    </item>
    <item>
      <title>Re: Mini Coding Challenge - Binary Search (sort of)</title>
      <link>https://ni.lithium.com/t5/BreakPoint/Mini-Coding-Challenge-Binary-Search-sort-of/m-p/3862081#M31030</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/67789"&gt;@GregSands&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;My implementation (LV2018) is very similar to CA's except I used an enum to track progress.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I haven't tested yours because my data input structures are different, but one thing to remember is that any case structure with more than two cases is measurably slower than a case structures with only two cases. Your stack of case structures has 15 possible paths while mine only has four possible paths. (Yes, my outer case has 3 cases, but the code is so fast it does not really matter).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am curious what the performance would be.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Nov 2018 00:39:41 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/BreakPoint/Mini-Coding-Challenge-Binary-Search-sort-of/m-p/3862081#M31030</guid>
      <dc:creator>altenbach</dc:creator>
      <dc:date>2018-11-14T00:39:41Z</dc:date>
    </item>
    <item>
      <title>Re: Mini Coding Challenge - Binary Search (sort of)</title>
      <link>https://ni.lithium.com/t5/BreakPoint/Mini-Coding-Challenge-Binary-Search-sort-of/m-p/3862131#M31031</link>
      <description>&lt;P&gt;Christian and GregS, y'all rock! Your algorithms both work well for my situation. Y'all brought my processing time down from ~1 sec to 0.003 sec. GregS, since you conveniently posted a .vim, I just dropped it into Christian's benchmark VI to test its speed and functionality.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Y'all both get shout-outs at NIWeek 2019. Christian gets a high five too since I know he'll be there. Greg gets one too if he shows up.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Nov 2018 04:41:25 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/BreakPoint/Mini-Coding-Challenge-Binary-Search-sort-of/m-p/3862131#M31031</guid>
      <dc:creator>Darren</dc:creator>
      <dc:date>2018-11-14T04:41:25Z</dc:date>
    </item>
  </channel>
</rss>

