Giter Club home page Giter Club logo

datastructure-algorithm-cpp's Introduction

Hi I'm StrayDragon πŸ‘‹

A web backend developer, good at python and other backend development

Stay hungry, stay foolish! πŸ”

Ahhh, Forgot me? here are my old avatars:

...

datastructure-algorithm-cpp's People

Stargazers

 avatar  avatar

Watchers

 avatar

datastructure-algorithm-cpp's Issues

[Bug] If uncomment the 'if' statement code block in test file, a weird bug will appear!

  • test file in Tests/unit_test_main.cpp Function: ADTQueueTestMachine(Queue* queue)

  • Bug code snippet in ADTs/LinkedQueue.cpp LinkedQueue::enqueue(const E &element)

  • After compiled by using G++, ran it but received a Segmentation Fault

$ g++ -std=c++11 unit_test_main.cpp                                                                      ~/GitHubRepo/DataStructure-Algorithm-Cpp/Test
$ ./a.out                                                                                                ~/GitHubRepo/DataStructure-Algorithm-Cpp/Test
Hello! This is unit test main.

        test target implementation : 9ArrayListIiE              ==OK==
        test target implementation : 10LinkedListIiE            ==OK==
        test target implementation : 10ArrayStackIiE            ==OK==
        test target implementation : 11LinkedStackIiE           ==OK==
        test target implementation : 10ArrayQueueIiE            ==OK==
[1]    11065 segmentation fault (core dumped)  ./a.out
  • I debugged and found the problem on that function (LinkedQueue::enqueue()), and it cannot call new to get new Node object....,As soon as it runs, it will report an error (Segmentation Fault).

  • After compiled by using Clang++ , ran it but received a unexpected result

$ clang++ -std=c++11 unit_test_main.cpp                                                            ~/GitHubRepo/DataStructure-Algorithm-Cpp/Test
$ ./a.out                                                                                                ~/GitHubRepo/DataStructure-Algorithm-Cpp/Test
Hello! This is unit test main.

        test target implementation : 9ArrayListIiE              ==OK==
        test target implementation : 10LinkedListIiE            ==OK==
        test target implementation : 10ArrayStackIiE            ==OK==
        test target implementation : 11LinkedStackIiE           ==OK==
        test target implementation : 10ArrayQueueIiE            ==OK==
a.out: unit_test_main.cpp:120: void ADTQueueTestMachine(Queue<E> *) [E = int]: Assertion `queue->front() == i' failed. 
  • In fact, the queue->front() is 1 , not expected value 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.