JavaRush
AI Academy
new
Promotion
Learning
Courses
Tasks
Quizzes
Games
Help
Schedule of nudges
Internship
Community
Users
Forum
Chat
Articles
Success stories
Activities
Reviews
Subscriptions
Light theme

Lectures

  • Reviews
  • About us
  • CS50
Start
Start learning
Start learning
  • My progress
  • Courses
  • Quest map
  • Lectures
  • fold and reduce: start value, empty collections, and safe variants

    Kotlin SELF
    25 level,0 lecture
    We break down collection aggregations in Kotlin: how fold() and reduce() work, what the accumulator acc is, why the start value ( initial) is critical for correctness, why empty lists are dangerous for reduce(), and when to choose the safe variant reduceOrNull(). Plus: hands-on examples (sum, product, maximum) and typical mistakes.
    Open
  • Aggregations with fold: sums, minimums, and building structures

    Kotlin SELF
    25 level,1 lecture
    We break down fold as a universal aggregation technique “many elements → one result”: how to choose a neutral initial, how to compute sums and counts, how to neatly find min/max while supporting empty collections via null, how to assemble a report with StringBuilder, and how to accumulate data into a Map. At the end: a list of common mistakes and how to avoid them.
    Open
  • Sequence: laziness and terminal operations

    Kotlin SELF
    25 level,2 lecture
    We break down how Sequence works in Kotlin: why filter/ map chains “do nothing” without a terminal operation, how intermediate operations differ from terminal ones, how asSequence() switches collections into lazy mode, when you need materialization via toList(), and why early operations like firstOrNull() can stop the pipeline before it reaches the end.
    Open
  • Pipeline performance

    Kotlin SELF
    25 level,3 lecture
    We break down how to “read the cost” of chains of operations on collections: extra passes, intermediate lists, and temporary objects. We learn to understand when a List pipeline materializes results at every step, how a lazy Sequence differs, why take(n) enables early termination, and which mistakes most often happen when trying to “speed up” map/ filter/ fold chains.
    Open
  • ArrayDeque: queue and stack out of the box, basic operations, and pitfalls

    Kotlin SELF
    25 level,4 lecture
    We break down ArrayDeque in Kotlin as a “double-ended queue”: why it’s better (and more honest in meaning) than MutableList for FIFO/LIFO scenarios, what basic operations exist ( addFirst/ addLast, removeFirst/ removeLast, first()/ last()), how not to crash when removing from an empty structure using isEmpty()/ isNotEmpty(), and how to use a deque in a CLI for an add-history and an undo command. At the end: typical mistakes and mental checks so you don’t confuse a queue with a stack.
    Open
Learn
  • Registration
  • Java course
  • Help with tasks
  • Pricing
Community
  • Users
  • Articles
  • Forum
  • Chat
  • Success stories
  • Activities
Company
  • About us
  • Contacts
  • Reviews
  • FAQ
  • Support
JavaRushJavaRush — is an interactive online course for learning Java programming from scratch. It contains 1200 practical tasks with one-click solution checking, the necessary minimum of theory on Java basics, and motivating features that help you complete the course: games, quizzes, interesting projects and articles on effective learning and the career of a Java developer.
Follow us
Язык интерфейса
Русский
English
Українська
"Programmers are not born" © 2026 JavaRush
MastercardVisa
"Programmers are not born" © 2026 JavaRush