Flutter Algorithm Visualizer #03 - Insertion Sort

  Рет қаралды 2,545

Fun with Flutter

Fun with Flutter

4 жыл бұрын

Preparing for an interview or want to learn more algorithms:
Check out algoexpert.io/funwith and use the promo code "funwith" for a 15% discount.
Thanks to the supporters of the channel - GH and LEON ( / funwithflutter )
In this video we take a look at the Insertion Sort Algorithm. Quick and easy and we also showcase the app on Flutter Web.
Head over to funwith.app for more content (made entirely in Flutter)
Source Code:
github.com/funwithflutter/flu...
The algorithm above can be optimized by not iterating to 0 if the value has already been placed in the correct position. The actual app may be different to the sample you see in the video.

Пікірлер: 8
@aytunch
@aytunch 4 жыл бұрын
Aren't you supposed to break the loop when a number is not smaller than the one on it's left? There is no reason to continue all the way to the left most element in every loop
@FunwithFlutter
@FunwithFlutter 4 жыл бұрын
You are very correct, there is no reason to. I guess visually it will also make more sense to break the loop. I initially didn't break it because I wanted it to be slow while I was tweaking the animations. Forgot to add it back. Thanks!
@SupermanSandy
@SupermanSandy Жыл бұрын
Make more please
@erollooper9619
@erollooper9619 3 жыл бұрын
Have you practice on AVL Tree (Self balanced tree)??
@aytunch
@aytunch 4 жыл бұрын
By the way, I am very excited to see your clock implementation. Is it not allowed to do videos of the progress before the competition ends?
@FunwithFlutter
@FunwithFlutter 4 жыл бұрын
I remember reading that for the previous challenge(the 5kb one). Not sure about this challenge though. It would make sense that it is a rule, because the judges are supposed to remain impartial. I'll definitely link to what I made, or make a video, once I'm allowed to. What I'm trying to do is a little bit heavy on the GPU, so I don't think it will be a prime app. But it looks interesting lol. Are you taking part?
@aytunch
@aytunch 4 жыл бұрын
@@FunwithFlutter I started coding a clock with lots of custom painting however I am stuck with the performance issues and writing efficient data structures and algorithms. It seemed too much work and now I am watching videos on yt:) Maybe I will post it the way it is..
@FunwithFlutter
@FunwithFlutter 4 жыл бұрын
@@aytunch I've been playing with Custom Painters a lot recently, some things that might help. 1) Make sure to build small widgets, don't call setState on large widgets. 2) If you're doing animations then use something like AnimatedBuilder (or one of the transition widgets or implicit animations) instead of calling setState. 3) If you are working with unique drawing in a custom painter, make use of Path() (and build the thing you are drawing with a path object) instead of constantly calling canvas.draw (as an example). Instead call canvas.drawPath() You can also store that information and make sure it does not get re rebuilt unnecessarily. 4) Look into Anti Aliasing for your painter - depending on what you paint 5) RepaintBoundary might be of use to you. Check stackoverflow.com/questions/46702376/how-to-ensure-my-custompaint-widget-painting-is-stored-in-the-raster-cache 7) Optimize when your Custom Painter should repaint in the shouldRepaint method 8) Build your app in release mode and see what it looks like, it might be different after you build for release. I made a video on performance profiling if you want to give that a watch. It might help you find the bottleneck, or give some insight.
Flutter Algorithm Visualizer #04 - Selection Sort
5:44
Fun with Flutter
Рет қаралды 3,2 М.
Improve your Flutter Apps performance with a RepaintBoundary
31:31
Fun with Flutter
Рет қаралды 14 М.
Inside Out Babies (Inside Out Animation)
00:21
FASH
Рет қаралды 22 МЛН
小宇宙竟然尿裤子!#小丑#家庭#搞笑
00:26
家庭搞笑日记
Рет қаралды 12 МЛН
Flutter UI Tip 3: Popup Card
12:00
Fun with Flutter
Рет қаралды 73 М.
Arm PC Build (Rock 5 ITX)
22:35
ExplainingComputers
Рет қаралды 50 М.
Flutter Version Management. You need to use this.
16:01
Fun with Flutter
Рет қаралды 82 М.
Beginning Flutter - Intermediate - Using Common Widgets
4:44
JediPixels
Рет қаралды 76 М.
I Electroplated a 3D Printed C-3PO and it looks insane now
10:41
HEN3DRIK - Electroplating 3D Prints
Рет қаралды 17 М.
Exploring Riverpod and building a Todo App | Flutter
55:57
Fun with Flutter
Рет қаралды 24 М.
Building with HTML Basics!
7:44
DevExplorationHub
Рет қаралды 110
Flutter Tutorial - TextField - Deep Dive
23:51
HeyFlutter․com
Рет қаралды 85 М.