0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

brilliantのalgorithm, fundamental algorithm, data strucutureのざっくりまとめ
https://brilliant.org/daily-problems/

関数を作るときに、コードの書き方(データのしまい方、扱い方)によって早くなったり、
メモリ消費を抑えられたりできる。どうやってコンピューターに命令していくのか。
そもそもの仕組み・考え方

sort(insertion sort, merge sort, quicksort, radix sort)
dataのsortにはいくつかの方法がある。どんなデータを扱うかなどの状況に応じて使い分ける。

insertion sort

https://brilliant.org/practice/insertion-sort-2/?p=2
ソートされてないところからソートされているところに挿入する。 0(n^2))

merge sort

https://brilliant.org/practice/mergesort-2/?p=5
二つに分けてソートしていく。O(nlogn) n回2つに分けて検索 (logn))

quicksort

https://brilliant.org/practice/quicksort-2/?p=2
一個pivot pointを決める。その左側にあるpivotより大きな数字と、右側にある小さな数字を入れ替える
※ちょっとややこしいので割愛。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?