Tutor profile: Griffin D.
Questions
Subject: Software Engineering
What is the benefit of using a B-tree as opposed to a standard binary tree?
A B-tree would be beneficial when dealing with a very large amount of data. Since nodes are allowed to have up to $$M$$ children, the depth of a B-tree, $$log_{M}(N)$$, will be smaller than the depth of a binary tree, $$log_2(N)$$, of the same number of nodes $$N$$. For Example, assume we have a B-tree and a binary tree each containing 400 keys. A balanced binary tree would have a depth of 9, while a B-tree with $$M = 4$$ children could decrease that to a depth of just 5. When searching for a key in our tree, this would mean less recursions required to traverse the tree, improving performance as our number of keys grows larger.
Subject: Computer Science (General)
What is the main difference between a compiled language and an interpreted language? Give examples of each.
A compiled language must first be completely converted to machine code before being run on a system. On the other hand, interpreted languages are run one line at a time as they are provided to the system. In most cases, compiled languages like C or C++ are able to perform operations more quickly than interpreted languages like Python and Matlab.
Subject: C Programming
In C programming, what is the significance of statements that begin with a # (pound or hashtag) symbol?
Statements in C beginning with a # (pound or hashtag) symbol indicate preprocessor directives. These are used by the preprocessor to modify the source code before compilation. One example of this would be the common `#include <stdlib.h>` which allows the preprocessor to include definitions of important functions from the C standard library in a programmer's code so that they are able to take advantage of these optimized functions without needing to create their own implementation.