[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-9253":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":5,"languages":10,"totalLinesOfCode":10,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":15,"stars7d":16,"stars30d":17,"stars90d":15,"forks30d":15,"starsTrendScore":18,"compositeScore":19,"rankGlobal":10,"rankLanguage":10,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":23,"hasPages":21,"topics":24,"createdAt":10,"pushedAt":10,"updatedAt":29,"readmeContent":30,"aiSummary":31,"trendingCount":15,"starSnapshotCount":15,"syncStatus":16,"lastSyncTime":32,"discoverSource":33},9253,"Dart","TheAlgorithms\u002FDart","TheAlgorithms","All Algorithms implemented in Dart","",null,2130,487,38,16,0,2,10,1,30.07,"MIT License",false,"master",true,[25,26,27,28],"algorithms","dart","data-structures","hacktoberfest","2026-06-12 02:02:04","# The Algorithms - Dart\n\n[![Build Status](https:\u002F\u002Ftravis-ci.com\u002FTheAlgorithms\u002FDart.svg?branch=master)](https:\u002F\u002Ftravis-ci.com\u002FTheAlgorithms\u002FDart)\n[![Donate](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FDonate-PayPal-green.svg)](https:\u002F\u002Fwww.paypal.me\u002FTheAlgorithms\u002F100) &nbsp;\n[![Discord chat](https:\u002F\u002Fimg.shields.io\u002Fdiscord\u002F808045925556682782.svg?logo=discord&colorB=5865F2)](https:\u002F\u002Fthe-algorithms.com\u002Fdiscord\u002F) &nbsp;\n[![Gitter chat](https:\u002F\u002Fbadges.gitter.im\u002FgitterHQ\u002Fgitter.png)](https:\u002F\u002Fgitter.im\u002F#TheAlgorithms_community:gitter.im)\n\n### All algorithms implemented in Dart (for education)\n\nThese implementations are for learning purposes. They may be less efficient than the implementations in the Dart standard library.\n\n## List of Algorithms\n\nSee our [directory](https:\u002F\u002Fgithub.com\u002FTheAlgorithms\u002FDart\u002Fblob\u002Fmaster\u002FDIRECTORY.md) for full list of all algorithms. A few of the algorithms (the most common ones) are explained here.\n\n## Search Algorithms\n\n### Linear\n![alt text][linear-image]\n\nFrom [Wikipedia][linear-wiki]: linear search or sequential search is a method for finding a target value within a list. It sequentially checks each element of the list for the target value until a match is found or until all the elements have been searched.\n  Linear search runs in at the worst linear time and makes at most n comparisons, where n is the length of the list.\n\n__Properties__\n* Worst case performance    O(n)\n* Best case performance    O(1)\n* Average case performance    O(n)\n* Worst case space complexity    O(1) iterative\n\n\n### Binary\n![alt text][binary-image]\n\nFrom [Wikipedia][binary-wiki]: Binary search, also known as half-interval search or logarithmic search, is a search algorithm that finds the position of a target value within a sorted array. It compares the target value to the middle element of the array; if they are unequal, the half in which the target cannot lie is eliminated and the search continues on the remaining half until it is successful.\n\n__Properties__\n* Worst case performance    O(log n)\n* Best case performance    O(1)\n* Average case performance    O(log n)\n* Worst case space complexity    O(1)\n\n----------------------------------------------------------------------------------------------------------------------\n\n## Sort Algorithms\n\n\n### Bubble\n![alt text][bubble-image]\n\nFrom [Wikipedia][bubble-wiki]: Bubble sort, sometimes referred to as sinking sort, is a simple sorting algorithm that repeatedly steps through the list to be sorted, compares each pair of adjacent items and swaps them if they are in the wrong order. The pass through the list is repeated until no swaps are needed, which indicates that the list is sorted.\n\n__Properties__\n* Worst case performance    O(n^2)\n* Best case performance    O(n)\n* Average case performance    O(n^2)\n\n###### View the algorithm in [action][bubble-toptal]\n\n\n\n### Insertion\n![alt text][insertion-image]\n\nFrom [Wikipedia][insertion-wiki]: Insertion sort is a simple sorting algorithm that builds the final sorted array (or list) one item at a time. It is much less efficient on large lists than more advanced algorithms such as quicksort, heapsort, or merge sort.\n\n__Properties__\n* Worst case performance    O(n^2)\n* Best case performance    O(n)\n* Average case performance    O(n^2)\n\n###### View the algorithm in [action][insertion-toptal]\n\n\n### Quick\n![alt text][quick-image]\n\nFrom [Wikipedia][quick-wiki]: Quicksort (sometimes called partition-exchange sort) is an efficient sorting algorithm, serving as a systematic method for placing the elements of an array in order.\n\n__Properties__\n* Worst case performance    O(n^2)\n* Best case performance    O(n log n) or O(n) with three-way partition\n* Average case performance    O(n^2)\n\n###### View the algorithm in [action][quick-toptal]\n\n### Selection\n![alt text][selection-image]\n\nFrom [Wikipedia][selection-wiki]: The algorithm divides the input list into two parts: the sublist of items already sorted, which is built up from left to right at the front (left) of the list, and the sublist of items remaining to be sorted that occupy the rest of the list. Initially, the sorted sublist is empty and the unsorted sublist is the entire input list. The algorithm proceeds by finding the smallest (or largest, depending on sorting order) element in the unsorted sublist, exchanging (swapping) it with the leftmost unsorted element (putting it in sorted order), and moving the sublist boundaries one element to the right.\n\n__Properties__\n* Worst case performance    O(n^2)\n* Best case performance    O(n^2)\n* Average case performance    O(n^2)\n\n###### View the algorithm in [action][selection-toptal]\n\n\n### Merge\n![alt text][merge-image]\n\nFrom [Wikipedia][merge-wiki]: Merge sort (also commonly spelled mergesort) is a divide and conquer algorithm that was invented by John von Neumann in 1945. The algorithm dirst divides the list into the smallest unit (1 element), then compares each element with the adjacent list to sort and merge the two adjacent lists. Finally all the elements are sorted and merged. It is an efficient, general-purpose, comparison-based sorting algorithm.\n\n__Properties__\n* Worst case performance    O(n log n)\n* Best case performance    O(n log n)\n* Average case performance    O(n log n)\n\n###### View the algorithm in [action][merge-toptal]\n\n\n### Shell\n![alt text][shell-image]\n\nFrom [Wikipedia][shell-wiki]:  Shellsort is a generalization of insertion sort that allows the exchange of items that are far apart.  The idea is to arrange the list of elements so that, starting anywhere, considering every nth element gives a sorted list.  Such a list is said to be h-sorted.  Equivalently, it can be thought of as h interleaved lists, each individually sorted.\n\n__Properties__\n* Worst case performance O(nlog2 2n)\n* Best case performance O(n log n)\n* Average case performance depends on gap sequence\n\n###### View the algorithm in [action][shell-toptal]\n\n### Time-Complexity Graphs\n\nComparing the complexity of sorting algorithms (Bubble Sort, Selection Sort and Insertion Sort)\n\n![alt text][complexity-graph]\n\n[bubble-toptal]: https:\u002F\u002Fwww.toptal.com\u002Fdevelopers\u002Fsorting-algorithms\u002Fbubble-sort\n[bubble-wiki]: https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FBubble_sort\n[bubble-image]: https:\u002F\u002Fupload.wikimedia.org\u002Fwikipedia\u002Fcommons\u002Fthumb\u002F8\u002F83\u002FBubblesort-edited-color.svg\u002F220px-Bubblesort-edited-color.svg.png \"Bubble Sort\"\n\n[insertion-toptal]: https:\u002F\u002Fwww.toptal.com\u002Fdevelopers\u002Fsorting-algorithms\u002Finsertion-sort\n[insertion-wiki]: https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FInsertion_sort\n[insertion-image]: https:\u002F\u002Fupload.wikimedia.org\u002Fwikipedia\u002Fcommons\u002F7\u002F7e\u002FInsertionsort-edited.png \"Insertion Sort\"\n\n[quick-toptal]: https:\u002F\u002Fwww.toptal.com\u002Fdevelopers\u002Fsorting-algorithms\u002Fquick-sort\n[quick-wiki]: https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FQuicksort\n[quick-image]: https:\u002F\u002Fupload.wikimedia.org\u002Fwikipedia\u002Fcommons\u002F6\u002F6a\u002FSorting_quicksort_anim.gif \"Quick Sort\"\n\n[merge-toptal]: https:\u002F\u002Fwww.toptal.com\u002Fdevelopers\u002Fsorting-algorithms\u002Fmerge-sort\n[merge-wiki]: https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FMerge_sort\n[merge-image]: https:\u002F\u002Fupload.wikimedia.org\u002Fwikipedia\u002Fcommons\u002Fc\u002Fcc\u002FMerge-sort-example-300px.gif \"Merge Sort\"\n\n[selection-toptal]: https:\u002F\u002Fwww.toptal.com\u002Fdevelopers\u002Fsorting-algorithms\u002Fselection-sort\n[selection-wiki]: https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FSelection_sort\n[selection-image]: https:\u002F\u002Fupload.wikimedia.org\u002Fwikipedia\u002Fcommons\u002Fthumb\u002Fb\u002Fb0\u002FSelection_sort_animation.gif\u002F250px-Selection_sort_animation.gif \"Selection Sort Sort\"\n\n[shell-toptal]: https:\u002F\u002Fwww.toptal.com\u002Fdevelopers\u002Fsorting-algorithms\u002Fshell-sort\n[shell-wiki]: https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FShellsort\n[shell-image]: https:\u002F\u002Fupload.wikimedia.org\u002Fwikipedia\u002Fcommons\u002Fd\u002Fd8\u002FSorting_shellsort_anim.gif \"Shell Sort\"\n\n[linear-wiki]: https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FLinear_search\n[linear-image]: http:\u002F\u002Fwww.tutorialspoint.com\u002Fdata_structures_algorithms\u002Fimages\u002Flinear_search.gif\n\n[binary-wiki]: https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FBinary_search_algorithm\n[binary-image]: https:\u002F\u002Fupload.wikimedia.org\u002Fwikipedia\u002Fcommons\u002Ff\u002Ff7\u002FBinary_search_into_array.png\n\n[complexity-graph]: https:\u002F\u002Fgithub.com\u002Fprateekiiest\u002FPython\u002Fblob\u002Fmaster\u002Fsorts\u002Fsortinggraphs.png\n\n----------------------------------------------------------------------------------\n\n## Community Channel\n\nWe're on [Gitter](https:\u002F\u002Fgitter.im\u002FTheAlgorithms)! Please join us.\n\n## Contribution\n\nPlease read our [CONTRIBUTING.md](https:\u002F\u002Fgithub.com\u002FTheAlgorithms\u002FDart\u002Fblob\u002Fmaster\u002FCONTRIBUTING.md).\n\n## License\n\n[MIT](https:\u002F\u002Fgithub.com\u002FTheAlgorithms\u002FDart\u002Fblob\u002Fmaster\u002FLICENSE)\n","TheAlgorithms\u002FDart 是一个用 Dart 语言实现各种算法的开源项目，旨在为学习者提供算法的实践参考。该项目包含了多种常用的数据结构与算法，如线性搜索、二分查找、冒泡排序和插入排序等，并详细列出了每种算法的时间复杂度和空间复杂度。所有实现均基于教育目的设计，虽然可能不如 Dart 标准库中的实现高效，但非常适合编程初学者或对算法感兴趣的开发者用于学习和理解基础算法原理。此外，由于采用了 MIT 许可证，它也适合于希望在自己的项目中直接使用这些算法实现的研究人员或开发者。","2026-06-11 03:21:53","top_language"]