Complete List of Terms and Definitions for inf2c

Terms Definitions
Fluoroquinolines moxifloxacin
Cephalosporins cefazolincephalexincefoxitincefotetanceftazidimecefotaximeceftriaxonecefdinircefepime
NRTI zidovudinelamivudineabacavirtenofovir
Fusion inhibitors enfuvirtide
Antiprotozoal drugs pentamidine
Other antibiotics vancomycinclindamycinlinezolidquinupristin- dalfopristintrimethoprim - sulfamethoxazolenitrofurantoin
Tx of CMV ganciclovirvalganciclovirfoscarnetfomivirisen
antifungal drugs amphotericin Bnystatinfluconazolemiconazoleclotrimazoleitraconazolevoriconazolecaspofunginflucytosine (5-FC)terbinafinegriseofulvintolnaftate
Penicillins penicillin Gpenicillin VKprocaine penicillin Gbenzathine pen Goxacillinnafcillincloxacillindicloxacillinampicillinamoxicillinticarcillinpiperacillin
Hashing: Code the override statement for the hashCode and equals methods inherited from Object:
Stack - Array Implementation: code methods to check if the stack is empty (isEmpty()) and to clear the stack (clear()).
Graphs: Draw an example of the adjacency matrix for the following graph:
Hashing: What are the operations for separate chaining?
How do you code the array implementation of a stack?

(just the constructor - no methods)
Hashing: Code the Insert method of a hashtable (using separate chaining and records):
An insertion occured in an AVL Tree "left-right" draw the steps to rebalance this tree:
Binary Tree - Code the Binary tree using int
Hashing: Depict "separate chaining" visually: Allocate memory dynamically for each new key, store in the list at a[h(key)]
Code the constructor for the IntNode.

Note: include what the parameters are and the postcondition.
Constructor for the IntNode:

public IntNode(int initialData, IntNode initial link)

-initialData - the initial data of this new node
-initialLink - a reference to the node after this new node (the reference may be null to indicate that there is no node after this new node)

This new node contains the specified data and link to the next node.
Code the constructor for the IntNode.

Note: include what the parameters are and the postcondition.
The constructor's implementation copies its two parameters to the instance variables data and link:

public IntNode(int initialData, IntNode initialLink)
data = initialData;
link = initialLink;
Queue Linked List Implementation:

Code the method to get the node at the front of the queue, and will return null if queue is empty ("whoisNext()")

HINT: Assume the creation of the "front" and "back" nodes has been coded an
} //end of node inner class

Returns the String in the front of the queue. Returns null if the queue is empty

public String whoIsNext()
if (front == null)
return null;
How would you write the stackunderflow exception? Public class StackUnderFlowException extends RuntimeException
Public stackUnderFlowException()
{ } //will do nothing – just to invoke the exception method

Public stackUnderFlowException(String message)
Binary Tree - code using generic nodes: public class BinTree<T>
public class BinNode<T>
private T data;
private BinNode<T> left;
private BinNode<T> right;
//end of BinNode inner class
private BinNode<T> root; //only field
<Then some methods here>

Code the example of the BST implementation of a table, assuming the "BST<T extends comparable<T>>" class is written and the private inner "Entry" class is written too.

(No operations yet)
Public class Table<k.extends Comparable<k>, v>
//private inner class Entry is in here
//something to store the tables in – an instance of BST:
Private BST<Entry<k,v>> tree
=new BST<Entry<k,v>>();
//don’t need a constructor – the default constructor is fine – which constructs an empty table

<methods for 3 table operations: search, insert, delete go here>
What is a transaction system? A transaction system is a computer system (or application) in which operations are short, involve little computation, but each operation requires at least one database access
-Transaction systems (among others) require FAST, DIRECT, access to individual records BY KEY.
Graphs: What is a graph? o We want to generalize lists and trees
o But now instead of using “nodes & pointers” we will use….
o Definition: a graph G is a pair (V,E), of a vertex set (finite)
-V and the edge set E is a set of unordered pairs (v, w) of vertices

oNotice the pairs are unordered, so (v0, v1) and (v1,v0) represent the same edge

BOOK: A graph, like a tree, is a nonlinear data structure consisting of nodes and links between the nodes. Graph nodes can be linked in any pattern - or lack of pattern - depending on the needs of an application.
Generic Nodes: Convert the original StrNode class to a generic node class:

public class StrNode
private String data; //contains node data

private StrNode next; //contains "link" to next node
New Generic Node Class:

public class GNode<T>
private T data; //data in node
private GNode<T> next; //contains link to next node
Hashing; Describe the clustering issue with linear probing There is a problem with linear probing. When several different keys are hashed to the same array location, the results is a small cluster of elements, one after another. As the table approaches its capacity, these clusters tend to merge into larger and larger clusters.
What are the three operations of a heap? pushDown, pushUp, and BuildHeap

