Skip to content

Instantly share code, notes, and snippets.

@olupotd
olupotd / sources.list
Created February 17, 2014 20:09
A sources list file for 12.04 ubuntu default
deb http://archive.ubuntu.com/ubuntu precise main universe restricted multiverse
deb http://archive.ubuntu.com/ubuntu precise-security universe main multiverse restricted
deb http://archive.ubuntu.com/ubuntu precise-updates universe main multiverse restricted
deb http://archive.ubuntu.com/ubuntu precise-proposed universe main multiverse restricted
@olupotd
olupotd / openGl_installer.sh
Created December 19, 2013 14:01
OpenGL installation
#!/usr/bin/sh
sudo apt-get update
#OpenGL:
sudo apt-get install libglu1-mesa-dev freeglut3-dev mesa-common-dev
#OpenAL:
sudo apt-get install libopenal0a libopenal-dev
#ALUT:
sudo apt-get install libalut0 libalut-dev
@olupotd
olupotd / Listing
Created December 5, 2013 16:58
Linked List
import java.util.*;
public class Listing {
LinkedList ll = new LinkedList();
Listing()
{
//adding an item to the list
l.add(3);
l.add(2);
@olupotd
olupotd / Binary
Created December 5, 2013 15:12
Binary Search
#include <stdio.h>
int main()
{
int c, first, last, middle, n, search, array[100];
printf("Enter number of elements\n");
scanf("%d",&n);
@olupotd
olupotd / Insertion
Created December 5, 2013 14:45
Insertion Sort in Brief
Here's the algorithm for this type of sort. please implement it also
so that you can learn. Thanks.
function insertionSort(array A)
for i from 1 to length[A]-1 do
value := A[i]
j := i-1
while j >= 0 and A[j] > value do
A[j+1] := A[j]
j := j-1
@olupotd
olupotd / Selection
Created December 5, 2013 14:41
Selection Sort in C
#include <stdio.h>
int main()
{
int array[100], n, c, d, position, swap;
printf("Enter number of elements\n");
scanf("%d", &n);
@olupotd
olupotd / BubbleSort
Created December 5, 2013 14:36
Bubble Sort in C
#include<stdio.h>
int numb[8];
int i, j, temp;
int main(int argc, char* argv[])
{
//populate the array
while(i < sizeof(numb)){
numb[i] = i+2;
@olupotd
olupotd / Bubble
Created December 5, 2013 14:31
Bubble sort in C++
#include<iostream>
using namespace std;
int numb[20];
int i (0), j (0), temp;
int main(int argc, char* argv[])
{
while(i < sizeof(numb)){
numb[i] = i+2;
@olupotd
olupotd / Simple
Last active December 30, 2015 08:49
A much simpler version of the Whole Application. Data structures
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.apache.commons.lang3.ArrayUtils;
/*
NB You shall need the org.apache.commons library installed on your system.
Get it from here or run this http://github.com/olupotd/installApache.sh script
like this if you are using Linux.
wget -c http://mirror.ucu.ac.ug/apache//commons/lang/binaries/commons-lang3-3.1-bin.tar.gz && tar -zxvf commons-lang3-3.1-bin.tar.gz
Go to your project properties and add it to them or just paste the jar files in your libs files in the Java Folder.
@olupotd
olupotd / DataStructures
Last active December 30, 2015 08:39
Simple Data Structures and Algorithms implementation
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class DataStructures {
//declared an array of
Object[] orderedList = {20,45,51,78,84,91,98};
int[] elems = {10,15,77,92,200};
List<Integer> list = new ArrayList<Integer>();