Asignatura: Estructuras de Datos · UAH GII · Curso 2025-26
Design and implementation of fundamental data structures in C using dynamic memory allocation. Analysis of time and space complexity for each structure.
| Structure | Operations | Complexity |
|---|---|---|
| Linked lists (simple, double, circular) | Insert, delete, search, reverse | O(n) search, O(1) insert at head |
| Stacks (LIFO) | push, pop, peek, isEmpty | O(1) all operations |
| Queues (FIFO) | enqueue, dequeue, front | O(1) all operations |
| Binary trees | insert, search, traversals (pre/in/post) | O(log n) avg, O(n) worst |
| Binary search trees | insert, delete, search | O(log n) avg |
| Hash tables | insert, search, delete, collision handling | O(1) avg |
| # | Name | Description |
|---|---|---|
| P1 | Editorial order system | editorial-orders — FIFO queue + LIFO stack with dynamic linked nodes. Order management system for a publishing house |
// Node allocation
typedef struct Node {
int data;
struct Node* next;
} Node;
Node* createNode(int value) {
Node* node = (Node*)malloc(sizeof(Node));
if (!node) { perror("malloc failed"); exit(1); }
node->data = value;
node->next = NULL;
return node;
}
// Always free after use
void destroyList(Node* head) {
Node* current = head;
while (current) {
Node* next = current->next;
free(current);
current = next;
}
}