progs/re2.scala
changeset 441 028816884f70
parent 440 e14cd32ad497
child 453 36e5752fa191
equal deleted inserted replaced
440:e14cd32ad497 441:028816884f70
    54   (end - start)/(i * 1.0e9)
    54   (end - start)/(i * 1.0e9)
    55 }
    55 }
    56 
    56 
    57 
    57 
    58 //test: (a?{n}) (a{n})
    58 //test: (a?{n}) (a{n})
    59 for (i <- 1 to 1101 by 100) {
    59 for (i <- 1 to 1001 by 100) {
    60   println(i + " " + "%.5f".format(time_needed(2, matches(EVIL1(i), "a" * i))))
    60   println(i + " " + "%.5f".format(time_needed(2, matches(EVIL1(i), "a" * i))))
    61 }
    61 }
    62 
    62 
    63 for (i <- 1 to 1101 by 100) {
    63 for (i <- 1 to 1001 by 100) {
    64   println(i + " " + "%.5f".format(time_needed(2, matches(EVIL1(i), "a" * i))))
    64   println(i + " " + "%.5f".format(time_needed(2, matches(EVIL1(i), "a" * i))))
    65 }
    65 }
       
    66 
    66 
    67 
    67 //test: (a*)* b
    68 //test: (a*)* b
    68 for (i <- 1 to 20) {
    69 for (i <- 1 to 20) {
    69   println(i + " " + "%.5f".format(time_needed(2, matches(EVIL2, "a" * i))))
    70   println(i + " " + "%.5f".format(time_needed(2, matches(EVIL2, "a" * i))))
    70 }
    71 }