Sunday, 9 March 2014

Searching for Linked Lists in Sets of Two

    Okay, I know I didn't put up my blog post about trees this week like I promised, but I'll put it up eventually. In the mean time, we'll talk about Linked Lists!

    A linked list is essentially a tree, but where every single node has only one value, and a pointer pointing to the next node (Also known as the rest of the linked list). Just like recursion, and trees, and all of computer science in general, it was really hard to get my mind around this concept at first. But as time went on, and I read and reprogrammed the code over and over again, it suddenly started making sense. Although this might not make perfect sense, the idea that linked lists are just lists, but instead of being inside of a single list, it is 'wrapped' inside of a wrapper, where it points to other linked lists just didn't make sense to me. But when I started to get the hang of the prepend and decapitate functions of linked lists, it started to become clear

    Now one thing that I'm still having a little issue with is a binary search tree. The concept of binary search is pretty simple; you start off with a term, and to the left are terms that are smaller in value, while to the right are terms that are greater. This gives a much faster search time for finding an object because instead of potentially having to search and entire tree, you can literally ignore half of it depending on if the value you are looking for is greater than or less than the initial value. I don't exactly know what I find confusing about these trees since I have a grasp of what they're supposed to do, but whenever I try to think about them, I can't help but feel as if I'm missing something.

No comments:

Post a Comment