lecture_27_revised2

# lecture_27_revised2 - 1 bfs.txt 2010-12-02 09:32 David...

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

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

View Full Document

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

View Full Document

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

View Full Document
1 · bfs.txt · 2010-12-02 09:32 · David Nicol Recursive definition of Depth-First-Search and Breadth-First-Search -- AddNodePtr enqueues a node * onto a First-Come-First-Serve queue, -- RemovePtr dequeues and returns a node * from that same queue void DFS(node *here) { if(here == NULL) return; DFS(here->left); printf( "at %p node %s\n" , here, here->attribute); DFS(here->right); } void BFS() { node *shownode = RemoveNodePtr(); if( shownode == NULL ) return; int children = 0; printf( "at %p node %s\n" , shownode, shownode->attribute); if( shownode->left ) AddNodePtr( shownode->left ); if( shownode->right) AddNodePtr( shownode->right ); BFS(); }
1 · hash.txt · 2010-11-30 16:38 · David Nicol Hash Table consider following example struct person { char name[100]; char dob[10]; int phone; }; struct person UofIstudent[32000]; If we want to find a students phone number (and the list) is unordered, we have to scan the entire list for(int i=0; i<32000; i++) { if(strcmp(Name,UofIstudents[i])==0) {

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 08/29/2011 for the course ECE 265 taught by Professor Kosbar during the Fall '09 term at Missouri S&T.

### Page1 / 8

lecture_27_revised2 - 1 bfs.txt 2010-12-02 09:32 David...

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

View Full Document
Ask a homework question - tutors are online