Pesquiza e Ordenação 0.0.1
Projeto estuda pesquisa: sequencial e binária; ordenação: selectsort e quicksort.

sortui.h

Ir para a documentação deste ficheiro.
00001 
00011 #ifndef __SORTUI_H__
00012 #define __SORTUI_H__      1
00013 
00014 #include "mycommdef.h"
00015 
00017 #define DEFAULT_COLS        80
00018 
00019 #define DEFAULT_LINES       25
00020 
00025 #define SIZE_OF_ARRAY       513
00026 
00028 #define MIN_ELEMENT         0
00029 
00030 #define MAX_ELEMENT         1000
00031 
00032 #define MAX_AVERAGE         1000
00033 
00035 enum eOptMenu {
00036     oGenerateArray = 1,         
00037     oSearch,                    
00038     oSort,                      
00039     oSS1000,                    
00040     oPrintUnsorted = 51,        
00041     oPrintSorted,               
00042     oExit = 6,                  
00043     oUnknown,                   
00044     oNone                       
00045 };
00046  
00048 struct SORT_REPORT {
00049     int comparasions;       
00050     int permutations;       
00051     float average;          
00052     float std_deviation;    
00053 };
00054 
00056 struct SEARCH_REPORT {
00057     int seq_index;          
00058     int bin_index;          
00059     int seq_comp;           
00060     int bin_comp;           
00061     float seq_average;      
00062     float seq_std_deviation;    
00063     float bin_average;          
00064     float bin_std_deviation;    
00065 };
00066 
00067 void PrintMenu(void);
00068 void Greeting(void);
00069 int  read_input(char*, int);
00070 enum eOptMenu ParseOption(const char*, enum eOptMenu);
00071 bool MoreInput(void);
00072 void GenerateRndArray(int[], int);
00073 void PrintArray(int[], int);
00074 int  get_element(void);
00075 void ReportSearch(int, bool, bool, const struct SEARCH_REPORT*);
00076 void ReportSort(const struct SORT_REPORT*, const struct SORT_REPORT*);
00077 void ReportAverage(const struct SEARCH_REPORT*,
00078             const struct SORT_REPORT*, const struct SORT_REPORT*);
00079 void get_AverageAndStdDeviation(struct SEARCH_REPORT *s_rpt,
00080                                 struct SORT_REPORT *ss_rpt,
00081                                 struct SORT_REPORT *qks_rpt,
00082                                 int nsize);
00083 
00084 #endif /*__SORTUI_H__*/
 Tudo Estruturas de dados Ficheiros Funções Variáveis Definições de tipos Enumerações Valores da enumeração Macros