From 73d3a34a20407c0aca29b26eb8556b484b0805fe Mon Sep 17 00:00:00 2001 From: Manav Arora Date: Fri, 26 Mar 2021 01:57:30 +0530 Subject: [PATCH] New Quick sort algorithm added --- assets/simulations/QuickSortDark.png | Bin 0 -> 13747 bytes assets/simulations/QuickSortLight.png | Bin 0 -> 14611 bytes lib/src/data/simulations.dart | 64 +++-- lib/src/simulations/quick_sort.dart | 324 ++++++++++++++++++++++++ pubspec.lock | 341 ++++++++++++++++++++++++++ 5 files changed, 703 insertions(+), 26 deletions(-) create mode 100644 assets/simulations/QuickSortDark.png create mode 100644 assets/simulations/QuickSortLight.png create mode 100644 lib/src/simulations/quick_sort.dart create mode 100644 pubspec.lock diff --git a/assets/simulations/QuickSortDark.png b/assets/simulations/QuickSortDark.png new file mode 100644 index 0000000000000000000000000000000000000000..aefff5e0e5d98e8d5e8b3675a0311b77da1dbcb4 GIT binary patch literal 13747 zcmbVz2Q*yo*7pn}nCLx-GDbo~7rl($qD!=B38L2^$e2;WNJJMc(Q5?Ji6Ejz38MET zqW3mpFuvp7yS{bb_x|7ayZ5u!ENh+TJnfwQ{PzC+_C8Viy6WUmW+(^*BG=SVF$96Y zXb_0NkAwiYG8OT~3;0LssbS^=0#O`X{=lq8Y0|(&>L;qEPmGk@{*u%rsheJ`FWzb&;Xyy+zHhrRE@AJsp$@7VmhdT&F zlGew=%lqN`grK0{1fPcH2>;i?LEdrgZ-Yc2_bigVl#1I8AduLuri!BR)9J0bxmdd? zGl4%V0Tc7oW@GkEikK4{P*6B|B(~SZjR&Q(WAtgs^e1PKsra@2$$0kD z5`X04O7Qjye!T*JOH{PFwouun?5JqVqsR$&WPNe8fGb<1r`-VW-A1$IK_q1>cjHLBE}&x^-LX?%kT_L zE@|y0u(LU)h@t`+Uy!F0uJU(<_m26E=YAOaHhb;R*|N3Q!mX@mk>5r*-?k{|Ngt3-d5MqV&u>YooEiLB=C{?cH8c^^?o<+SK$ z>Pgg+VsT3`3}A4(cq3sBlv{YUOJtx9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ZO5%IN!o_Bxp#K%XpKVn)cm$Lz)y|wY zRz&N+<^kn|KtsP@&)4%XA5i@kEV2GF&;N<`=~i!Is+>HYaT0KTfAgOI$N_DBJG)>h XDq?k>qQn9pO@TC3bydohY(oDJLg%|l literal 0 HcmV?d00001 diff --git a/assets/simulations/QuickSortLight.png b/assets/simulations/QuickSortLight.png new file mode 100644 index 0000000000000000000000000000000000000000..80ab85dfa8fa94f60be8e2c9768b7e91759cb857 GIT binary patch literal 14611 zcmch81yEewx@AKkN^sYN1ZkW!?gV#jEJy+gPSA$nB>4l42WULFH#CIc9)bs_ksu8O zcha~shdXoMyYId`_1?@>4OJAi*{4tMbM`0eTi@ED+L}ra@6+A~fj|#cl;w3nAe>eZ z2>0P#T;M-Fbb8yspL;IK#_k{x;r`7p4!vHo81PRL4+SF+eLD}wHy~|!#Yb{(Z(eyg zyUCh2vICQ3H49J3G2Rl2xJ`^x^}ixqbAFJmlZFTe;b}c-T3=1%d7+ z_p*b*Uq>c*d3h%|l~vH(J%fYbakYU#e9+sByV%4su38XCL|a8(R{!19HbyPt=`>XM z?ApXv>9sW!cI@4K^7#Cv`@?Vel!@Z9L0{*)pDXuK<4}%tHIcFMDL&srypKtG^78)k z=azr9gNQy4#j||;%=28mlyD5gwK%rRHd9(JL6* zEfu~))0B*s|8495JLaEa=6Pb#8I+36b(&7lO_%V-eY9$-8hSEo*E{$ktaDW!uMjTp z@k}PvD5Ncr3lh+H!aR36;MIJ&?X2ZcSq|~&taUv;^l36d1svG~9<8k@%h#8_ zKpCJb`eqZf!2M8FG7^Y~-iMAy(9xhaKELCJxyud179SrU+K1cx>Z{vCPSe%9=YxS) z`xYlZr~>|cWNQC9_USTf|Ms!?ZX<*+=2Kb*DGB6YY-6Y#JA3S}YFBP_(c5y-8+d&j zn87<^%|$>Jt}p@90@i)X4$cXINsZwPCOo-izvyIzaFTKnA=vMQ|% zhtr&i!3rA+5ZQfwqDm91m4f~nWD%-h4fN6%oQpAw%dwi~LzFArj_bLN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HuG_5{+k_o3Lr7PA}@`rq#IH*e!CJvG8w8Z z?w3m})_SXpn(!oo^NdjBR%Pg~sc)S21|ITBPH9HUdHuO{<>&r8c&^OuULOHwQ4IU- zsn74SM!sHV&K$BPyOc5eDkCmkRenoG8z!Y~8%LH<< zHuJ`fR-C0T1@ZI15u^%JoMB>!l`$*8R}}~95W1@CfHZ_Rs!pYy0OO2R|B!T>Db=nkrJH)V`Ol`s`boLmyU}W$ zg!C_85W0W}a+BdRa4Ro0@G>Ohw9n}MxCx+_Twh-|Dl})2Tcr7l{VM`sGEPx7vnj5U zQh=n&xsDJz2Ar6g!y_(!Y~>r(JN}?au~SgP-OsPllt&?Vvp(aZCxf2p1Qy?RbGGY9 zf%BXy5KHCd$(JHL+DSO{F5!6KCwub)dEsDR#Xje$Z_SQjYh$-O=#A@}b6J5yP&Jc< z(o97aNrbHsN#J _QuicksortBars(); +} + +class _QuicksortBars extends State { + int _numberOfElements; + List _elements = []; + int i = 0, j = 1, counter = 0; + int minIdx = 0; + int maxIdx; + int n; + int tmp, delay = 0, delay2 = 0; + bool swap = false; + double barwidth; + List containerList = []; + bool doNotRefresh = false; + int finalIterator = 0; + final ScrollController _scrollController = ScrollController(); + + @override + void initState() { + _numberOfElements = 2; + i = 0; + counter = 0; + swap = false; + doNotRefresh = false; + SystemChrome.setPreferredOrientations([ + DeviceOrientation.portraitUp, + DeviceOrientation.portraitDown, + ]); + super.initState(); + } + + @override + dispose() { + SystemChrome.setPreferredOrientations([ + DeviceOrientation.portraitUp, + DeviceOrientation.portraitDown, + DeviceOrientation.landscapeLeft, + DeviceOrientation.landscapeRight, + ]); + super.dispose(); + } + + _containerList() { + containerList.clear(); + if (!doNotRefresh) { + _elements.clear(); + i = 0; + var rng = new Random(); + for (int i = 0; i < _numberOfElements; i++) { + _elements.add(rng.nextInt(400)); + } + n = _elements.length; + } + this.barwidth = MediaQuery.of(context).size.width / (_elements.length + 1); + if (n != 1) { + for (int k = 0; k < _elements.length; ++k) { + if (k == minIdx) { + containerList.add(Container( + color: Colors.red, + height: _elements[k] + 0.5, + width: barwidth, + )); + } else if (k == i) { + containerList.add(Container( + color: Colors.blue, + height: _elements[k] + 0.5, + width: barwidth, + )); + } else { + containerList.add(Container( + color: Theme.of(context).primaryColor, + height: _elements[k] + 0.5, + width: barwidth, + )); + } + } + } else { + containerList.clear(); + finalIterator++; + + for (int k = 0; k < _elements.length; ++k) { + if (k <= finalIterator) { + containerList.add(Container( + color: Colors.greenAccent[400], + height: _elements[k] + 0.5, + width: barwidth, + )); + } else { + containerList.add(Container( + color: Theme.of(context).primaryColor, + height: _elements[k] + 0.5, + width: barwidth, + )); + } + } + if (finalIterator == _elements.length) { + finalIterator = 0; + } + } + } + + nextStep() async { + await Future.delayed(Duration(milliseconds: delay)); + if (!doNotRefresh) return; + if (this.mounted) { + setState(() { + if (n == 1) { + swap = false; + return; + } + counter++; + if (i == n - 1) { + i = 0; + n = 1; + swap = false; + } + minIdx = i; + for (j = minIdx; j < n; j++) { + if (_elements[minIdx] <= _elements[j]) { + minIdx = j; + } + } + + tmp = _elements[i]; + _elements[i] = _elements[minIdx]; + _elements[minIdx] = tmp; + i++; + }); + } + } + + @override + Widget build(BuildContext context) { + _containerList(); + if (swap == true || finalIterator != 0) { + WidgetsBinding.instance.addPostFrameCallback((_) => nextStep()); + } + + return Scaffold( + appBar: AppBar( + automaticallyImplyLeading: false, + leading: IconButton( + icon: Icon(Icons.arrow_back_ios), + onPressed: () { + Navigator.pop(context); + }, + ), + centerTitle: true, + title: Text( + 'Quick Sort', + style: Theme.of(context).textTheme.headline6, + ), + ), + floatingActionButton: FloatingActionButton( + backgroundColor: Colors.white, + child: (!swap) + ? Icon( + Icons.play_arrow, + color: Colors.black, + ) + : Icon( + Icons.pause, + color: Colors.black, + ), + onPressed: () { + doNotRefresh = true; + swap = !swap; + setState(() {}); + }), + floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked, + bottomNavigationBar: Container( + height: ScreenUtil().setHeight(1024 / 5.5), + child: Material( + elevation: 30, + color: Theme.of(context).primaryColor, + child: Scrollbar( + controller: _scrollController, + isAlwaysShown: true, + child: ListView( + controller: _scrollController, + padding: EdgeInsets.all(8.0), + children: [ + SizedBox( + height: 20, + ), + Slider( + min: 2, + max: 200, + activeColor: Theme.of(context).accentColor, + inactiveColor: Colors.grey, + onChanged: (value) { + doNotRefresh = false; + counter = 0; + swap = false; + finalIterator = 0; + setState(() { + _numberOfElements = value.toInt(); + }); + }, + value: _numberOfElements.toDouble(), + ), + Center( + child: Text( + "Elements: ${_numberOfElements.toInt()}", + style: Theme.of(context).textTheme.subtitle2, + ), + ), + SizedBox( + height: 20, + ), + Slider( + min: 0, + max: 100, + divisions: 10, + activeColor: Theme.of(context).accentColor, + inactiveColor: Colors.grey[900], + onChanged: (value) { + setState(() { + delay2 = value.toInt(); + }); + }, + onChangeEnd: (value) { + setState(() { + doNotRefresh = true; + delay = value.toInt(); + }); + }, + value: delay2.roundToDouble(), + ), + Center( + child: Text( + "Delay: ${delay2.toInt()} ms", + style: Theme.of(context).textTheme.subtitle2, + ), + ), + ], + ), + ), + ), + ), + body: Stack( + children: [ + Container( + color: Colors.grey, + child: Column( + children: [ + Spacer(), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: containerList, + ), + Spacer(), + ], + ), + ), + Positioned( + top: 5, + left: 5, + child: Text( + "Swaps: $counter", + style: Theme.of(context).textTheme.subtitle2, + ), + ), + ], + ), + ); + } +} + + +/*_quickSort(int leftIndex, int rightIndex) async { + Future _partition(int left, int right) async { + int p = (left + (right - left) / 2).toInt(); + + var temp = _numbers[p]; + _numbers[p] = _numbers[right]; + _numbers[right] = temp; + await Future.delayed(_getDuration(), () {}); + + _streamController.add(_numbers); + + int cursor = left; + + for (int i = left; i < right; i++) { + if (cf(_numbers[i], _numbers[right]) <= 0) { + var temp = _numbers[i]; + _numbers[i] = _numbers[cursor]; + _numbers[cursor] = temp; + cursor++; + + await Future.delayed(_getDuration(), () {}); + + _streamController.add(_numbers); + } + } + + temp = _numbers[right]; + _numbers[right] = _numbers[cursor]; + _numbers[cursor] = temp; + + await Future.delayed(_getDuration(), () {}); + + _streamController.add(_numbers); + + return cursor; + } + + if (leftIndex < rightIndex) { + int p = await _partition(leftIndex, rightIndex); + + await _quickSort(leftIndex, p - 1); + + await _quickSort(p + 1, rightIndex); + } + } */ + \ No newline at end of file diff --git a/pubspec.lock b/pubspec.lock new file mode 100644 index 0000000..20e25b7 --- /dev/null +++ b/pubspec.lock @@ -0,0 +1,341 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + async: + dependency: transitive + description: + name: async + url: "https://pub.dartlang.org" + source: hosted + version: "2.5.0" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + characters: + dependency: transitive + description: + name: characters + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + charcode: + dependency: transitive + description: + name: charcode + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + clock: + dependency: transitive + description: + name: clock + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + collection: + dependency: transitive + description: + name: collection + url: "https://pub.dartlang.org" + source: hosted + version: "1.15.0" + cupertino_icons: + dependency: "direct main" + description: + name: cupertino_icons + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.2" + fake_async: + dependency: transitive + description: + name: fake_async + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + ffi: + dependency: transitive + description: + name: ffi + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" + file: + dependency: transitive + description: + name: file + url: "https://pub.dartlang.org" + source: hosted + version: "6.1.0" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_screenutil: + dependency: "direct main" + description: + name: flutter_screenutil + url: "https://pub.dartlang.org" + source: hosted + version: "4.0.4" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + js: + dependency: transitive + description: + name: js + url: "https://pub.dartlang.org" + source: hosted + version: "0.6.3" + matcher: + dependency: transitive + description: + name: matcher + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.10" + meta: + dependency: transitive + description: + name: meta + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.0" + nested: + dependency: transitive + description: + name: nested + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" + path: + dependency: transitive + description: + name: path + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.0" + path_provider_linux: + dependency: transitive + description: + name: path_provider_linux + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.1+2" + path_provider_platform_interface: + dependency: transitive + description: + name: path_provider_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.4" + path_provider_windows: + dependency: transitive + description: + name: path_provider_windows + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.5" + platform: + dependency: transitive + description: + name: platform + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.0" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.3" + process: + dependency: transitive + description: + name: process + url: "https://pub.dartlang.org" + source: hosted + version: "4.2.0" + provider: + dependency: "direct main" + description: + name: provider + url: "https://pub.dartlang.org" + source: hosted + version: "4.3.3" + shared_preferences: + dependency: "direct main" + description: + name: shared_preferences + url: "https://pub.dartlang.org" + source: hosted + version: "0.5.12+4" + shared_preferences_linux: + dependency: transitive + description: + name: shared_preferences_linux + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.2+4" + shared_preferences_macos: + dependency: transitive + description: + name: shared_preferences_macos + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.1+11" + shared_preferences_platform_interface: + dependency: transitive + description: + name: shared_preferences_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.4" + shared_preferences_web: + dependency: transitive + description: + name: shared_preferences_web + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.2+7" + shared_preferences_windows: + dependency: transitive + description: + name: shared_preferences_windows + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.2+3" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" + source_span: + dependency: transitive + description: + name: source_span + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.0" + stack_trace: + dependency: transitive + description: + name: stack_trace + url: "https://pub.dartlang.org" + source: hosted + version: "1.10.0" + stream_channel: + dependency: transitive + description: + name: stream_channel + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + string_scanner: + dependency: transitive + description: + name: string_scanner + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + term_glyph: + dependency: transitive + description: + name: term_glyph + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + test_api: + dependency: transitive + description: + name: test_api + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.19" + typed_data: + dependency: transitive + description: + name: typed_data + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.0" + url_launcher: + dependency: "direct main" + description: + name: url_launcher + url: "https://pub.dartlang.org" + source: hosted + version: "5.7.10" + url_launcher_linux: + dependency: transitive + description: + name: url_launcher_linux + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.1+4" + url_launcher_macos: + dependency: transitive + description: + name: url_launcher_macos + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.1+9" + url_launcher_platform_interface: + dependency: transitive + description: + name: url_launcher_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.9" + url_launcher_web: + dependency: transitive + description: + name: url_launcher_web + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.5+3" + url_launcher_windows: + dependency: transitive + description: + name: url_launcher_windows + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.1+3" + vector_math: + dependency: transitive + description: + name: vector_math + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + win32: + dependency: transitive + description: + name: win32 + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.4" + xdg_directories: + dependency: transitive + description: + name: xdg_directories + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.2" +sdks: + dart: ">=2.12.0 <3.0.0" + flutter: ">=1.22.0"