Tree - a data structure made up of nodes that have the following 2 rules: (1) A tree node can point at its children or at
NULL, and (2) A tree node may not point at any other node other than those listed in (1), including itself. Struct of a 3child tree is above right. In the diagram, black (top) is the root node and grey (point to NULL) are leave nodes. A binary
tree is a special kind of tree that has 2 children left and right.
Trie Just like tree but can have arbitrary number of children. Below are examples of binary trie and 6-child trie.
typedef struct trie {
typedef struct btrie {
bool valid;
bool valid;
struct trie*children[26];
struct btrie *children[2];
} trie;
} btrie
LANGUAGE
TYPE
VARIABLE
EXECUTION
SOURCE CODE
C
Compiled
Strictly typed
N/A
N/A
language
HTML
Markup
N/A
N/A
Available
Language,
connectionless
protocol
PHP
Interpreted
Loosely typed
Server side
Not available
language
JAVASCRIPT
Interpreted
Loosely typed
Client side
Available
language
ERROR
Wont compile
Ignores error
Error message
Fail gracefully
IP address unique to every computer to identify it on the internet. It sends data in the form of IP packets. in the form #.#.#.#, where each # is a
number within 0-255 for a total of ~4 billion IP addresses.
TCP keeps track of the data between points A and B and tell computer to resend data if packets get lost or corrupted.
Table:
Form:
<table>
<tr> <td>(0,0)</td> <td>(0,1)</td> </tr>
<tr> <td>(1,0)</td> <td>(1,1)</td> </tr>
</table>
SQL:
SELECT
INSERT
UPDATE
DELETE
Javascript:
- Variables declared by: var one_to_four_array = [ 1, 2, three, 4.00 ]; // diff. type is
allowed
- Concatenating variables with +: var phrase = into one; var sentence = 3 + words joined together +
phrase;
- In JavaScript, "1" == 1 evaluates to be true (loosely typed). To compare the value AND the type, "1" === 1 evaluates to false.
- typeof: document.write(typeof dogName); will write string to the page. None existing type will print undefined.
- Embedding javaScript in body:
<form action=onclick=lookup()>
</form>
- Linking External JavaScript in head:
<head>
<script src = file.js></script>
</head>
- Some examples of event handlers in JavaScript: onClick, onLoad,
onFocus, onMouseOver, onMouseOut.
- To include JavaScript in the body, you need the following tag:
<script type="text/javascript">
</script>
- for-in syntax in JavaScript:
String weekdays = {Sunday, ...,Saturday};
for(int i = 0; i < 7; i++)
{
printf(today is %s, weekdays[i]);
}