Coder Social home page Coder Social logo

Comments (2)

dev-jko avatar dev-jko commented on May 26, 2024 2

질문1
(0 - 2 - 1)로만 연결된 그래프를 생각해보시면 좋을 것 같습니다!

질문2
그래프의 데이터가 void형 포인터들이라 모든 형태의 데이터든 저장할 수 있어요
make_graph에서는 문자열이기 때문에 단순 free함수로 메모리 해제를 할 수 있지만
복잡한 형태의 데이터라면 free함수로는 메모리 누수가 생길 수 있습니다

예)

typedef strcut s_my_struct {
    char *str;
    char *str2;
} t_my_struct

t_my_struct *my = 메모리할당 + 초기화;
free(my);  // my->str과 my->str2에서 메모리 누수가 발생할 수 있음

from 42-algorithm.

365kim avatar 365kim commented on May 26, 2024 1

오우 바로바로 이해가 됩니다 설명짱짱!
make_graph에서 주는 데이터가 문자열이기 때문에 가능한 것이었군요
친절한 설명 감사드립니다~!!
42알고리즘 만세~~~

from 42-algorithm.

Related Issues (9)

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.