b******u 发帖数: 81 | 1 递归。
public static List Insert(List boundBoxs, BoundBox boundBox)
{
List result = new List();
BoundBox bb = null;
int i;
for (i = 0; i < boundBoxs.Count(); i++)
{
bb = Merge(boundBoxs[i], boundBox);
if (bb != null)
{
break;
}
}
result.AddRange(boundBoxs);
if (bb == null)
{
result.Add(boundBox);
}
else
{
result.RemoveAt(i);
result = Insert(resu... 阅读全帖 |
|
l*********8 发帖数: 4642 | 2 看了大概思路是对的。
这个算法复杂度是O(n^2)吧。 有没有更好的算法?
boundBox) |
|
d******e 发帖数: 2265 | 3
eps file is text file, so you can use vi or ultredit to edit
it. search boundbox in ps file and open it using ghostview
to calculate the bounding box you want.
remember it may appear at the beginning and at the end
of file.
then \includegraphx(or *)[height=xxcm]{xxx.eps} |
|