Skip to content

Instantly share code, notes, and snippets.

@ariyike
ariyike / client.c
Last active May 8, 2019 15:51
A client coded in C to communicate with a server and send messages
#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <netdb.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <arpa/inet.h>
@ariyike
ariyike / InterfaceQueue.java
Last active June 13, 2018 08:01
A Queue Interface specifying operations and its implementations
package pkgclass.projects;
/**
*
* @author Student
* @param <E>
*/
public interface InterfaceQueue<E> {
//inserts new element to end of queue
@ariyike
ariyike / TowerOfHanoi
Last active June 5, 2018 09:15
This code models the Tower of Hanoi games by playing it in the optimal number of moves for any given number of discs and output the number of moves.
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package pkgclass.projects;
/*package whatever //do not write package name here */
import java.util.Stack;
@ariyike
ariyike / IsBalanced.java
Last active June 5, 2018 09:21
This is a stack implementation problem which checks that with any given String from input and checks it for brackets and verifies that each bracket is closed(Hence the balance)
package pkgclass.projects;
import java.util.HashMap;
import java.util.Objects;
import java.util.Stack;
/**
*
* @author Morema and Ariyike
*/