| Terms |
Definitions |
|
Penicillins
|
piperacillin
|
|
Cephalosporins
|
cefepime
|
|
Ectoparasites
|
permethrinivermectin
|
|
Tetracyclines
|
doxycyclineminocycline
|
|
Other antibiotics
|
nitrofurantoin
|
|
Antiviral drugs-influenza
|
osteltamivir
|
|
protease Inhibitors
|
saquinavirritonavir
|
|
Carbapenems & Monobactams
|
aztreonam
|
|
Tx of HIVFusion inhibitors
|
enfuvirtide
|
|
Tx of HSV & VZV
|
acyclovirvalacyclovirfamciclovirpenciclovirfoscarnet
|
|
What is Adjacency List Representation of Graphs?
|
|
|
Hashing: How do the 3 operations (within a hashtable) work with linear probing?
NOTE: the 3 operations are search, insert & delete
|
|
|
Multi-way tree: Draw an example of what a multi-way tree would look like
|
|
|
Draw the rotations needed for this 'mirror" case (in this example the right right insert).
|
|
|
Draw the array implementation of a heap
|
|
|
REVIEW: Code a generic class Record to hold two generic values:
|
|
|
Draw the rebalancing of a mirror case where the insertion was "right-left" and a now has a balance of -2.
|
|
|
Draw a B-Tree where k = 5
(how many keys will there be?) (how many children will the tree have?)
|
|
|
B-Trees: How do you delete a key from a B-Tree (case 1 where k is in a leaf)?
(There are two cases - k may or may not be in a leaf)
|
|
|
What is an "in-order traversal" ?
Code an example
|
In-Order Traversal:
1. Process the left subtree
2. process the data in the root node
3. process the right subtree
CODE:
2. In-Order Traversal Example:
Void inOrder(Node P)
{
If(P != null)
{
inOrder(p.getLeft()); //left subtree
visit(p);
inOrder(p.getRight()); //right subtree
}
}
|
|
What are the two main operations (methods) of a queue?
|
1. Enqueue (insert)
2. Dequeue (remove & return)
|
|
What is an INDEXED SEQUENTIAL FILE?
|
A recrod file stores records:
-there are several fields
-one field (key) - uniquely identifies the record
Common implementation of indexed sequential file is using a B+ tree using sectors for nodes. And sector numbers as “pointers”.
|
|
Fill in the blanks:
Normally queues are implemented in BLANK and stacks are normally implemented in BLANK.
|
Normally queues are implemented in linked lists and stacks are normally implemented in arrays.
|
|
How is recursion implemented in JAVA
|
Programming languages, such as JAVA, support recursive thinking by permitting a method implementation to actually activate itself. In such cases, the method is said to use recursion.
|
|
Array stack: Code the "push" method for an Array implementation of stack
(remember "push" is to insert)
|
NOTE: this method uses the "StackException".
Code:
Public Class StackException extends Runtime Exception //make this a subclass of the class exception
{
Public StackException() {}
Public StackException(String message)
{
Super(message);
}
}
|
|
Linked Lists: What are some new operations to manipulate the "iterator" (e.g. the cursor)
|
There are three "public methods" that can be used with the cursor:
1. public void SetToFirst(); //Point the cursor to the first no in list
2. public Boolean hasNext(); //returns whether there is another string or not (another node)
3. public String Next(); //returns next unseen string and advances cursor
|
|
Hashing: Describe Hashing to Buckets (another open addressing method)
|
oDivide slots of a[] into groups called buckets and have h(key) be the number of a bucket:
I.E. to insert key first look for an empty slot in bucket h(key)
• Keys unordered in the bucket
“Collision resolution” now becomes “dealing with full buckets”
NOTE: we will still need tombstones here, if the bucket is full and you delete something from that bucket, don’t mark it as free, mark it as tombstone, that way if you go to bucket, and its not full, the tombstone will indicate you need to look somewhere else.
|
|
What are the two common ways of representing a graph in JAVA?
|
1. Adjacency Matrix
2. Adjacency Lists
|
|
Linked List Stack Implementation:
Code the methods to check if the linked list is empty and to clear the linked list
HINT: assume all this code is within the public class Stack
|
//method to check if linked list stack is empty
Public Boolean isEmpty()
{
Return sp ==null;
}
//method to clear linked list stack
Public void clear()
{
Sp = null;
}
|
|
Linked List Implementation of a Stack: Code the "push" method
HINT: you must create a new node first (you may use head node) and remember assume all this code is within your public class Stack.
|
} //end of StrNode inner class
private StrNode head;
public Stack()
{
head = null;
}
public void push(String dataName)
{
head = new StrNode(dataName, head);
}
//the code above will add a new node "push" a new node to the top of the stack.
|
|
B+Trees: Using a B+Tree to store employee records, whats an example of accessing data "directly" and "sequentially"
|
A B+Tree example to store employee records:
-Directly - have to update an individual record
-Sequentially - have to print a monthly list for payroll
|
|
What is the definition of "ancestor" in a binary tree structure
|
A node's parent is its first ancestor. The parent of the parent is the next ancestor...and so forth until you reach root. Root is an ancestor of each other node.
|
|
Code an example of the linked list constructor (create the head note and assign the value 42 to it, and there is no node after it).
|
...
IntNode head;
head = new IntNode(42, null);
....
|
|
Code an example of the linked list constructor (create the head note and assign the value 42 to it, and there is no node after it).
|
After these two statements, head refers to the head node of a small linked list that contains just one node with the number 42.
|
|
What is a multi way search tree? List the three main characteristics
|
1. A multi-way (or "n-way") search tree has nodes with n pointers (separated by) n number of keys.
2. A node can have up to n children
3. Keys should be arranged in ascending order
|
|
Hashing: What are the properties of a good hash function?
|
1. fast (and easy) to compute
2. minimize collisions
|
|
What is the definition of a "parent" in a binary tree structure
|
If a node "c" is the child of another node "p", we say that "p" is c's parent.
NOTE: every node has one parent - except for root, root has no parent.
|
|
What is the benefit of a post-order traversal through a binary tree?
|
(LEFT, RIGHT , ROOT)
The benefit is when you use a binary tree to evaluate expression trees.
Example:
Evaluate: (3+7) * (19-12)
(refer to figure)
(this is how compilers do arithmetic)
|
|
How do you do an insertion in an AVL?
|
o Do ordinary BST insert
o If result is not AVL (one or more nodes have b =, <> 2)
-If this is the case: REBALANCE THE TREE
-Primary operation in rebalancing is ROTATION
|
|
Linked Lists:
1. What is a way to give applications the ability to "traverse" lists? (NOTE: the application doesn't know what it is traversing: list, array, set of arrays, etc).
|
What we need is an "iterator". Therefore for the purposes of our string linked list, we will add a pointer, or a "cursor"
Code: Private StrNode cursor; //to use in traversals.
|
|
Hashing: what are the disadvantages of linear probing (and what is the solution)
|
1. It doesn't work! If you remove a key (so now you have an empty spot) then when you search for k, when it hits an empty spot, it will think it's search is done (not realizing there is more after the empty spot) and will insert k again (even though it might exist down the line) - FAIL
Solution: Tombstone
|
|
What is important to remember when implementing a queue as a linked list?
|
The queue will need a pointer at both the head of the list and the tail of the list, b/c action takes place in both locations.
NOTE: it is easier to remove a node from the head of the list (which we will now call "front")., adn we will add nodes to the tail end of the list (which we will now call "back").
|
|
What is the definition of a "subtree" in a binary tree structure
|
Any node in a tree also can be viewed as teh root of a new, smaller tree. The smaller tree contains the node we've picked as the new root and all of the new root's descendents. It is the subtree of the original tree.
|
|
What is the difference between a max heap and a min heap
|
o A Heap-shaped tree is a {max - / min -} heap if the value at each node is {>= / <= } the values at any children
E.g. A max heap if the value at each node is >= the values at any children
E.g. A min heap if the value at each node is <= the values at any children
o [Going forward “heap” will refer to “max heap”]
|