Skip to content

Instantly share code, notes, and snippets.

Avatar

Samuel Santos samueltcsantos

View GitHub Profile
@samueltcsantos
samueltcsantos / bissexto.txt
Created Feb 18, 2015
Algoritmo para verificar se o ano é bissexto.
View bissexto.txt
algoritmo "bissexto"
// Função : Bissexto - Um ano é bissexto se ele for divisível por 400 ou se ele
// for divisível por 4 e não por 100.
// Bissexto: 1980, 1984, 1988, 1992, 1996 e 2000.
// 1900 não foi bissexto, mas 1600 foi
// Autor : Samuel T. C. Santos
// Data : 18/02/2015
// Seção de Declarações
var
ano : inteiro
View index.html
<div id="issuu-widget">
</div>
<script type="text/javascript" src="/wp-includes/js/swfobject.js"></script>
<script type="text/javascript">
function loadIssuuWidget(result) {
var doc = result.response.docs[0];
var link = jQuery('<a />').attr({
href: 'http://issuu.com/browndailyherald/docs/' + doc.docname,
@samueltcsantos
samueltcsantos / ArrayListTest.java
Created Feb 5, 2015
Testing the ArrayList implementation.
View ArrayListTest.java
package adt.list;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import org.junit.Before;
import org.junit.Test;
/**
* Testing the ArrayList implementation.
@samueltcsantos
samueltcsantos / ArrayList.java
Created Feb 5, 2015
List implementation based on array
View ArrayList.java
package adt.list;
/**
* List implementation based on Array.
*
* @author Samuel T. C. Santos
* @version 1.0
*
* @param <E>
*/
public class ArrayList<E> implements List<E> {
View List.java
package adt.list;
/**
* A simplified version of the java.util.List interface.
*
* @author Samuel T. C. Santos
* @version 1.0
*
*/
public interface List<E> {
@samueltcsantos
samueltcsantos / mergesort.py
Created Feb 4, 2015
Mergesort recursive implementation in python
View mergesort.py
""" Merge Sort Algorithm
Author : Samuel T. C. Santos
version python 3.x
"""
"""
Method that perform the merge operation with two lists.
"""
def merge(left, right):
View mergesort.txt
> python mergesort.py
[2, 0, 9, 6, 4, 3, 5, 8, 1, 7]
[2, 0, 9, 6, 4]
[2, 0]
[2]
[0]
Merged [0, 2]
[9, 6, 4]
[9]
View DequeUnderflowException.java
package adt.deque;
/**
* When the Deque is Empty.
*
* @author Samuel T. C. Santos
* @version 1.0
*/
@SuppressWarnings("serial")
public class DequeUnderflowException extends Exception {
View DequeOverflowException.java
package adt.deque;
/**
* When the deque is full.
*
* @author Samuel T. C. Santos
* @version 1.0
*
*/
@SuppressWarnings("serial")
@samueltcsantos
samueltcsantos / ArrayDeque.java
Created Feb 4, 2015
ArrayDeque my own Implementation in Java
View ArrayDeque.java
package adt.deque;
/**
* Implementing a Deque with a Circular Array.
*
* @author Samuel T. C. Santos
* @version 1.0
* @param <E>
*/
public class ArrayDeque<E> implements Deque<E> {