Showing posts with label Trees. Show all posts
Showing posts with label Trees. Show all posts

Sunday, 30 May 2010

Symbolic AI – Deep and Surface Structure Trees

Finally, you get to see a tree :D

This post will cover the basics of what Deep and Surface Structure trees are, as well as a little bit on moved words – only little though!

Tuesday, 9 February 2010

Algorithms - Traversals

Traversals


What is a traversal? It's when you visit every node of a tree or graph using the edges.

Tree traversal


Let's talk about 3 methods of traversing trees (Note: Always start at the root)

  • Depth-First-Search: Visit all the descendants of a node before visiting the sibling nodes. You have to visit some nodes more than once in a DFS, this is called backtracking

  • Breadth-First-Search: Visit all children of a node before visiting sibling nodes

  • Priority Search: Nodes are given priorities, and the children of the node that haven't been visited yet with the highest priority are visited first


So let's try these on a tree. Here's one I made earlier:

Friday, 8 January 2010

Algorithms – Trees

So what exactly is a Tree in programming?

Well, it is not a tree that you see every day when you walk through a park :P