NOTE:you need PushDown for BUildHeap)
Linked List Methods: What does the getData() accessor method return?

Write the code for an example
The getData accessor method returns the data from this node.

Book Code Example:
Public int getData()
return data;

Class Code Example:
Public String getData() //note: only diff. is the string type
return data;
Draw graphically how you would test for an empty array implementation of a queue. NOTE: To account for wraparound, reduce it mod size (as seen above: % size)
Draw the result of this right rotation around N.

Is the tree balanced now?
Yes it is balanced now.
What is a linked list? A linked list is a sequence of elements arranged one after another, with each element connected to the next element by a "link"
What is a heap? - a binary tree is heap-shaped if two conditions hold:
o Except possibly for the lowest level the tree is complete (all of the non-leaf nodes have two children)
oThe lowest row is “left-most”
Graphs: What is an adjacency matrix An adjacency matrix is a square grid of true/false values that represent the edges of a graph. If the graph contains n vertices, then the grid contains n rows and n columns. For two vertex numbers i and j, the component at row i and column j is true if there is an edge from vertex i to vertex j; otherwise, the component is false.
What is the benefit of a pre-order traversal through a binary tree? (ROOT, LEFT, RIGHT)
The benefit of using this traversal is when you write a binary tree to a file and read it back.
What is the JAVA system stack? The system stack is a real life example of stack in JAVA

In JAVA when you have a class and you have methods that call methods that call methods, the program knows where to return once it’s completed a method by an address.

If the addresses are overwritten the program will be caught in an infinite loop.

Thus return addresses should always be stored in a stack.

This is always in the background – where we have the system stack which will be used for return addresses.
Graphs: What is an undirected graph? An undirected graph is a set of nodes and a set of links between the nodes. Each node is called a vertex, each link is called an edge, and an edge connects two vertices.

Undirected graphs are drawn by putting a circle for each vertex and a line for each edge.
What is the definition of a "sibling" in a binary tree structure Two nodes are siblings if they have the same parent.
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.
B+Trees: Explain how B+Trees are used to store records If we want to store records, by using a B+Tree, each record will have a unique key.

1. We will store entire records in the data part (leaves), but KEYS ONLY in index part (non-leaves)
2. All of our data will be found in the data part (leaves)
3. Index provides a quick way to locate records given it's key.

4. THE LAST and MOST IMP. PART is that we will make the data part linked lists (add a pointer to each leaf and make the data part a singly linked list)

THUS now we have 2 ways to access records: Directly from key using index part OR sequentially through linked list.
B+Trees: What are the main differences with a B+Tree (in comparison to a B-Tree)? 1. For any key in a non-leaf it will also be the LAST key in the left child (ALLOWING FOR DUPLICATE KEYS)
2. Now we see that every key that appears ANYWHERE in the tree (also) appears exactly ONCE in a leaf
3. The tree is now divided into 2 parts, the leaves (data part) and non-leaves (index part)
CODE: An example of a BST "Table Implementation"

ASSUME: that "BST<T extends comparable<T>>" class is written.

FIRST - we know that a table must store key, value pairs, but BST stores only one data field. What is the solu
We will need to create a new class "entry" which glues together a key and a value.

public class Table<k extends comparable<k>,v>
/**first lets code private inner class "entry"
public class Entry<K extends comparable<k>,v> implements comparable(Entry<k,v>>
private k key; //key field
private v value; //value field
public entry (K k, V v) //constructor
key = k;
value = v;

<Some GET and SET Methods HERE>
} //end inner class Entry
Write an example where you use try catch blocks for stack over/under flow exceptions: Int a, b;
a = d.pop(); //get arguments from stack
b = d.pop(); //either pop will cause issue if stack is not there or empty
catch(StackUnderflowException e)
System.out.println(“Warning! Stack Underflow”);

Catch(StackOverFlowException e)
System.out.println(“Warning! Stack Overflow”);
How do we insert a new node at the head of a linked list? NOTE: if we had already declared and assigned the head node, then a simpler way to do this would be:

head = new StrNode("Betsy", head);

//basically we are saying "make head refer to the newly created node"
How do we add a new node that is not the at the head? Don't forget you have to perform a search first ("target") (refer to side 3). However, once you do the code above will allow you to "re-route" the linked list.
How do we add a new node that is not the at the head? remember you have to search the list first:

Private strnode search (string target)
StrNode ptr = head;
While (ptr != null && !target.equals (ptr.getData() )
Ptr = ptr.getnext(); //advance to next node
If ptr != null //found target
Return ptr;
Return null; //target not found in the list