# Lec13Parse - Notetakers: Justin Miller and Kenrick Goldson...

This preview shows pages 1–3. Sign up to view the full content.

Notetakers: Justin Miller and Kenrick Goldson COT 4210 Discrete Structures II 4 common searches: Breadth-First Top-Down Depth-First Top-Down Breadth-First Bottup-Up Depth-First Bottom-Up Algorithm: beginning at beginning of queue, explore all nodes of depth 1, then 2, 3, etc. Example I – Breadth-First Search( Top-Down ): Using the following, we derive a breadth-first top-down search for the expression (b+b). V = {S, A, T} ∑ = {b, +, (, )} 1. S A 2. A T 3. A A + T 4. T b 5. T (A) ( b ) / b ( T ) --- ( ( A ) ) / / T --- ( A ) --- ( A + T ) / S --- A b + T \ / A + T --- T + T --- ( A ) + T \ A + T + T --- T + T + T \ A + T + T + T NOTE: If string bb+ is searched for using Breadth-First Search Top-Down parsing method, it is possible for the search to continue forever since it is not part of the language.

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

View Full Document
Example II – Depth-First Search( Top-Down ): Using the same example, we search depth-first top-down for the expression (b+b). S
This is the end of the preview. Sign up to access the rest of the document.

## Lec13Parse - Notetakers: Justin Miller and Kenrick Goldson...

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

View Full Document
Ask a homework question - tutors are online