2017.05.04 11:20 PM
2017.05.05 12:24 AM
--This means I must iterate until both lists are exausted,taking the current element which compares lower off itslist at each iteration.In pseudo code<pre>A= (1,3, 5, 6, 10, 13, 18, 26, 42, 48)B= (1,3, 4, 7, 10, 12, 19, 24, 42, 44)a=firstItem(A); b=firstItem(B); next=null;while (a!=null and b!=null) {n= compare(a,b) ;if (n<=0) { output(a) ; a=nextItem(A) ;}if (n>=0) { output(b) ; b=nextItem(B) ;}}while (a!=null) { output(a); a=nextItem(A) ;}while (b!=null) { output(b); b=nextItem(B) ;}</pre>How can I do this properly in kdb (ie without while loops) ?Here "compare" and "output" will be custom operations, and the real data will tables not lists of numbers,But the sticking point seems to be just the need to advance through one list or the other conditionally, as illustrated here.
You received this message because you are subscribed to the Google Groups "Kdb+ Personal Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to personal-kdbplus+unsubscribe@googlegroups.com.
To post to this group, send email to personal-kdbplus@googlegroups.com.
Visit this group at https://groups.google.com/group/personal-kdbplus.
For more options, visit https://groups.google.com/d/optout.
EMEA
Tel: +44 (0)28 3025 2242
AMERICAS
Tel: +1 (212) 447 6700
APAC
Tel: +61 (0)2 9236 5700
KX. All Rights Reserved.
KX and kdb+ are registered trademarks of KX Systems, Inc., a subsidiary of FD Technologies plc.