| |
| |
| |
|
Page: 1 2 3 4 5 6 7
Comments:
<0> what type of printing binary trees deffine it in the only way <1> can u plz...? <2> can i subtract/divide/multiply std::vector::iterator s ? is iterator arithmetic supported beyond plus? <3> yes <1> i wonna write to a binary file.. <3> they're random access iterators <4> dextre, subtract <5> SSSsssSSS nope, you are specifically banned <1> i wonna write to a binary file.. <3> er <3> not multiply and divide rthough <2> Cowmoo: i got 2 iterators i want to get the average position of.. (a+b)/2 <4> what would divide and multiply mean for an iterator/pointer ? <5> and they probably banned you because you're irritating <3> what would division even mean? <3> use std::distance dextre
<0> what type of printing binary trees deffine it in the only way <2> Cowmoo: i'm using "equal_range", which gives 2 iterators marking a range, <3> but I dunno, what you're doing seems suspect <2> Cowmoo: thanks, i like that <5> dextre why do you think you need iterator arithmetic anyhow? <2> varjr: yeah, i don't think it's something i would implement into vector::iterator myself.. i happen to need the average position returned by std::equal_range, which does a binary search <2> std::distance sounds good <5> dextre I presume your container is sorted <2> yeah, it's sorted ;) <2> i chose equal_range because there might be duplicate elements, in which case i'd like the avg position <5> what are you going to do if distance is even <2> isn't even? then i'd round down <5> and why do you need the position of the "middle" of the range <5> IS even odd actually had a middle <2> you're right <1> i wonna write to a binary file.. i did this: http://www.noidea128.org/sourcefiles/16262.html <2> varjr: round down then <1> but when I open data.bin it was writen rgular not binary... why is that? <5> why do you want the middle, instead of the beginning or end <2> i'd like to build a function that finds k nearest neigbors in a list of vectors, and do it very fast.. <1> help me.. ok.? <5> SSSsssSSS that's pure C...not interested in helping you <2> so i figure i'd sort the positions in each dimension <3> haha dextre <3> AI ***ignment? <2> no. thesis <3> oh <3> I had to write a k-NN implementation couple of weeks ago <5> dextre dextre what are you "nearest neighboring" on ? <2> i'm borrowing this trick from axis-aligned bounding box collision detection i read about some time ago <2> the fastest way to get kNN seems to be this <1> so where to? <1> get help beside #c? <2> u sort once, then query time becomes m log n, with n dimension vectors, and m of them <1> cause I'm banned overthere.. <5> SSSsssSSS yes, and I know the person who banned you,,,,,, you must have been a real pest <6> Well, other than repeating the same sentence about 15 times within 10 seconds, he's almost fine :p <2> varjr: i'm nearest neiboring on a vector of m points with n dimensions <5> are you clustering things? or you have a specific place you want to be near to in n-space? <2> i actually need to have the neighbors, k of them <7> please i need a good documentation about how using API on MSVC <5> for a specific point? or what?? <6> G3M: MSDN <2> neighbors of a position where there may or may not be a point <2> the sort need only be done once <5> a point exists.....doesn't need anything else <7> MrAshe : yeah but i found nothing :/ <7> there search engine ****s <5> so you have n coordinates and you want the k nearest things to it <2> and for queries the rest is just binary search on each dimension <2> yeah <5> you going to then search the subset that is k*n elements? <2> i COULD build a distance matrix of the entire dataset <2> and sort a single row of that matrix to yield the k nearest neighbors in log n steps <5> dextre that's expensive you ned up w/ m^2/2 entries in it <5> m being the number of elements in the entire collection <1> where I can get help in #c? <1> where I can get help in c? <1> not ic channel #c <1> other channel..
<1> knows? <2> vaw: yeah, but query time will be very fast, and it can even be m Time, not log n <5> log M <2> yeah <5> so you have to decide whether the sort is worth it...... depends on the query vs data-changes ratio <5> btw, when I'm doing that kind of thing I never do sqrt distance squared is good for comparing also <5> and it makes the math quite a bit faster <2> well, right now, i'm maintaining N sorted lists, 1 per dimension.. the distance matrix has M^2 / 2 terms <2> vawjr: good idea, thanks <2> each sorted list has M entries <2> so it's space(N*M) vs space(M^2/2) <2> steps(N log M) vs steps(M) <2> tough call <5> don't forget the time needs to be factored in <2> time needs to be factored in? <5> yeah, if you're measuring the cost of different approaches <2> implementation time? <5> implementation + a*number of times it's run <5> a being execution time <2> implementation time aside, which do u like better? <5> if this is only gonna run once that's a big differnce between running every millisecond <2> axis sorting, or distance matrix <5> how many times is it gonna run...... distance 1/2 matrix requires (after the equal-range call) at most k looks <5> and NO distance calculations to perform....straight compares <5> asix requires calculating k*n distances for each search <2> query(time(N log M)) vs query(time(M)) <2> init(time(N* M log M)) vs init(time(M log M)) <2> space(N*M) vs space(M^2/2) <2> query for either require no distance calculations, <2> but building the distance matrix does, extensively, and the sorted list approach doesn't <0> hello <8> hi <0> i have postorder print of the binar tree how can i print the tree from it ? <0> do you have any idea ? <2> left->print(); right->print(); this->print(); <0> not its not good <2> yes it IS <3> fozo: this is a comon algorithm, look it up online <2> * preorder */ this->print(); left->print(); right->print(); <9> this->print() should be this->printSelf(); <9> otherwise it's just endless recursion <0> looked not found on goodle <2> yeah, <2> goodle <2> lol <3> lol <2> yodle <0> :) <9> http://en.wikipedia.org/wiki/Tree_traversal <2> is a distance matrix really that bad? <2> it has attractive time complexity <3> sure why not <3> if the space complexity is no bother <10> hmm <10> damnation, I need a better vector art program than inkscake <2> what's a fast way to get the N smallest values in a list? <2> keeping the complexity as close to N as possible <3> you could do O(n), where n is the size of your list <3> that's the fastest <2> yeah, <2> but how do i implement this <3> use the Select algorithm <3> find the median Nth element, and use Partition with it as the pivot <2> ah <2> so it's like binary search <3> no <3> well <3> in the sense that they're both divide-and-conquer algorithms I suppose? <2> std::nth_element ? <3> ohh, you were tlaking C++ <3> haha yea, that'd do <2> what an awesome coincidence <2> stumbled onto the right function <2> is nth_element fast?
Return to
#c++ or Go to some related
logs:
What play contains the line 'something is rotten in the state of Denmark' ? how to manstrubate #linux #AllNiteCafe zic skype apt-remove --purge #linux volleyball tips/instructions lymaria bibanul
|
|