原创 各種sorting總結
Selection sort: 1. Divide the input into two part: sublist of items already sorted and sublist of items to be sorted. 2
原创 Affinity propagation for clustering
Basic idea: message passing. Number of clusters automatically determined. 2 matrices to be updated: responsibility R an
原创 Reverse linked list
1. Iterative public void reverse(head){ ListNode current, prev, next; current = head; prev = null; whil
原创 實例理解EM算法
一篇Nature子刊的文章,給了一個很好的例子,如圖: What is the expectation maximization algorithm? Nature Computational Biology
原创 公式測試
public void reverse(head){ ListNode current, prev, next; current = head; prev = null; while(current!=
原创 Linkedlist和Array實現Stack
LinkedList實現Stack public Class Stack<Item>{ private Node first = null; private class Node{ Item item; Node next;
原创 Single Number I and II, 數組裏找出沒重複的數
1. 一個數組中,除了一個元素以外其他每個數組都出現兩次,找出這個單獨出現一次的數。 Given an array of integers, every element appears twice except for one. Fin
原创 Linkedlist實現Queue
public class Queue{ private Node first; private Node last; private class Node{ Item item; Node next; } public