Changes

Jump to: navigation, search

Algo holics

1,262 bytes added, 04:35, 22 February 2019
Progress
0.00 0.00 0.00 1 0.00 0.00 __static_initialization_and_destruction_0(int, int)
From the above Flat profile we can see that the program took no time in finding the solutionand the function checkRow, checkColumn and placeNum were called for the maximum times. ThereforeHowever, to get better understanding of the program let's try a harder Sudoku puzzle.
If we run the sample-puzzle-2-hard (Level- hard) file, which has the following text inside it:
The output will be:
9 8 7 6 5 4 3 2 1 2 4 6 1 7 3 9 8 5 3 5 1 9 2 8 7 4 6 1 2 8 5 3 7 6 9 4 6 3 4 8 9 2 1 5 7 7 9 5 4 6 1 8 3 2 5 1 9 2 8 6 4 7 3 4 7 2 3 1 9 5 6 8 8 6 3 7 4 5 2 1 9 The Flat profile for the following looks like:   Flat profile: Each sample counts as 0.01 seconds. % cumulative self self total time seconds seconds calls s/call s/call name 47.61 13.27 13.27 622577597 0.00 0.00 checkRow(int, int) 19.27 18.63 5.37 223365661 0.00 0.00 checkColumn(int, int) 14.41 22.65 4.01 157353814 0.00 0.00 placeNum(int, int) 12.09 26.01 3.37 100608583 0.00 0.00 checkSquare(int, int, int) 3.53 27.00 0.98 69175252 0.00 0.00 goBack(int&, int&) 3.02 27.84 0.84 1 0.84 27.84 solveSudoku() 0.04 27.85 0.01 1 0.01 0.01 _GLOBAL__sub_I_sudoku 0.04 27.86 0.01 1 0.01 0.01 storePositions() 0.00 27.86 0.00 2 0.00 0.00 print(int (*) [9]) 0.00 27.86 0.00 1 0.00 0.00 _GLOBAL__sub_I_temp 0.00 27.86 0.00 1 0.00 0.00 __static_initialization_and_destruction_0(int, int) 0.00 27.86 0.00 1 0.00 0.00 __static_initialization_and_destruction_0(int, int)  
85
edits

Navigation menu