Skip to content

Instantly share code, notes, and snippets.

package com.exercises.main;
import java.util.Scanner;
/**
* @author Mohamed Ennahdi El Idrissi
*
*
* This program does the following:
* - Reading the size (int) of the array from the keyboard;
* - Reading each element of the array from the keyboard;
package com.blogspot.mohalgorithmsorbit.equation;
/**
*
* @author Mohamed Ennahdi El Idrissi
*
*/
public class Equation {
int n;
int base;
//*******************************************************************
// File: HuffmanEncoding.c
// Author(s): Mohamed Ennahdi El Idrissi
// Date: 14-Aug-2012
//
// Input Files: in.txt
// Output Files: out.txt
// Description: CSC 2302 - <Data Structures>
// <Struct, Array, File I/O, Recursion, Pointers, Binary Tree>
// This program covers the Huffman Encoding concept.
package com.exercises.test;
import java.util.Random;
import com.exercises.main.EvaluationExercise;
public class EvaluationExerciseTest {
/**
* Unit testing of a random number of cases.
@mohamed-ennahdi
mohamed-ennahdi / TwosComplementBinaryMultiplication.c
Created February 24, 2014 03:48
Two's Complement Binary Multiplication
//*******************************************************************
// File: TwosComplementBinaryMultiplication.c
// Author(s): Mohamed Ennahdi El Idrissi
// Date: 06-Aug-2012
//
// Input Files: NONE
// Output Files: NONE
// Description: CSC 2304 - <Computer Architecture and Organization>
// <Computer Arithmetic>
// This program implements the Two's Complement Binary Multiplication algorithm
@mohamed-ennahdi
mohamed-ennahdi / TwosComplementBinaryDivision.c
Created February 24, 2014 03:49
Two's Complement Binary Division
//*******************************************************************
// File: TwosComplementBinaryDivision.c
// Author(s): Mohamed Ennahdi El Idrissi
// Date: 06-Aug-2012
//
// Input Files: NONE
// Output Files: NONE
// Description: CSC 2304 - <Computer Architecture and Organization>
// <Computer Arithmetic>
// This program implements the Two's Complement Binary Division algorithm
@mohamed-ennahdi
mohamed-ennahdi / IEEE754NumberConversion.c
Created February 24, 2014 03:52
IEEE 754 Number Conversion
/*
* Mohamed Ennahdi El Idrissi
* CSC 2304 - Computer Organization and Architecture
*
* Converting a given number:
* - from Real Number to IEEE 754
* - from IEEE 754 to Real Number
*/
#include <stdio.h>
#include <math.h>
@mohamed-ennahdi
mohamed-ennahdi / UnsignedBinaryDivision.c
Created February 24, 2014 03:53
Unsigned Binary Division
//*******************************************************************
// File: UnsignedBinaryDivision.c
// Author(s): Mohamed Ennahdi El Idrissi
// Date: 06-Aug-2012
//
// Input Files: NONE
// Output Files: NONE
// Description: CSC 2304 - <Computer Architecture and Organization>
// <Computer Arithmetic>
// This program implements the Unsigned Binary Division algorithm
@mohamed-ennahdi
mohamed-ennahdi / UnsignedBinaryMultiplication.c
Last active August 29, 2015 13:56
Unsigned Binary Multiplication
//*******************************************************************
// File: UnsignedBinaryMultiplication.c
// Author(s): Mohamed Ennahdi El Idrissi
// Date: 06-Aug-2012
//
// Input Files: NONE
// Output Files: NONE
// Description: CSC 2304 - <Computer Architecture and Organization>
// <Computer Arithmetic>
// This program implements the Unsigned Binary Multiplication algorithm
@mohamed-ennahdi
mohamed-ennahdi / HuffmanEncoding(ContestVersion).c
Created February 24, 2014 03:59
A contest Huffman Encoding Problem. This solution is expensive from an algorithm analysis perspective (unsuitable data structure preliminary choice). However, the algorithm is worth it.
#include <stdio.h>
#define N 26
/*
* This structure gathers the elements (letters) and their frequency.
*/
typedef struct {
char sourceAlphabet[N];
unsigned frequency;
} Symbol;