As you might suspect, searching a binary search tree (BST) involves a recursive function. This function must plow through the tree, finding a value in a specific node. Because the BST is organized, the search process works far more quickly than when the data is unorganized or set in a sequential array. In fact, the bsearch() function uses a similar scheme requiring that the data first be sorted before the function works its magic.
Continue reading
Category Archives: Lesson
Climbing the Binary Tree
A binary search tree works best when code is available to search the tree. Before doing so, I’d like to demonstrate how a tree is processed, one node at a time.
Continue reading
Planting a Binary Tree
Tree structures are yet another way to organize data. They’re similar to a linked list, but with the data organized by value into a series of branches and leaves. OMG! It’s like a tree!
Continue reading
Outputting a Table of Math Stuff
Though I’m admittedly not good at math (at least according to my grades in school), I enjoy playing with math stuff on the computer. Programming allows me to mess with numbers and values without the risk of that ugly red mark and the need to wonder how a D or an F on my transcript affects my overall GPA.
Continue reading
To #include or not to #include
I had a reader offer me a puzzle the other day. His code ran well without the #include directive and he wondered why. I did, too.
Continue reading
Numbers Complex and Imaginary
Your C programs aren’t meant to suffer with an inability to handle values such as the square root of -1, the imaginary number i. No, you can easily manage such mathematical mysteries, making rare the possibility of a -nan result, as shown in last week’s Lesson.
Continue reading
The sqrt(-1.0)
The four-letter word that made me avoid computers and programming for far too long is math.
Continue reading
Silicon Valley Encryption, Part III
My attempt to de-obfuscate the easter egg from the HBO series Silicon Valley didn’t help in my efforts to reverse engineer the code. I got close, but I just can’t obtain that first (or final) value.
Continue reading
Silicon Valley Encryption, Part II
When Alexander faced the challenge of untangling the Gordian Knot, he just sliced it with his sword. Brilliant. Alas, untangling obfuscated C code takes more than a swift swipe of a blade.
Continue reading
Silicon Valley Encryption, Part I
I’m a fan of the HBO Series, Silicon Valley. From creator Mike Judge, it excellently showcases the antics of the nerds who populate California’s Silicon Valley and the companies they work for. It’s a brilliant series that I highly recommend to my techy friends. Plus, it’s chock full of digitally delightful easter eggs.
Continue reading