We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bdd665e commit fa62b8bCopy full SHA for fa62b8b
README.md
@@ -443,3 +443,25 @@
443
*/
444
+ (void)outDegree:(GraphNode *)graph;
445
```
446
+### 堆
447
+```
448
+/*
449
+ * desc: 建立并返回小顶堆
450
+ *
451
+ * params: heap 堆, len 长度
452
453
+ */
454
++ (NSMutableArray *)createMinHeap:(NSMutableArray *)heap length:(int)len;
455
+
456
457
+ * desc: top k
458
459
+ * option:
460
+ * 1. 通过hash table记录输入的值,key为值,value为出现的次数
461
+ * 2. 建立容量为k的小顶堆
462
+ * 3. 按照hash table中的值入堆,返回结果
463
464
465
466
++ (NSMutableArray *)findTopKMaxNum:(NSMutableArray *)heap length:(int)len;
467
0 commit comments