Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "analyze.h"
- #include "algorithm.h"
- //
- // Private
- //
- //
- // Public
- //
- void create_array(alghoritm_t,case_t, ??){
- /* jag behöver kolla vilken typ av array jag söker först
- (sorted,shuffle eller reverse), sen skapar jag arrayen genom
- malloc som jag skapar i benchmark, och stoppar in värden
- i olika forloopar beroende på vilken av dom det ska vara
- detta kommer vara för sorted
- for (int i = 0; i < SIZE; i++)
- {
- arr[i] = i;
- }
- för random
- for (int i = 0; i < SIZE; i++)
- {
- random = rand() % byte;
- arr[i] = random;
- }
- detta är för invers sortering:
- for (int i = 0; i < SIZE; i++)
- {
- arr[i] = byte - i;
- }
- }
- {
- */
- void array_type(algorithm_t,case_t){
- switch(algorithm_t){
- case bubble_sort_t:
- if(case_t == best_t ){
- return sorted;
- }else if(case_t == worst_t){
- return reverse;
- }
- if(case_t == average){
- return random;
- }
- case insertion_sort_t:
- if(case_t == best_t){
- return sorted;
- }
- else if(case_t == worst_t){
- return reverse;
- }
- if(case_t == average_t){
- return random;
- }
- case quick_sort_t:
- if(){
- }
- if else(){
- }
- if(){
- }
- case linear_search_t:
- if(){
- }
- if else(){
- }
- if(){
- }
- case binary_search_t:
- if(){
- }
- if else(){
- }
- if(){
- }
- }
- void create_array()
- void benchmark(const algorithm_t a, const case_t c, result_t *buf, int n)
- {
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement