poor explanation if values are chose as c=3 after and right after n0=4 which means n=5 ıt wont satisy condition=
@idafoh348 күн бұрын
thank you!
@bestlife75789 күн бұрын
Que animación tan buena!
@ncsredemption894210 күн бұрын
Came to this video because I was confused by my professor's explanation. This was much clearer. Thank you!
@antooooo13011 күн бұрын
excelent explanation!
@chaos0000012 күн бұрын
The clearest explanation I've seen....
@offthepathworks917114 күн бұрын
Properly analyzing code? Could you please expand - great series btw :).
@Unstable_Diffusion8916 күн бұрын
Correct me if im wrong but you do not swap the root and the tail, you just update the tail to the root? Shouldn’t there be A[1] = A[size] A[size] = maxKey So concretely, you put 48 at the end of the array but keep 48 at the root, instead of remembering to put 11 up at the root and then pushing it down the tree
@domojestic4155Күн бұрын
If you did it that way, you would lose your 11. The point of the function is to pop off the maximum value and then keep all your remaining values; the way you describe it would pop the max value, and then erroneously delete the current last value in the heap. On top of that, you would fail to delete the original max value, since you would have just made a duplicate.
@JikeWimblik16 күн бұрын
Theorem: The proposed Sudoku solving algorithm, which utilizes a 45-grid encoding and a 2-SAT solver to iteratively identify and eliminate invalid '1' placements, has a polynomial-time complexity. Proof: * Sudoku Encoding and Problem Structure: * The Sudoku puzzle is encoded using 45 grids, where each grid corresponds to a specific number (1-9) and a specific position within a 3x3 subgrid. * Each grid contains '1's representing the presence of that number in the corresponding cells and '2's representing its absence. * Crucially: Each grid must have exactly two '1's to satisfy the Sudoku constraints (one number appears twice within its row, column, and 3x3 subgrid). This limited capacity is key to the algorithm's efficiency. * Algorithm Description: a) Initialization: All possible '1' placements across all 45 grids are considered. b) Iteration: i. 2-SAT Solver and Invalid '1' Identification: For each grid, a 2-SAT instance is constructed based on the current '1' placements and the Sudoku constraints (row, column, and subgrid). The 2-SAT solver checks the satisfiability of these constraints. Since each grid can only have two '1's, attempting to place more will inevitably lead to an unsatisfiable instance, revealing at least one invalid '1' placement within that grid. ii. Elimination: The identified invalid '1' placement is marked, permanently eliminating that possibility. iii. Constraint Propagation: The information from the invalid placement is propagated to other grids, potentially identifying more invalid placements due to shared constraints (same row, column, or 3x3 subgrid). c) Termination: The algorithm terminates when a valid solution is found, which occurs when each grid contains exactly two '1's that satisfy all Sudoku constraints. * Why at Least One Invalid '1' is Guaranteed: * Pigeonhole Principle: Each grid has 9 cells (pigeonholes) but can only accommodate two '1's (pigeons). If we attempt to place a '1' in every cell of a grid, we violate the "two '1's per grid" rule. By the Pigeonhole Principle, at least one cell must then contain an invalid '1'. * Sudoku Constraints: A solvable Sudoku puzzle has a unique solution with strict constraints on where each number can be placed. Testing all possible '1's in a grid forces violations of these constraints, leading to the detection of invalid placements. * Complexity Analysis: * Constant Grid Size: Each grid has a constant size (9 cells). * Guaranteed Invalid Placement: In each iteration, at least one invalid '1' placement is guaranteed to be found. * Limited Iterations: The total number of iterations is limited by the total number of possible '1' placements across all grids (45 grids * 9 cells/grid = 405). This upper bound ensures the algorithm doesn't run indefinitely. * Polynomial Time per Iteration: Each iteration involves: * Constructing a 2-SAT instance (polynomial time). * Running the 2-SAT solver (polynomial time). * Marking the invalid placement and propagating constraints (constant time). * Overall Complexity: * The number of iterations is bounded by a constant (405), and each iteration takes polynomial time. Therefore, the overall complexity of the algorithm is polynomial. Conclusion: The proposed Sudoku solving algorithm, by leveraging the limited capacity of each grid in the encoding and the power of the 2-SAT solver to systematically identify and eliminate invalid '1' placements, guarantees finding the solution in polynomial time. This result offers a new perspective on the solvability of Sudoku and potentially has broader implications for tackling other constraint satisfaction problems.
@AvinashGA17 күн бұрын
Awesome, thank you
@GaryMahal18 күн бұрын
good quality stuff!!!!
@Interestingthingsblog20 күн бұрын
Brilliant! when understood, appears easy now. Earlier was giving me headache!
@Unstable_Diffusion8923 күн бұрын
These videos really should have more views, I prefer the more mathematical approach
@nathanahern227026 күн бұрын
good explanation thanks for breaking it down
@Psalm2Charity29 күн бұрын
this is such an underrated resource!! You deserve so many more views this explanation was so clear… Ty ❤
@jhadhiraj147Ай бұрын
I made same to same visualization in my mind and googled to find if there's other person like me thinking the same way... haha
@peter2070Ай бұрын
These videos are so good, they beat everything I have seen. I really love your pseudo codes, they are really easy to follow
@NotABot00101Ай бұрын
Great video! How did it take me this long to know this video was out there?
@kates-createsАй бұрын
amazing channel !
@bigOofahАй бұрын
Thank you so much. This is the best explanation of rotations I've found.
@SelmanJoker-s6qАй бұрын
C=2,n=0 I don't understand
@paarak4397Ай бұрын
today we pass
@aplimsollpunk2738Ай бұрын
I love how it sounds like God is talking to us. He has come to bestow his asymptotic wisdom upon us.
@gabrivit97Ай бұрын
Very clear and useful, thank you very much from Italy! :)
@PurpleMiniMoose2 ай бұрын
ATLA is the best show: fact
@ShreyaSridharD2 ай бұрын
thanks for explaining soo well
@h.d46322 ай бұрын
Your explanations are very VERY clear ,thank you for the amazing effort you put in these videos !!!
@YetaSatisfyingCrunch2 ай бұрын
Thank you very much!
@ashle_.y3 ай бұрын
Nice Work😉 Also Mention how thise algo Finds the pivot.
@YszapHun3 ай бұрын
this topic is unbelievably, extraordinarily difficult for me. i hate this so much.
@asherb51343 ай бұрын
How do I build the graph with an edge that is only in one Subset ? since according to your example each vertex is connection to another vertex if they have matching edges that correspond to the original subset items .. ?
@DINGFULU3 ай бұрын
Explain the DFS Edge Classification in a short time, which is pretty good
@fikusul213 ай бұрын
Thx
@samiullahjawad47123 ай бұрын
I can not thank you enough. All of your videos are great and simple and the examples are very helpful. hopefully you don't get discouraged because of low view counts on these topics. thx again.
@adrianarreguin17393 ай бұрын
your the only person that made this make sense for me. It clicked in a different way though. It makes sense in code where you type an IF => THEN statement.The code will only execute when P is fulfilled; the output will be whatever Q is. On the other hand if P is never fulfilled then Q is never outputted. I guess im thinking of it as a type of "LAW" statement. it can only ever be tested when the P conditions are met; if they're not then the code sits their in the background. Maybe my thinking is flawed lol. sometimes an idea clicks and then I apply it somewhere else and my "reasoning" ends up false. Thank you for the lesson though this has been extremely helpful!!!
@almaseelesoul11 күн бұрын
Your example makes me sense and I understood it better. Thanks a million! :)
@Swampdragon1023 ай бұрын
Best overview I've seen so far. Great work! Exactly what I was looking for
@Mariuscasamian4 ай бұрын
you are a hero
@reemhesham71394 ай бұрын
Thank you so much!
@LearnerAbhi214 ай бұрын
thank you so much
@valjohn68704 ай бұрын
Lost me at the star
@zhengren85804 ай бұрын
these videos deserve more subs!
@copengie44 ай бұрын
Thank you so much for these examples! Super helpful, I barely understand my professor's lectures but this made it very clear :)
@exe.m1dn1ght4 ай бұрын
what a beautiful and useful this data structure is .. i can think of dozens of applications for this
@RatulHasanNirjon4 ай бұрын
Why didn't we do log3 + log n² Replace the log3 with Log n…? Is it because we took greater value of n
@ramya_loves_omi4 ай бұрын
youre great!!
@marcc11794 ай бұрын
nice work!
@hawadoh4 ай бұрын
for an array A, of size N and containing N elements: for int i from 1 to N-1 int j = i while j > 0 && a[j] < a[j-1] swap(a[j], a[j-1]) j--