Algorithm: added heap and queue implementation for long and generic.