Coder Social home page Coder Social logo

renmoqiqi / 100-days-of-ios-datastructure-algorithm Goto Github PK

View Code? Open in Web Editor NEW
849.0 36.0 134.0 1 MB

100天iOS数据结构与算法实战

License: MIT License

Objective-C 100.00%
algorithm algorithms-datastructures leetcode-ios algorithm-practice algorithm-ios leetcode

100-days-of-ios-datastructure-algorithm's People

Contributors

renmoqiqi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

100-days-of-ios-datastructure-algorithm's Issues

Day02 Demo: -[DSStack compressedStack] problem

image

I found that you didn't add the data to the new array. So I think it should be replaced like this:

- (void)compressedStack
{
    NSUInteger capacitySize = (NSUInteger)(self.maxStackSize * 0.9);
    NSUInteger stackSize = self.stackArray.count;
    if (stackSize < capacitySize)
    {
        NSMutableArray *newArray = [[NSMutableArray alloc] initWithCapacity:stackSize];
        for (id object in self.stackArray)
        {
            [newArray addObject:object];
        }
        self.stackArray = newArray;
        self.maxStackSize = stackSize;
    }
}

Queue的方法isEmpty实现有些问题?

应该使用如下的方法实现吧?

- (BOOL)isEmpty
{
//    if (self.queueArray.count == 0)
    if (self.countOfQueue == 0)
    {
        return YES;
    }
    return NO;
}


- (NSInteger)countOfQueue
{
//    return self.queueArray.count;
    return self.queueArray.count - self.headIndex;
}

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.