Docsity

Prototipi esame algoritmi e programmazione Polito, Prove d'esame di Algoritmi E Programmazione Avanzata

Toggle sidebar
bg1
Item.h
Key KEYget(Item val);
Key KEYGet (Item *pval);
int KEYeq(Key k1, Key k2);
int KEYless(Key k1, Key k2);
int KEYgreater(Key k1, Key k2);
int KEYcompare(Key k1, Key k2);
Key KEYscan();
Item ITEMsetvoid();
Item ITEMrand ();
void ITEMshow (Item val);
int ITEMless (Item val1, Item val2);
int ITEMgreater (Item val1, Item val2);
int ITEMcheckvoid(Item val);
Item ITEMscan();
Item ITEMfscan(FILE *file);
void ITEMfree(Item val);
Item ITEMchange();
List.h
link NEWnode(Item val, link next);
void LISTinshead(LIST l, Item val);
link LISTinstail(link head, Item val);
link LISTinstail(link head, Item val);
ITEM LISTsearch(link head, Key k);
link LISTdelhead(link h);
ITEM LISTextrheadP(link *hp);
link LISTdelkey(link h, Key k);
link LISTdelkeyR(link x, Key k);
ITEM LISTextrkeyP(link *x, Key k);
link LISTsortins(link h, ITEM item);
ITEM LISTsortsearch(link h, Key k);
link LISTsortdel(link h, Key k);
void LISTshow(link h);
void LISTfree(link h);
Set.h
SET SETinit (int maxN);
Void SETfill (SET s, Item val);
Int SETsearch (SET s, Key k);
SET SETunion (SET s1, SET s2);
SET SETintersection (SET s1, SET s2);
Int SETsize(SET s);
Int SETempty (SET s);
Void SETdisplay (SET s);
pf3
pf4

Anteprima parziale del testo

Scarica Prototipi esame algoritmi e programmazione Polito e più Prove d'esame in PDF di Algoritmi E Programmazione Avanzata solo su Docsity!

Item.h Key KEYget(Item val); Key KEYGet (Item *pval); int KEYeq(Key k 1 , Key k2); int KEYless(Key k 1 , Key k2); int KEYgreater(Key k 1 , Key k2); int KEYcompare(Key k 1 , Key k2); Key KEYscan(); Item ITEMsetvoid(); Item ITEMrand (); void ITEMshow (Item val); int ITEMless (Item val1, Item val2); int ITEMgreater (Item val1, Item val2); int ITEMcheckvoid(Item val); Item ITEMscan(); Item ITEMfscan(FILE *file); void ITEMfree(Item val); Item ITEMchange(); List.h link NEWnode(Item val, link next); void LISTinshead(LIST l, Item val); link LISTinstail(link head, Item val); link LISTinstail(link head, Item val); ITEM LISTsearch(link head, Key k); link LISTdelhead(link h); ITEM LISTextrheadP(link *hp); link LISTdelkey(link h, Key k); link LISTdelkeyR(link x, Key k); ITEM LISTextrkeyP(link *x, Key k); link LISTsortins(link h, ITEM item); ITEM LISTsortsearch(link h, Key k); link LISTsortdel(link h, Key k); void LISTshow(link h); void LISTfree(link h); Set.h SET SETinit (int maxN); Void SETfill (SET s, Item val); Int SETsearch (SET s, Key k); SET SETunion (SET s1, SET s2); SET SETintersection (SET s1, SET s2); Int SETsize(SET s); Int SETempty (SET s); Void SETdisplay (SET s);

BST.h BST BSTinit(); void BSTfree (BST bst); int BSTcount (BST bst); int BSTempty (BST bst); Item BSTsearch(BST bst, Key k); Item BSTmin(BST bst); Item BSTmax(BST bst); void BSTinsert_leafR(BST bst, Item x); void BSTinsert_leafI(BST bst, Item x); void BSTinsert_root(BST bst, Item x); void BSTvisit (BST bst, int strategy); link rotR(link h); link rotL(link h); link partR (link h, int r); void BSTdelete (BST bst, Key k); Item BSTselect (BST bst, int r); Item BSTsucc (BST bst, Key k); Item BSTpred (BST bst, Key k); IBST.h void IBSTinit(IBST ibst); void IBSTfree (IBST ibst); void BSTinsert (IBST ibst, Item x); void IBSTdelete (IBST ibst, Item x); Item IBSTsearch (IBST ibst, Item x); Int IBSTcount (IBST ibst); int IBSTempty (IBST ibst); void IBSTvisit (IBST ibst, int strategy); PQ.h PQ PQinit(int maxN); void PQfree (PQ pq); int PQempty(PQ pq); void PQinsert(PQ pq, Item val); Item PQextractMax(PQ pq); Item PQshowMax(PQ pq); void PQdisplay(PQ pq); int PQsize(PQ pq); void PQchange(PQ pq, Item val); void PQchange(PQ pq, int pos, Item val); UF.h void UFinit (int N); void UFfind (int p,int q); void UFunion (int p,int q);

Graph.h Graph GRAPHinit(int V); void GRAPHfree(Graph G); Graph GRAPHload(FILE *fin); void GRAPHstore(Graph G, FILE fout); void GRAPHgetIndex(Graph G, charlabel); void GRAPHinsertE(Graph G, int id1, int id2, int wt); void GRAPHremoveE(Graph G, int id1, int id2); void GRAPHshow(Graph G); void GRAPHedges(Graph G, Edge *a); void insertE(Graph G, Edge e); void removeE(Graph G, Edge e); int randV(Graph G); Graph GRAPHrand1(Graph G, int V, int E); Graph GRAPHrand2(Graph G, int V, int E); int GRAPHpath(Graph G, int id1, int id2); void GRAPHpathH (Graph G, int id1, int id2); void GRAPHbfs(Graph G, int id); void GRAPHdfs(Graph G, int id); int GRAPHscc(Graph G); int GRAPHcc(Graph G); Graph reverse(Graph G); void GRAPHmstK(Graph G); void GRAPHmstP(Graph G); void GRAPHspD(Graph G, int id); void GRAPHspBF(Graph G, int id); Dag.h void DAGrts (Dag D); Arco.h Edge EDGEcreate(int v, int w, int wt); Edge EDGEalloc(int v, int w, int wt); IterativeSort.h void BubbleSort(Item A[], int N); void OptBubbleSort(Item A[], int N); void SelectionSort(Item A[], int N); void InsertionSort(Item A[], int N); void ShellSort(Item A[], int N); void CountingSort(Item A[], Item B[], int C[], int N, int k); RecursiveSort.h void QuickSort (Item *A, int N); void QuickSortR(Item *A, int l, int r); int partition(Item *A, int l, int r); void MergeSort (Item *A, int N); void MergeSortR(Item *A, Item * B, int l, int r); void Merge(Item *A, Item *B, int l, int q, int r); void BottomUpMergeSort (Item *A, int N);