Study with active recall

Turn your notes into flashcards

Turn lecture notes, chapter summaries, or study guides into question-and-answer flashcards you can review at your own pace.

Paste text or upload a PDF / TXT file. No sign-up required to generate flashcards.

From notes to a focused study deck

  1. Start with one topic

    Choose notes from one class, chapter, or subject. A focused deck makes it easier to review related ideas and notice what you still need to learn.

  2. Generate question-and-answer cards

    Turn important terms, facts, and relationships into prompts with concise answers.

  3. Recall, reveal, and review

    Try to answer each prompt from memory before revealing the answer. Revisit the ideas that need more practice.

See what your notes can become

Source article

The Bubble Sort Algorithm - DEV Community

Maximilian

Intro

I recently took a data structures and algorithms course as part of my pursuit to learn lower level programming and computer science concepts. As the saying goes, the best way of solidifying your knowledge in something is to teach it, and since I've already filled my quota for boring my partner with coding talk for the month (probably the year), I thought I'd write a series of posts with some of the things I've learned. This is one such post.

What is the Bubble Sort Algorithm

The Bubble Sort algorithm is typically applied where simplicity is favoured over efficiency. It has a time complexity of O(n^2) which is less than ideal when dealing with larger lists.

How does it work

To explain how it works, here's some pseudo-code:

for pointer1 in list
    for pointer2 in list
        if list[j] > list[j + 1]
            swap list[j] and list[j + 1]
        pointer2++

    pointer1++


The idea of this algorithm is to 'bubble up' the larger items in the list to the end. We can think of this with 2 pointers, pointer1 and pointer2. We start by setting both pointers to the first item in the list. We then go through the entire list with pointer2 and swap the item at pointer2's position if the item at position pointer2 + 1 is greater in value. We keep repeating this process until we reach the end of the list. We then move pointer1 up by 1 and we start the process again with pointer2.

You may have noticed that we need a way of avoiding checking items that we have already sorted. Seeing as the aim of each iteration is to move the larger items to the end of the list, we can do this by limiting the boundary of pointer2 by the value of pointer1 + 1.

How do we implement it

Here's a heavily commented implementation in Typescript:

function bubbleSort(arr: number[]): void {
    // pointer 1
    for (let i = 0; i < arr.length; ++i) { 
       // pointer 2 + limit iterations by pointer1 + 1
        for (let j = 0; j < arr.length - 1 - i; ++j) {
            // check if current item is larger than the next item
            if (arr[j] > arr[j + 1]) {
                // temporarily store the current item so we don't lose it
                const tmp = arr[j];
                // swap the items in the array
                arr[j] = arr[j + 1];
                arr[j + 1] = tmp;
            }
        }
    }
}

Sorted

This isn't a likely go-to algorithm in most cases, but I think it's a nice and easy one to get started. I hope you found it useful or, at least, a little bit interesting!

Flashcards

HyNote

Tap the card to flip it. Use the controls to move through the deck and compare each answer with the article.

What is the primary benefit of the Bubble Sort algorithm?
Tap to flip
Simplicity is favored over efficiency.

Use flashcards with the study material you already have

Lecture notes

Review key concepts, definitions, and examples from class.

Lecture recordings and transcripts

Record a class with HyNote, then use its transcript or structured notes as source material for a study deck.

Chapter summaries and study guides

Break a longer reading into smaller prompts that are easier to review.

PDF and TXT files

Upload a supported PDF or TXT file, or paste text directly into the generator.

Start with the notes you already have

Image notes

Turn a photo, screenshot, or handwritten page into notes. Then create flashcards to review the key terms and ideas you want to remember.

Podcast notes

Turn a podcast episode into notes, then use them to create flashcards for reviewing the concepts and examples you learned while listening.

Video notes

Turn a recorded class, webinar, or other MP4 video into notes. Use the notes to create flashcards and revisit the main ideas at your own pace.

Ready to test your understanding?

Once you’re familiar with the key concepts, turn your notes into a quiz. Practice answering questions to check what you’ve learned and find topics to review again.

Create a quiz from notes

Make each review session more useful

  • Try to recall before checking

    Pause on the prompt and form an answer before revealing the back of the card.

  • Find ideas that need another look

    A difficult card can point you back to a definition, example, or connection worth reviewing in your notes.

  • Check cards against your source

    Review generated questions and answers against your original material, especially when context matters.

Frequently asked questions

Paste notes into the text box or upload a supported PDF or TXT file, then choose Generate flashcards. HyNote turns the material into question-and-answer cards you can review one at a time.

Use notes focused on one class, chapter, or topic. Clear definitions, key facts, examples, and explanations of how ideas connect give you useful prompts to practise.

Yes. Upload a supported PDF or TXT file, or paste the text directly. PDFs need selectable, extractable text; scanned or handwritten pages may need to be converted to text first.

Yes. Record your lecture in HyNote, then use the Flashcards template in your notebook to turn the transcript or structured notes into flashcards for review.

This tool creates question-and-answer cards automatically. It does not currently offer controls for card count or difficulty, so use notes from a focused topic to keep the deck relevant.

Yes. You can generate and review flashcards with this public tool without signing up. Sign in or create an account if you want to save your source notes and flashcards in HyNote.

Yes. Compare each question and answer with your source material, especially when context matters. Use cards you miss to decide which ideas to review again.

Yes. Sign in or create an account, then choose Save flashcards to HyNote to keep the source notes and deck together. Continue in HyNote

Explore related HyNote features

Turn your notes into a study routine

Generate focused flashcards, practise recall, and use HyNote to keep your study materials together.