This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // main.m | |
| // alg | |
| // | |
| // Created by Sergey Demchenko on 10/6/16. | |
| // Copyright © 2016 Antrix. All rights reserved. | |
| // | |
| #import <Foundation/Foundation.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // main.m | |
| // alg | |
| // | |
| // Created by Sergey Demchenko on 10/6/16. | |
| // Copyright © 2016 Antrix. All rights reserved. | |
| // | |
| #import <Foundation/Foundation.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // main.m | |
| // alg | |
| // | |
| // Created by Sergey Demchenko on 10/6/16. | |
| // Copyright © 2016 Antrix. All rights reserved. | |
| // | |
| #import <Foundation/Foundation.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // main.m | |
| // alg | |
| // | |
| // Created by Sergey Demchenko on 10/6/16. | |
| // Copyright © 2016 Antrix. All rights reserved. | |
| // | |
| #import <Foundation/Foundation.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #import <Foundation/Foundation.h> | |
| //225. Implement Stack using Queues | |
| @interface NSMutableArray (QueueAdditions) | |
| - (id) dequeue; | |
| - (void)enqueue:(id)obj; | |
| @end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #import <Foundation/Foundation.h> | |
| //Given a binary tree, return all root-to-leaf paths. | |
| // | |
| //For example, given the following binary tree: | |
| // | |
| // 1 | |
| // / \ | |
| // 2 3 | |
| // \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #import <Foundation/Foundation.h> | |
| //Given a binary tree, return all root-to-leaf paths. | |
| // | |
| //For example, given the following binary tree: | |
| // | |
| // 1 | |
| // / \ | |
| // 2 3 | |
| // \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #import <Foundation/Foundation.h> | |
| //Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum. | |
| // | |
| //For example: | |
| //Given the below binary tree and sum = 22, | |
| // 5 | |
| // / \ | |
| // 4 8 | |
| // / / \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #import <Foundation/Foundation.h> | |
| //Same Tree. | |
| @interface Node: NSObject | |
| @property (nonatomic) Node *left; | |
| @property (nonatomic) Node *right; | |
| @property (nonatomic) NSString *value; | |
| @end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #import <Foundation/Foundation.h> | |
| //Given a binary tree, find its maximum depth. | |
| @interface Node: NSObject | |
| @property (nonatomic) Node *left; | |
| @property (nonatomic) Node *right; | |
| @property (nonatomic) NSString *value; | |
| @end |
NewerOlder