小编scd*_*scd的帖子

在 Graphviz 中将节点的标签方向更改为 90°

有什么办法可以改变文本90\xc2\xba的方向吗?

\n\n

例子:

\n\n

初始图:

\n\n

初始图

\n\n

所需图表:

\n\n

在此输入图像描述

\n\n

我的代码:

\n\n
digraph G {\n  layout="neato"\n  edge[arrowhead=none]\n  node[style=filled fillcolor="white", fixedsize=true]\n  circunferencia[label="", pos="0.0, 0.0!", shape = "circle", width=2, color="grey", style=boldsi];\n  1[label="1()", pos="0.30901699437494745,0.9510565162951535!", shape = "circle"];\n  5[label="5()", pos="-0.8090169943749473,0.5877852522924732!", shape = "circle"];\n  4[label="4()", pos="-0.8090169943749476,-0.587785252292473!", shape = "circle"];\n  3[label="3()", pos="0.30901699437494723,-0.9510565162951536!", shape = "circle"];\n  2[label="2()", pos="1.0,-2.4492935982947064e-16!", shape = "circle"];\n  centro[label="", pos="0.0, 0.0!", shape = "point", fillcolor=black];\n}\n
Run Code Online (Sandbox Code Playgroud)\n

graphviz

5
推荐指数
1
解决办法
2859
查看次数

使用一系列整数值初始化 ArrayList 避免循环

我想用一系列整数值初始化一个 ArrayList。这是我想要避免的:

ArrayList<Integer> numbers = new ArrayList<>();
for(int i = 0; i < x; i++){
    numbers.add(i);
}
Run Code Online (Sandbox Code Playgroud)

我找到了 IntStream 的 rangeClosed 函数:

IntStream.rangeClosed(0, instance.getNumVertices()-1);
Run Code Online (Sandbox Code Playgroud)

但我认为转换为 ArrayList 不值得。

我在追求效率...

java arraylist

2
推荐指数
1
解决办法
3755
查看次数

标签 统计

arraylist ×1

graphviz ×1

java ×1