DATA STRUCTURE
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

DATA STRUCTURE
Assignment 3 - Array and Structures
Problem 1. Polynomial implementation.
a)
b)
c)
d)
e)
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

DATA STRUCTURE
Assignment 2 - Algorithm Analysis
Problem 1. Show that:
a. 4n2 + 7n + 1 = O(n2)
b. n2 3n + 1 =
(n)
c. log(2n + k) = (log(n), where k is a constant
n
d.
log(i) = O(n log(n)
i =1
Problem 2. Analyze the worst-case running time of the followin

DATA STRUCTURE
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
direction;
implement the stack;
define the data struct

DATA STRUCTURE
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,
quick s

DATA STRUCTURE
Assignment 5 - Linked List
Problem 1. Polynomial representation.
Suppose we represent a polynomial as follows:
typedef struct PolyNode *PolyPointer;
struct PolyNode cfw_
float coef;
int expon;
PolyPointer link;
;
You have to implement the f

DATA STRUCTURE
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

DATA STRUCTURE
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