Assignment 1 - C Review
Problem 1. We want to get n real numbers and compute the average of the positive
numbers. We know that n is less than 1000 and some numbers are very small (< 0.01). We
will resolve this problem by three different app
Assignment 3 - Array and Structures
Problem 1. Polynomial implementation.
Define the data structure to represent a polynomial.
Implement the algorithms to read and to print a polynomial.
Implement the algorithm to add two pol
Assignment 2 - Algorithm Analysis
Problem 1. Show that:
a. 4n2 + 7n + 1 = O(n2)
b. n2 3n + 1 =
c. log(2n + k) = (log(n), where k is a constant
log(i) = O(n log(n)
Problem 2. Analyze the worst-case running time of the followin
Assignment 4 - Stacks and Queues
Problem 1. Maze search problem.
Implement the maze problem. You should:
define the data structure for each element of the maze including row, column and
implement the stack;
define the data struct
Assignment 8 - Sorting
Problem 1. Empirical analysis of sorting algorithms.
We want to analyze empirically the sorting algorithms. You have to:
implement the following sorting algorithms: insertion sort, selection sort, bubble sort,
Assignment 5 - Linked List
Problem 1. Polynomial representation.
Suppose we represent a polynomial as follows:
typedef struct PolyNode *PolyPointer;
struct PolyNode cfw_
You have to implement the f
Assignment 7 - Graphs
Problem 1. Suppose an oriented graph is stored in a text file by using adjacency matrix.
a) Define the data structure representing the graph by adjacency lists.
b) Create the adjacency list from the adjacency matrix re
Assignment 6 - Trees
Problem 1. Binary Expression Tree.
We can represent an expression by a binary tree in which:
Each leaf node contains a single operand;
Each non-leaf node contains a single binary operator;
The left and right sub-trees o