Wednesday, May 4, 2011

class Node
{
Node next;
int element;
}

class SinglyLinkedList
{
Node head, tail;
int size;
// methods go here
}

Node remove(int value)
{
Node cur = head;
while (cur != null && cur.next != null &&  cur.next.value != value)
cur = cur.next;

cur.next = cur.next.next;
}

void swap(Node x, Node y)
{
int temp;
temp = x.value;
x.value = y.value;
y.value = temp;
}

Date and Time for the Final

Monday, May 23, 8:30 PM- 10:30 PM

they had messed up AM and PM.

Monday, May 2, 2011

All the midterms are graded

However, there is a pile of graded midterms I still need to locate. So check BlackBoard, and you may see your grade there. If not, sorry -- I'll post them just as soon as I have opportunity to search.

The grades are out of 5. Multiply that by 20 to get your score. This is uncurved. Any curve, assuming there is one, will be applied at the end of the semester.

Tuesday, April 5, 2011

Open House Tomorrow - Master's Degrees in Information Systems and Web & Multimedia Design



Touro College 
Graduate School of Technology 
Master’s Programs in: 

  • Information Systems
      Concentrations in:
    • Database Systems
    • Data Communications
    • Technology Leadership
  • Web & Multimedia Design

OPEN HOUSE 
Wednesday, April 6 
6:30pm 
43 West 23rd St, 2nd fl. 
(bet. 5th & 6th Ave.) 
New York City 
Light dinner served 

Please RSVP 
http://www.touro.edu/gst/ 

212.463.0400 x 5462 
info.gst@touro.edu 

Why Choose the Graduate School of Technology? 
- 33 Credit Program 
- Weekend and Evening Classes 
- Scholarships Available 
- Job Placement Assistance 
- Retool Your Skills 
- Gain a Competitive Edge 
- Retrain for a Field in High Demand 
- Find New Career Opportunities 

Monday, March 28, 2011

HW #3

None of these are due until after the midterm.

3.1 Implement Djikstra's Shunting-yard algorithm, to convert from Infix to Reverse Polish Notation (Postfix).
3.2 Using Binary expression trees, convert from RPN to Infix, using the algorithm described in this link.
3.3 Evaluate a RPN expression using a stack. I'll describe how to do this in class.

Wednesday, March 23, 2011

Monday, March 21, 2011

lecture

void print(char *s)
{
if (*s == NULL)
return;
cout << *s;
print(s + 1);
}

void print(int a[], int start, int end)
{
if (start > end)
return;
cout << a[start] << ", ";
print(a, start + 1, end);
}

main()
{
int X[5] = {1, 4, 5, 7};
print(X, 0, 3);
}

HW:
take the map of letters to bitstrings and use it to encode
your text

The cat in the hat

step 1: make one big string of 1s and 0s. concatenation.
say, a for loop through "The cat in the hat", each time, concatenating a[i] to previous string.

step 2: divide strlen by 8 to find size to allocate
byte buffer = new byte[properSize]

step 3: loop through each 8 bits to create a byte. assign
the byte to the proper slot. as you read each "bit", if it is "0", bitshift to left and dont do anything. if it is "1", bitshift to left and bitwise or it with 1.

"0110110"

byte b = 0;
if current is 0:
 b = (b << 1)
else if current is 1:
 b = (b << 1) | 1;

after 8 bits, write it into position buffer[i] and increment i;

going forward, what do we want to store?
a) huffman tree
b) size
c) buffer

we will want to serialize it.
but not yet.