Title: NFSA Simulation with Deque
1NFSA Simulation with Deque
Deque
Input Text
a
a
b
d
a
a
a
a
a
a
a
a
a
a
a
a
-1
a
a
a
top
bottom
state
label
a
?
c
6
7
8
9
?
?
?
d
10
11
?
12
13
start
accept
?
a
?
b
?
1
2
3
4
5
?
2NFSA Simulation with Deque
Deque
Input Text
a
a
b
d
a
a
a
a
a
a
a
a
a
a
a
a
-1
a
a
a
3
6
top
bottom
Push 3 and 6 since label ?
10
state
?
label
a
?
c
6
7
8
9
?
?
?
d
10
11
?
12
13
start
accept
?
a
?
b
?
1
2
3
4
5
?
3NFSA Simulation with Deque
Deque
Input Text
a
a
b
d
a
a
a
a
a
a
a
a
a
a
a
a
-1
3
a
a
7
top
bottom
Enqueue 7 since label matches
6
state
a
label
a
?
c
6
7
8
9
?
?
?
d
10
11
?
12
13
start
accept
?
a
?
b
?
1
2
3
4
5
?
4NFSA Simulation with Deque
Deque
Input Text
a
a
b
d
a
a
a
a
a
a
a
a
a
a
a
7
-1
3
a
a
1
4
top
bottom
Push 1 and 4 since label ?
3
state
?
label
a
?
c
6
7
8
9
?
?
?
d
10
11
?
12
13
start
accept
?
a
?
b
?
1
2
3
4
5
?
5NFSA Simulation with Deque
Deque
Input Text
a
a
b
d
a
a
a
a
a
a
a
a
a
a
a
7
-1
1
a
a
top
bottom
Do nothing since label mismatches
4
state
b
label
a
?
c
6
7
8
9
?
?
?
d
10
11
?
12
13
start
accept
?
a
?
b
?
1
2
3
4
5
?
6NFSA Simulation with Deque
Deque
Input Text
a
a
b
d
a
a
a
a
a
a
a
a
a
a
a
7
-1
1
a
a
2
top
bottom
Enqueue 2 since label matches
1
state
a
label
a
?
c
6
7
8
9
?
?
?
d
10
11
?
12
13
start
accept
?
a
?
b
?
1
2
3
4
5
?
7NFSA Simulation with Deque
Deque
Input Text
a
a
b
d
a
a
a
a
a
a
a
a
a
a
2
7
-1
1
a
a
-1
top
bottom
Enqueue -1 and advance input
-1
state
label
a
?
c
6
7
8
9
?
?
?
d
10
11
?
12
13
start
accept
?
a
?
b
?
1
2
3
4
5
?
8NFSA Simulation with Deque
Deque
Input Text
a
a
b
d
a
a
a
a
a
a
a
a
a
-1
2
7
-1
1
a
a
top
bottom
Enqueue -1 and advance input
-1
state
label
a
?
c
6
7
8
9
?
?
?
d
10
11
?
12
13
start
accept
?
a
?
b
?
1
2
3
4
5
?
9NFSA Simulation with Deque
Deque
Input Text
a
a
b
d
a
a
a
a
a
a
a
a
a
-1
2
7
-1
1
a
a
8
top
bottom
Push 8 since label ?
7
state
?
label
a
?
c
6
7
8
9
?
?
?
d
10
11
?
12
13
start
accept
?
a
?
b
?
1
2
3
4
5
?
10NFSA Simulation with Deque
Deque
Input Text
a
a
b
d
a
a
a
a
a
a
a
a
a
-1
2
7
-1
1
a
a
top
bottom
Do nothing since label mismatches
8
state
c
label
a
?
c
6
7
8
9
?
?
?
d
10
11
?
12
13
start
accept
?
a
?
b
?
1
2
3
4
5
?
11NFSA Simulation with Deque
Deque
Input Text
a
a
b
d
a
a
a
a
a
a
a
a
a
-1
2
7
-1
1
a
a
3
top
bottom
Push 3 since label ?
2
state
?
label
a
?
c
6
7
8
9
?
?
?
d
10
11
?
12
13
start
accept
?
a
?
b
?
1
2
3
4
5
?
12NFSA Simulation with Deque
Deque
Input Text
a
a
b
d
a
a
a
a
a
a
a
a
a
-1
2
7
-1
1
a
a
1
4
top
bottom
Push 1 and 4 since label ?
3
state
?
label
a
?
c
6
7
8
9
?
?
?
d
10
11
?
12
13
start
accept
?
a
?
b
?
1
2
3
4
5
?
13NFSA Simulation with Deque
Deque
Input Text
a
a
b
d
a
a
a
a
a
a
a
a
a
-1
1
7
-1
1
a
a
top
bottom
Do nothing since label mismatches
4
state
b
label
a
?
c
6
7
8
9
?
?
?
d
10
11
?
12
13
start
accept
?
a
?
b
?
1
2
3
4
5
?
14NFSA Simulation with Deque
Deque
Input Text
a
a
b
d
a
a
a
a
a
a
a
a
a
-1
1
7
-1
1
a
a
2
top
bottom
Enqueue 2 since label matches
1
state
a
label
a
?
c
6
7
8
9
?
?
?
d
10
11
?
12
13
start
accept
?
a
?
b
?
1
2
3
4
5
?
15NFSA Simulation with Deque
Deque
Input Text
a
a
b
d
a
a
a
a
a
a
a
a
2
-1
1
7
-1
1
a
a
-1
top
bottom
Enqueue -1 and advance input
-1
state
label
a
?
c
6
7
8
9
?
?
?
d
10
11
?
12
13
start
accept
?
a
?
b
?
1
2
3
4
5
?
16NFSA Simulation with Deque
Deque
Input Text
a
a
b
d
a
a
a
a
a
a
a
-1
2
-1
1
7
-1
1
a
a
3
top
bottom
Push 3 since label ?
2
state
?
label
a
?
c
6
7
8
9
?
?
?
d
10
11
?
12
13
start
accept
?
a
?
b
?
1
2
3
4
5
?
17NFSA Simulation with Deque
Deque
Input Text
a
a
b
d
a
a
a
a
a
a
a
-1
2
-1
1
7
-1
1
a
a
1
4
top
bottom
Push 1 and 4 since label ?
3
state
?
label
a
?
c
6
7
8
9
?
?
?
d
10
11
?
12
13
start
accept
?
a
?
b
?
1
2
3
4
5
?
18NFSA Simulation with Deque
Deque
Input Text
a
a
b
d
a
a
a
a
a
a
a
-1
1
-1
1
7
-1
1
a
a
5
top
bottom
Enqueue 5 since label matches
4
state
?
label
a
?
c
6
7
8
9
?
?
?
d
10
11
?
12
13
start
accept
?
a
?
b
?
1
2
3
4
5
?
19NFSA Simulation with Deque
Deque
Input Text
a
a
b
d
a
a
a
a
a
a
5
-1
1
-1
1
7
-1
1
a
a
top
bottom
Do nothing since label mismatches
1
state
a
label
a
?
c
6
7
8
9
?
?
?
d
10
11
?
12
13
start
accept
?
a
?
b
?
1
2
3
4
5
?
20NFSA Simulation with Deque
Deque
Input Text
a
a
b
d
a
a
a
a
a
a
5
-1
1
-1
1
7
-1
1
a
a
-1
top
bottom
Enqueue -1 and advance input
-1
state
label
a
?
c
6
7
8
9
?
?
?
d
10
11
?
12
13
start
accept
?
a
?
b
?
1
2
3
4
5
?
21NFSA Simulation with Deque
Deque
Input Text
a
a
b
d
a
a
a
a
a
-1
5
-1
1
-1
1
7
-1
1
a
a
11
top
bottom
Push 11 since label ?
5
state
?
label
a
?
c
6
7
8
9
?
?
?
d
10
11
?
12
13
start
accept
?
a
?
b
?
1
2
3
4
5
?
22NFSA Simulation with Deque
Deque
Input Text
a
a
b
d
a
a
a
a
a
-1
5
-1
1
-1
1
7
-1
1
a
a
12
top
bottom
Push 12 since label ?
11
state
?
label
a
?
c
6
7
8
9
?
?
?
d
10
11
?
12
13
start
accept
?
a
?
b
?
1
2
3
4
5
?
23NFSA Simulation with Deque
Deque
Input Text
a
a
b
d
a
a
a
a
a
-1
5
-1
1
-1
1
7
-1
1
a
a
13
top
bottom
Enqueue 13 since label matches
12
state
d
label
a
?
c
6
7
8
9
?
?
?
d
10
11
?
12
13
start
accept
?
a
?
b
?
1
2
3
4
5
?
24NFSA Simulation with Deque
Deque
Input Text
a
a
b
d
a
a
a
a
13
-1
5
-1
1
-1
1
7
-1
1
a
a
-1
top
bottom
Enqueue -1 and advance input
-1
state
label
a
?
c
6
7
8
9
?
?
?
d
10
11
?
12
13
start
accept
?
a
?
b
?
1
2
3
4
5
?
25NFSA Simulation with Deque
Deque
Input Text
a
a
b
d
a
a
a
-1
-1
5
-1
1
-1
1
7
-1
1
a
a
top
bottom
STOP match found
13
state
label
a
?
c
6
7
8
9
?
?
?
d
10
11
?
12
13
start
accept
?
a
?
b
?
1
2
3
4
5
?