BrandonArmand / Binari

Interactive code editor with a live binary tree visual designed to teach new developers the fundamentals of Data Structures.
https://binari.dev
MIT License
177 stars 110 forks source link

Lesson Updates #8

Open BrandonArmand opened 4 years ago

BrandonArmand commented 4 years ago

lessons.

Who can help

Anyone. If you think you can contribute to the development on a lesson, go ahead.

How do I build a lesson?

Each lesson should clearly describe the chapter's method through pseudo-code with thorough explanations on how and why every step is happening. It should be possible for a new developer to dive in and build the method using nothing but the lesson's explanation.

There is a very precise structure for creating a lesson.

Binari\src\views\Playground\chapters is where every lesson is laid out.

..\one
....\defaultCode.js
....\index.js
....\lesson.js
..\zero
....\defaultCode.js
....\index.js
....\lesson.js
..\index.js

Every chapter will have have it's own folder, and get referenced in index.js

import zero from './zero'
import one from './one'

export default [
    zero,
    one
]

lesson.js will be rendered in markdown defaultCode.js will be wrapped in a string index.js will reference these files.

When a new folder is added to Binari\src\views\Playground\chapters\index.js, it will automatically get added to the directory in the playground through this code.

This will not needed to be changed to add a lesson.

import chapter from './chapters'
const [page, setPage] = useState(0);
const [currentCode, setCode] = useState(beautify(chapter[page].defaultCode));
...
{chapter.map((el,i)=> <tr onClick={()=>changePage(i)} style={{background: page === i && "#222"}}><td>{i}</td><td>{el.name}</td></tr>)}
alti21 commented 4 years ago

Hi @BrandonArmand I would like to contribute to a lesson. I wanted to ask, what would you like to do with the 2nd lesson, since the first lesson already has binary tree insertion?

BrandonArmand commented 4 years ago

@alti21 just do anything you would like. The first lesson is meant to be an overview of binary trees as a whole, so i’m still deciding what to do with it, but for each other lesson, feel free to get creating. We obviously want the basics first, such as insertion, searching, checking size, etc.. but don’t worry about the first one already having methods, something will be done to it in the future.

hrishibawane commented 4 years ago

Hi @BrandonArmand I would like to contribute some lessons. Should I start working on it?

BrandonArmand commented 4 years ago

@hrishibawane please do :)

hrishibawane commented 4 years ago

@BrandonArmand one question. The insertion code you wrote depicts a binary search tree, with lesser elements in left subtree and greater in the right. Except that there should not be any duplicates. So do you want to continue the next lessons for a BST or just a binary tree?

BrandonArmand commented 4 years ago

@hrishibawane that's a great question because I plan to (hope to at least) have all types of data structures, which is why it is simply called Binari. For now though, let's focus on BST and work our way up. I will add that clarification to issue, thanks.

hrishibawane commented 4 years ago

Hey @BrandonArmand, I have created the search lesson for now and its working perfectly. Can you review it, so that I can work on next lessons too? Should I send a PR?

hrishibawane commented 4 years ago

Also, I have updated the code for duplicates and the introduction of BST instead of binary tree.

hrishibawane commented 4 years ago

@BrandonArmand Can you review the PR and also update this issue?

arrohit258 commented 4 years ago

@BrandonArmand I would like to contribute to some lessons? Which ones are still open? If there is none then I'll like to add a lesson on deleting a node in BST. Should I start working on it?

BrandonArmand commented 4 years ago

Hey @Rohit-Arora-0508 !

You can absolutely do that; however, the app is going to evolve into a lesson by lesson process. This means that the user will need to figure out the algorithm themselves to move onto the next lesson, so what I would like to be done is to turn all of the large default codes into a minimal bit of code. It should only contain methods that the user would have already completed in the past AND are required to complete the current lesson. And the method being taught in the current lesson will be explained in the lesson section using pseudo-code and explanations, to which the developer will need to work out themselves and develop.

So in short, if you would like, you can expand on the current lessons by providing the user with pseudo-code and larger descriptions to work with. You can also explain the pseudo-code using the usual class structure as I will be changing how the text editor transpiles the code.

mjluck commented 3 years ago

For tests, did you have in mind to implement the test.js files or to configure tests that work with npm test by making tests folders?

bskumawat09 commented 2 years ago

Hi @BrandonArmand, Is this repo still open for contribution? I am exploring it, inorder to contribute more lessons.

SilverDragonOfR commented 1 year ago

Hi @BrandonArmand, Can a first-timer propose and make a lesson? I wanted to add lessons for "Inorder Successor, Inorder Predecessor, kth Largest element, Find the LCA"? Should I start working on it?