LoginSignup
3

More than 1 year has passed since last update.

CodilityのLessonsを解く(更新中)

Last updated at Posted at 2020-12-17

序文

著者ロックヤン

アルゴリズムとデータ構造:
ビジネスコードを作成するときは、より「正確さ」に注意を払い、アルゴリズムや複雑なデータ構造を使用しない場合があります。
ただし、データ量が多い、またはインターネットの同時実行性が高いシナリオでは、高いパフォーマンスも考慮する必要があります。これは、ビジネスを高速化するためだけでなく、システム障害とダウンタイムが処理速度とメモリ使用量に密接に関連している場合が多いためです。わずかなパフォーマンスのギャップでも、不可逆的なシステムアバランシェを引き起こす可能性があります。

この記事について
Codilityには、多くの優れたアルゴリズムの問​​題があります。作者は一つずつ挑戦し、コードとテストケースをみんなと共有したいと思っています。
* (src&junit)とマークされた記事には、コードとテストケースが含まれています。
* マークされた記事(src&junit&author's note)には、コードとテストケース、および問題解決のアイデアやアプリケーションシナリオが含まれています。
* この記事はレッスンから始まり、将来的にチャレンジパートに含まれる予定です。
*
喜んで
今日のアプリケーションシナリオでのさまざまなソリューションとその使用法についてお話ししたいと思います。メッセージを残してください。

Githubアドレス:https://github.com/yp2211/algorithm

前言
作者 Roc Yang
算法与数据结构:
在编写业务代码时,我们关注更多的“正确性”,未必用得到算法和复杂的数据结构。
但在大数据量、或互联网高并发的场景下,我们还需要考虑高性能。这不仅仅是因为我们想让业务更快一点,更重要的是因为系统的故障、宕机在很多情况下都与处理速度、内存使用的多少息息相关。甚至是细微的性能差距,就会造成不可挽回的系统雪崩。
关于本文
Codility中,有很多好的算法题目。作者想逐一挑战,并把代码和测试用例分享给大家。
* 标有(src & junit)的文章中,包含代码和测试用例;
* 标有(src & junit & 著者注)的文章中,包含代码和测试用例,以及解题思路或应用场景;
* 本文从Lesson开始,将来会纳入challenges的部分。

希望能够跟各位一起探讨各种解法、以及当今应用场景中的用途,欢迎留言。
Github地址: https://github.com/yp2211/algorithm


AVAILABLE LESSONS:

Lesson 1: Iterations

[Painless] [100%] BinaryGap (src & junit)


Lesson 2: Arrays

[Painless] [100%] CyclicRotation (src & junit)

[Painless] [100%] OddOccurrencesInArray (src & junit)


Lesson 3: Time Complexity

[Painless] [100%] FrogJmp (src & junit)

[Painless] [100%] PermMissingElem (src & junit)

[Painless] [100%] TapeEquilibrium (src & junit)


Lesson 4: Counting Elements

[Painless] [100%] FrogRiverOne (src & junit)

[Respectable] [100%] MaxCounters (src & junit & 著者注)

[Respectable] [100%] MissingInteger (src & junit & 著者注)

[Painless] [100%] PermCheck (src & junit)


Lesson 5: Prefix Sums

[Respectable] [100%] CountDiv (src & junit & 著者注)

[Respectable] [100%] GenomicRangeQuery (src & junit & 著者注)

[Respectable] [100%] MinAvgTwoSlice (src & junit)

[Painless] [100%] PassingCars(src & junit)


Lesson 6: Sorting

[Painless] [100%] Distinct (src & jUnit & 著者注)

[Painless] [100%] MaxProductOfThree(src & jUnit)

[Respectable] [100%] NumberOfDiscIntersections

[Painless] [100%] Triangle


Lesson 7: Stacks and Queues

[Easy] [100%] Brackets

[Easy] [100%] Fish

[Easy] [100%] Nesting

[Easy] [100%] StoneWall


Lesson 8: Leader

[Easy] [100%] Dominator

[Easy] [100%] EquiLeader

Lesson 9: Maximum slice problem

[Easy] [100%] MaxProfit

[Easy] [100%] MaxSliceSum

[Medium] [100%] MaxDoubleSliceSum


Lesson 10: Prime and composite numbers

[Easy] [100%] CountFactors

[Easy] [100%] MinPerimeterRectangle

[Medium] [100%] Flags

[Medium] [100%] Peaks


Lesson 11: Sieve of Eratosthenes

[Medium] [100%] CountNonDivisible

[Medium] [100%] CountSemiprimes


Lesson 12: Euclidean algorithm

[Easy] [100%] ChocolatesByNumbers

[Medium] [100%] CommonPrimeDivisors


Lesson 13: Fibonacci numbers

[Medium] [100%] FibFrog

[Medium] [] Ladder

Lesson 14: Binary search algorithm

Lesson 15: Caterpillar method

Lesson 16: Greedy algorithms

Lesson 17: Dynamic programming


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
3