28
Apr
08
Time for two new C programs! At the DSA course I learned something about Hash Tables and collision resolutions.
I just implemented insert/search/print operations.
The first source code is an implementation of a Hash Map with open addressing (linear probing) as collision resolution method.
The following are the interesting functions of the program. As always, take a look at the source code for comments:
// hashMapLinear[] is the hash map
void linearProbingInsert
(int value
){
int probe = hash
(value
);
while (hashMapLinear
[probe
]!=
0){
probe = fmod
((probe
+1),SIZE_HASH_MAP
);
}
hashMapLinear
[probe
] = value;
}
int linearProbingSearch(int value){
int probe = hash(value);
int i;
for(i=0;i<size_hash_map ;i++){
if(hashMapLinear[probe]==value)
return TRUE;
probe = fmod((probe+1),SIZE_HASH_MAP);
}
return FALSE;
}
Download: hash-map-linear-probing.c
The second program is an implementation of a Hash Map with chaining as collision resolution method.
Interesting functions:
// t_hashTableNode is a struct that is created as single linked list
void chainedHashInsert
(int value
){
int probe = hash
(value
);
if(hashMapChained
[probe
] ==
NULL){
hashMapChained
[probe
] = malloc
(sizeof(t_hashTableNode
));
hashMapChained
[probe
]->value = value;
hashMapChained
[probe
]->next =
NULL;
}else{
t_hashTableNode *hashTableNode = hashMapChained
[probe
];
while(hashTableNode->next!=
NULL){
hashTableNode = hashTableNode->next;
}
hashTableNode->next = malloc
(sizeof(t_hashTableNode
));
hashTableNode->next->value = value;
hashTableNode->next->next =
NULL;
}
}
int chainedHashSearch(int value){
t_hashTableNode *hashTableNode = hashMapChained[hash(value)];
while(hashTableNode!=NULL){
if(hashTableNode->value==value){
return TRUE;
}
hashTableNode = hashTableNode->next;
}
return FALSE;
}
Download: hash-map-chaining.c
17
Apr
08
Tags:
msn,
sito,
Unibz Categories:
Misc
Conversazione su msn tra me e un’amica che usa il pc solo per scrivere documenti e archiviare foto (parole sue :D). Assolutamente fantastica!
15:27:18 Valeria: DANIEL AIUTO
15:27:18 Daniel: (Risposta automatica)Ciao, sono in pomodoro, scrivi pure, entro massimo 25 minuti risponderò. Se non sai cosa voglia dire, visita il sito http://www.tecnicadelpomodoro.it e informati, magari torna utile anche a te!
15:27:24 Valeria: NN MI SCARICA AZERUS
15:27:32 Valeria: *AZUREUS
15:27:34 Valeria: xk?!?!?!?!?!
15:27:57 Daniel: non ti scarica AUNUS oppure ACENTUM?
15:28:13 Daniel: proprio AZERUS scarica?
15:28:31 Valeria: sto cercando di installarlo
15:28:35 Valeria: ma nn me lo installa
15:28:45 Valeria: THE BUNDLED JRE IS CORRUPTED
15:28:48 Valeria: K CAZZO E’!?!?!?
15:29:20 Daniel: ti dice che la tua connessione ha dei problemi di criptatura,e molto probabilmente è perchè la telecom ti tiene sotto controllo :S
15:29:39 Valeria: COSA!??!?!?!
15:29:40 Daniel: dovresti regolare il minimo dalla centralina di carburazione del router.o del modem
15:29:43 Valeria: O GESU CRISTO
15:29:46 Valeria: STAI SKERZANDO?
15:29:50 Valeria: cmq io ho infostrada
15:29:59 Valeria: come faccio a regolarlo?
15:30:00 Valeria: oddio
15:30:47 Daniel: va beh,il tuo provider insomma..beh di solito,almeno nei computer vecchi,la centralina di carburazione è sotto la sedia,prova ad alzarti e guardare se puoi infilarci un cacciavite
15:31:06 Valeria: ho un portatile..
15:31:09 Valeria: asus…
15:31:11 Valeria: nuovo…
15:31:20 Valeria: da 3 giorni
15:31:31 Valeria: nn quello k hai visto in unibiblio
15:31:32 Daniel: allora è sotto al portatile!alzalo subito
15:31:40 Valeria: cosa devo fare?!!?
15:31:50 Daniel: alzarlo,il portatile.abbassarlo,il minimo
15:32:38 Valeria: ??????? EEEEH
15:32:44 Valeria: MA DOVE?
15:32:50 Daniel: ALZA IL PORTATILE
15:32:53 Daniel: sotto cosa c’è?
15:32:57 Valeria: la batteria
15:33:05 Daniel: ma come,ce l’hai staccata dal portatile???
15:33:17 Valeria: NO è SOTTO OVVIAMENTE
15:33:28 Daniel: ma sotto al portatile che cosa c’è?
15:33:38 Valeria: il tavolo!!!!!!!!!!!! k domande fai
15:33:48 Daniel: aaaah ma allora è tutto a posto,devi solo scaricarlo di nuovo
15:33:54 Valeria: AMMAZZATIIIIIIIIIII
15:33:58 Daniel: ahahahahahhaah
15:34:00 Valeria: IO K PENSAVO MALISSIMO
15:34:05 Valeria: OOOOOOOOOOOOOOOOOOOOOOOOOO
OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
OOOOOOOOOOOOOOOOOOOOOOOOOO
15:34:09 Daniel: ahhahahahahahahahhhahahahahhahahahah
ahahhahahahhaahahahahahhahahahahahahahahaaha
15:34:12 Valeria: hahahahha
15:34:13 Valeria: hahahaha
15:34:17 Valeria: hahahaha bella cmq, bella
Grazie Valli per aver alzato di 1000 punti il troppo basso umore degli studenti di Informatica dell’Unibz per questo pomeriggio <3
Ti vogliamo come mascotte di facoltà
17
Apr
08
For Programming Project course we’re adopting Scrum as software development process.
Scrum focuses on agile-like project management. The goal of Scrum is to deliver as much quality software as possible within a series of short intervals called Sprints. Scrum concentrates on identifying project variables (quality, time, requirements, etc.) and monitoring them constantly.
This process has been brought to our attention by prof. Pekka Abrahamsson, a guest professor that will stay with us until june.
I will update this page with new information as soon as they will be availabe.
These are the principal roles in Scrum:
Scrum Master: responsible for ensuring that the project is carried through according to the rules of Scrum and that it progesses as planned
Product Owner: responsible fot the project, managing and controlling. Makes the final decisions of the tasks related to a product backlog
Scrum Team: the project team that decides on the necessary actions and to organize itself in order to achieve the goals
Customer: participates in the tasks related to product backlog
Management: in charge of final decision making
Here is a nice model I drew yesterday, of the principal concepts of the Scrum method:

16
Apr
08

..is not stronger than what us unites..
..ti voglio bene Fra..