Timeline for Average of multiple vectors with different length
Current License: CC BY-SA 3.0
19 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| May 31, 2017 at 23:09 | vote | accept | Cap | ||
| May 31, 2017 at 22:40 | history | edited | 200_success | CC BY-SA 3.0 |
edited tags; edited title
|
| May 31, 2017 at 20:32 | history | migrated | from stackoverflow.com (revisions) | ||
| May 31, 2017 at 19:43 | comment | added | Antoniossss | @ThijsSteel all the same keys? So same sizes - then O(N+(P/N)) Where N is number of values, and P number of profiles. | |
| May 31, 2017 at 19:38 | comment | added | Thijs Steel | @Antoniossss in that specific case yes, but say they all have the same keys. | |
| May 31, 2017 at 19:37 | comment | added | Antoniossss | @ThijsSteel if we assume that every profile has unique keys, then we will still have to interate once over every profile (so N) and once more to calculate avg value (+N). Why N*M ? | |
| May 31, 2017 at 19:35 | answer | added | Antoniossss | timeline score: 1 | |
| May 31, 2017 at 19:34 | comment | added | Thijs Steel | @Antoniossss wouldn't it be O(N*M) with M the average valid key per profile? | |
| May 31, 2017 at 19:30 | comment | added | Antoniossss | @Cap well it is still O(N) in general, and O(N+M) to be exact where N is number of all elements in all profiles, and M is number of unicue keys. | |
| May 31, 2017 at 19:19 | answer | added | Thijs Steel | timeline score: 0 | |
| May 31, 2017 at 19:08 | comment | added | Cap | @GhostCat what I wrote in comment is from the example, that is in the question. So, it's understandable from there. | |
| May 31, 2017 at 19:05 | comment | added | GhostCat | When you have clarifications for your content edit the question, don't use unreadable comments. | |
| May 31, 2017 at 19:01 | comment | added | Cap | @GhostCat will post there from next time. Didn't know about that sub-platform. | |
| May 31, 2017 at 19:00 | comment | added | Cap |
@Antoniossss not average IN all profile, but average OF all profiles, like in example. If p1={1->1, 2->3, 4->5, 6->9} and p2={1->0, 3->1, 4->1,5->2} then the average is {1->0.5, 2->3, 3->1, 4->3, 5->2, 6->9}.
|
|
| May 31, 2017 at 18:55 | comment | added | Antoniossss | @Cap from data sample your profile is a simple Map<Integer,Integer> and you want to get the avarage values in all profiles (maps) am I correct? | |
| May 31, 2017 at 18:54 | comment | added | Cap | @Antoniossss how can I iterate only once, if I need to iterate over all values in the outer map and then once more over all in the inner map? | |
| May 31, 2017 at 18:50 | answer | added | Jerry Zhao | timeline score: 0 | |
| May 31, 2017 at 18:48 | comment | added | Antoniossss | It should be O(N) as you need to interate only once | |
| May 31, 2017 at 18:45 | history | asked | Cap | CC BY-SA 3.0 |