我尝试使用 OpenMP 在分区部分和 QuickSort 部分并行化 QuickSort。我的C代码如下:
#include "stdlib.h"
#include "stdio.h"
#include "omp.h"
// parallel partition
int ParPartition(int *a, int p, int r) {
int b[r-p];
int key = *(a+r); // use the last element in the array as the pivot
int lt[r-p]; // mark 1 at the position where its element is smaller than the key, else 0
int gt[r-p]; // mark 1 at the position where its element is bigger than the key, else 0
int cnt_lt = 0; …Run Code Online (Sandbox Code Playgroud) 我使用fastgreedy.community生成一个社区对象,其中包含15个社区.但是,如何在这15个社区中提取最大的社区?
Community sizes
1 2 3 4 5 6 7 8 9 10 11 12 13 14
1862 1708 763 974 2321 1164 649 1046 2 2 2 2 2 2
15
2
Run Code Online (Sandbox Code Playgroud)
在此示例中,我想提取社区5以供进一步使用.谢谢!
BufferedReader'sreadline()读取由 '\n' 定义的行,是否可以读取由其他分隔符定义的行,例如^B?谢谢