midterm1-sol - CS5363 Midterm Exam Oct 12, 2011 1. (15pts)...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CS5363 Midterm Exam Oct 12, 2011 1. (15pts) Answer the following questions, using a single sentence for each question. (a) What are the key features of a functional programming language? Create new variables instead of modifying existing ones; functions are treated as first class objects. (b) What is different between an NFA and a DFA? NFA can have multiple transitions defined for each state on the same token; DFA must have a unique transition defined. (c) What makes a context-free grammar (i.e., BNF) ambiguous? When multiple parse trees can be constructed for a single input. (d) What is a LL(K) parser? Left-to-right, leftmost derivation, K symbol lookahead parser. (e) What is an inherited attribute? Attribute of a parse tree node computed from those of its parent or siblings. (f) What are the tradeoffs of applying type checking at compile-time vs. runtime? Compile-time type check restricting flexibility of defining polymorphic functions but enables early error reporting; runtime checking slows down runtime execution but can discover all type errors. (g) What is polymorphism? Functions that can operate on different types of input values. (h) What are the different types of polymorphism? Subtype, parametric, and ad-hoc polymorphism....
View Full Document

Page1 / 4

midterm1-sol - CS5363 Midterm Exam Oct 12, 2011 1. (15pts)...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online