Skip to content

Instantly share code, notes, and snippets.

View blaineh's full-sized avatar

Blaine Hauglie blaineh

View GitHub Profile
@blaineh
blaineh / Reversed Linked List C#
Created October 29, 2011 20:07
Defined linked list --> Reversed
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
//Class program is our naming convention.
//Capitalize classes and not functions.
//Node head is the start of the linked list.
//Next points to the next node in the list.
@blaineh
blaineh / Reverse List C#
Created October 29, 2011 18:59
Is this a good method?
Void Reverse (Node head)
{
Node prev= null;
Node current = head;
Node nextNode = null;
while (current!=null)
{
nextNode = current.Next;
current.Next = prev;
@blaineh
blaineh / ListBlaine
Created October 27, 2011 04:47
List VB.NET
Sub Main()
Dim list As ICollection(Of String) = New LinkedList(Of String)
list.Add("Blaine" & Environment.NewLine)
list.Add("Likes" & Environment.NewLine)
list.Add("Beer" & Environment.NewLine)
For Each word In list
Console.Write(word & " ")
Next
Console.WriteLine()
@blaineh
blaineh / ReverseHW C#
Created October 22, 2011 20:20
Reverse Hello world C#
//namespace names this object.
namespace blaine
{
class helloworld
{
//Every program starts with a Main method.
//Static indicates that you can access this method without having an object of your class available.
//void indicates to the compiler that your method will not return a value to the calling method.
static void Main()
{