Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

15
LINES

< > BotCompany Repo | #1032640 // findLowestEntrySizeForHyperCompactTreeSet

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (6773L/39K).

1  
svoid findLowestEntrySizeForHyperCompactTreeSet() {
2  
  new LowestDouble lowest;
3  
  
4  
  repeat 100 {
5  
    int digits = random(1, 6);
6  
    int m = random(1, pow10_int(digits)), n = random(m);
7  
    var set = addAndRemoveSomeRandomStrings(new HyperCompactTreeSet, m, n);
8  
    Cl<HyperCompactTreeSet.NonLeaf> l = set.unoptimizedNodes();
9  
    if (nempty(l))
10  
      print("Unoptimized nodes: " + mapToMultiSet(l, node ->  className(node) + ": " + className(node.left) + ", " + className(node.right));
11  
    print("m=" + m + ", n=" + n + ". " + renderCollectionBytesPerEntry(set));
12  
    lowest.put(collectionBytesPerEntry(set));
13  
  }
14  
  print(lowest);
15  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1032640
Snippet name: findLowestEntrySizeForHyperCompactTreeSet
Eternal ID of this version: #1032640/1
Text MD5: ed7f9b9a257c9d97ed310b56a8c21454
Transpilation MD5: a105e60b94a14a177a0e9d123c4f3249
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-09-29 23:08:11
Source code size: 645 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 123 / 185
Referenced in: [show references]