CSCI 3230, Fall 2016 Assignment 1
Posted: Jan. 16 Due before 11:00 pm, Sunday, Jan. 29, 2017
Upload to Assignment 1 folder in Folio Dropbox with file name Lastname-ID.pdf.
(Mandatory assignment cove
CSCI 3230: Data Structures HW#1
Due by 9:30 AM on February 04, 2016
1. What is the order of the following growth functions? (10 points)
a.
b.
c.
d.
10n2 + 100n + 1000
10n3 - 7
2n + 100n3
n2log(n)
2. A
Problem 1
There are many ways to solve this problem. One way is to use a DFS that is initiated
from a designated root vertex. Each vertex should store the distance to the most distant
leaf in its subt
1
Miscellaneous (6 points)
(a) Fill the missing right-hand side for the production of A in the grammar below such that the
rules form a LL(1) grammar.
S ! AaA|AbA
A !
Solution:
A!
Consider the followi
CS 164 Programming Languages and Compilers
Handout 9
1. Regular Expressions and Finite Automata (15 points)
Consider the design of a small language using only the letters z, o, and the slash character
1. You are given an array A[1 . . . n] of items. An item x is called a majority element if it appears more
than n/2 times in A. Clearly, a majority element, if it exists, must be unique.
You are to de
1
Regular Expressions and Finite Automata (20 points)
a) Draw a deterministic nite automaton (DFA) that recognizes the language over the alphabet
cfw_0, 1 consisting of all those strings that contain
Question 1
Let G = (V, E) be an undirected graph with vertex set V and edge set
E. A partition of a graph is a partition of V into two disjoint sets, i.e.,
V = V 0 [ V 00 and V 0 \ V 00 = ;. An edge i
1
Context-Free Grammars (15 points)
Consider the following grammar.
S ! SS
S ! 0
S !
a) Write a regular expression for the language that is accepted by this grammar.
Answer:
0
b) Give at least one re
CSE541
EXERCISE 1
SOLUTIONS
QUESTION 1 Describe a dierence between logical and semantical paradoxes. Logical paradoxes (antinomies) are paradoxes concerning the notion of a set. Example: Russel parado
1
Liveness (10 points)
Consider the following program fragment.
d
a := 1
a,d
c := 3
a,c,d
if a >= 2 goto L2
a,c,d
b := c + 1
a,b,d
c := b + 2
a,d,c
L1:
a,d,c
if a >= d goto L2
a
c
b := d
return a
L2:
CSCI 3230, Fall 2017
Posted: Oct. 2
Assignment 4
Due before 11:00pm, Sunday, Nov. 5, 2017
Upload to Assignment 4 folder in Folio Dropbox with file name Lastname ID.pdf.
(Mandatory assignment cover-she
CSCI 3230, Fall 2017
Posted: Nov. 6
Assignment 5
Due before 11:00pm, Sunday, Nov. 26, 2017
Upload to Assignment 5 folder in Folio Dropbox with file name Lastname ID.pdf.
(Mandatory assignment cover-sh
CSCI 3230, Fall 2017
Posted: Aug. 28
Assignment 2
Due before 11:00 pm, Sunday, Sept. 10
Upload to Assignment 2 folder in Folio Dropbox with file name Lastname
ID.pdf.
(Mandatory assignment cover-sheet
CSCI 3230, Fall 2017
Posted: Sep. 16
Assignment 3
Due before 11:00pm, Sunday, Oct. 1, 2017
Upload to Assignment 3 folder in Folio Dropbox with file name Lastname ID.pdf.
(Mandatory assignment cover-sh
CSCI 3230, Fall 2017
Posted: Aug. 15
Assignment 1
Due before 11:00 pm, Aug. 27, 2017
Upload to Assignment 1 folder in Folio Dropbox with file name Lastname ID.pdf.
(Mandatory assignment cover-sheet; w
CSCI 3230: Data Structures HW#3
Due by 9:30 AM on March 31, 2016
1. (30 pts) List the elements (nodes), of the following tree, with the given tree-traversal:
a) Preorder
1, 2, 4, 8, 6, 17, 9,18, 5, 10