Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The first thing I think about when I read this question is: <em>what types of things use graphs/trees?</em> and then I think backwards to how I could use them.</p> <p>For example, take two common uses of a tree:</p> <ul> <li>The DOM</li> <li>File systems</li> </ul> <p>The DOM, and XML for that matter, resemble tree structures. <br> <img src="https://i.stack.imgur.com/bk5RY.gif" alt="alt text"></p> <p>It makes sense, too. <strong>It makes sense because of how this data needs to be arranged</strong>. A file system, too. On a UNIX system there's a root node, and branching down below. When you mount a new device, you're attaching it onto the tree.</p> <p>You should also be asking yourself: does the data fall into this type of structure? Create data structures that make sense to the problem and the rest will follow.</p> <p>As far as being easier, I think thats relative. Are you good with recursive functions to traverse a tree/graph? What if you need to balance the tree?</p> <p>Think about a program that solves a word search puzzle. You could map out all the letters of the word search into a graph and check surrounding nodes to see if that string is matching any of the words. But couldn't you just do the same with with a single array? All you really need to do is move an index to check letters to the left and right, and by the width to check above and below letters. Solving this problem with a graph isn't difficult, but it can create a lot of extra work and difficulty if you're not comfortable with using them - of course that shouldn't discourage you from doing it, especially if you are learning about them.</p> <p>I hope that helps you think about these structures. As for a book recommendation, I'd have to go with <strong><a href="http://rads.stackoverflow.com/amzn/click/0262032937" rel="noreferrer">Introduction to Algorithms</a></strong>. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload