GithubHelp home page GithubHelp logo

code-review-guide-wiki's People

Contributors

gipyoo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

forbid403

code-review-guide-wiki's Issues

[리뷰요청] 노트앱 리뷰 요청 합니다.

URL : #6

코드 개요

데이터는 JSON 형식으로 노트의 제목, 노트의 내용으로 이루어져 있습니다. (title, body)
app.js에서 yargs를 사용해 입력 받고 handler로 function을 연결 해 주었습니다.
메서드들은 notes.js 파일에 있습니다. (addNote, removeNote, findNote, saveNote)

질문

기존의 function syntax에서 es6 arrow function으로 바꾸는 작업을 해봤는데
잘 바꾸었는지 궁금합니다.

[리뷰요청] 2019-12-넷째주

코드 개요

촌 수 계산 프로그램입니다.
클라이언트에서 핸드폰 번호를 입력하면, 내 친구의 핸드폰 번호를 타고 가며 몇 다리 건넌 친구인지 계산해주는 알고리즘입니다.
bfs + disjoint set 사용 했습니다.

질문

거쳐간 친구의 경로를 출력하려고 합니다.
disjoint_set.js의 find(x)가 그 역할을 합니다.
이 method 내부에서 console을 찍으면 array 형식으로 잘 나오는데,
bfs.js에서 호출하게 되면 undefined가 찍힙니다.

disjoint_set

class DisjointSet{

    constructor(){
        this.array = []
        this.ret = []
    }
    make_set(x){
        this.array[x] = x
    }
    union(x, y){      
        if(x == y) return
        this.array[y] = x
    }
    find(x){
        this.ret.push(x)
        if(this.array[x] == x) {
            console.log(this.ret)
            return this.ret
        }
        this.x = this.find(this.array[x])
    }
    getSet(){
        console.log(this.array) 
    }

}

exports.DisjointSet = DisjointSet

bfs.js

const queueUtil = require('./queue.js')
const disjointSetUtil = require('./disjoint_set.js')
const disjoint_set = new disjointSetUtil.DisjointSet()
const queue = new queueUtil.Queue()
const checked = new Set()

let flag = false
function bfs(source, target, map, callback) {
    //q에 source 넣기
    queue.push(source)
    disjoint_set.make_set(source)
    //bfs
    while (!queue.empty()) {

        if(flag == true){
            break
        }
        //dequeue top
        const top = queue.pop()

        //map에서 dest 얻기
        if (map.get(top) !== undefined) {

            map.get(top).some((v) => {
                //찾으면
                if (v === target) {
                    console.log("FOUND!" + target)

                    flag = true
                    disjoint_set.make_set(v)
                    disjoint_set.union(top, v)
                    
                    //경로 출력

                    //undefined가 떠요!!!
                    console.log(disjoint_set.find(target))

                    return true;
                }

                
                //set에 없으면
                if (!checked.has(v)) {
                    //q 삽입
                    queue.push(v)

                    //disjoint 삽입
                    disjoint_set.make_set(v)
                    disjoint_set.union(top, v)

                }


            });

        }
        checked.add(top)


    }
}

exports.bfs = bfs

[리뷰요청 예시] 김기표_11월_4주차

URL : 예시

코드 개요

이 코드는 카드 컴포넌트를 구현한 코드입니다. 카드의 이미지놔 컨텐츠를 각각의 컴포넌트로 구현했으며, 전역적인 상태관리를 위해서 message라는 context API를 만들어 데이더를 관리했습니다.

질문

컨텍스트 API를 처음 사용해 보았는데, 구조를 맞게 잡았는지는 모르겠습니다. 혹시 더 좋은 방법이 있다면 알려주시면 좋을 것 같습니다.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.