GithubHelp home page GithubHelp logo

tonnytg / 42_push_swap Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 252 KB

Push Swap print some instructions to sort integers

C 95.87% Makefile 3.46% Dockerfile 0.15% Shell 0.52%
42pushswap c sort traning

42_push_swap's Introduction

new Topics to Study:

  • Machine Learning and LLM
  • VR/AR Interface for Meta Quest 3

About Me:

  • ๐Ÿ‘‹ Hi, Iโ€™m Antonio Thomacelli
  • ๐Ÿ‘€ Iโ€™m interested in Full Cycle Development and DevOps
  • ๐Ÿ’ž๏ธ Iโ€™m looking to collaborate on Kubernetes, HELM, Istio, or Go Projects ...
  • ๐Ÿ“ซ How to contact me [email protected]

๐ŸŒฑ Learning:

  • Iโ€™m currently learning C, Go, ReactJS and Software Architecture ...

๐Ÿ“Œ Pinned:

  • Projects pinned means, This is where I'm currently working!

42_push_swap's People

Contributors

tonnytg avatar

Watchers

 avatar

42_push_swap's Issues

Convert push and pop to get and save vetor with 2 position int *value_ptr

What expected?
Function int sort_p_void(int total, void **array, void **swap, char c) need get int *value_ptr with pop and save in another array with push.

What happened?
Function get only value int, save in another array losing indice

How to solve?
Refact sort_p_void to save vetor in int *value_ptr and move to another array with same indice

bug: input -1 receive error

when receive input with negative numbers, program return Error because check_values understand -1 argv[0][0] = - it is not a number

Testar

Validar se esse numero quebra
./push_swap 10000000000000000000000000000000000000000000000000000000000000000 3 1

fix valgrind leak

exec: valgrind ./push_swap 2 1 3
received:

==6637== Memcheck, a memory error detector
==6637== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==6637== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info
==6637== Command: ./push_swap 2 1 3
==6637== 
==6637== Invalid read of size 8
==6637==    at 0x40153C: pop_void (push_swap_utils.c:80)
==6637==    by 0x401A4B: sort_p_void (ft_sort_utils.c:116)
==6637==    by 0x401AF4: ft_sort_void (ft_sort.c:26)
==6637==    by 0x4016B3: push_swap (push_swap.c:31)
==6637==    by 0x401C21: main (main.c:24)
==6637==  Address 0x4a4d058 is 0 bytes after a block of size 24 alloc'd
==6637==    at 0x483B7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==6637==    by 0x401287: new_array_void (array_utils.c:43)
==6637==    by 0x40163F: push_swap (push_swap.c:22)
==6637==    by 0x401C21: main (main.c:24)
==6637== 
pb
sa
==6637== 
==6637== HEAP SUMMARY:
==6637==     in use at exit: 4 bytes in 1 blocks
==6637==   total heap usage: 6 allocs, 5 frees, 64 bytes allocated
==6637== 
==6637== LEAK SUMMARY:
==6637==    definitely lost: 4 bytes in 1 blocks
==6637==    indirectly lost: 0 bytes in 0 blocks
==6637==      possibly lost: 0 bytes in 0 blocks
==6637==    still reachable: 0 bytes in 0 blocks
==6637==         suppressed: 0 bytes in 0 blocks
==6637== Rerun with --leak-check=full to see details of leaked memory
==6637== 
==6637== For lists of detected and suppressed errors, rerun with: -s
==6637== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)

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.