Giter Club home page Giter Club logo

ctci-6th-edition-cpp's People

Contributors

bobolee1239 avatar endiliey avatar esterl avatar gaylemcd avatar hisandy avatar kohn1001 avatar krishmunot avatar lancerts avatar larissalages avatar lngchn avatar mandliya avatar manshi10 avatar meltahawy avatar mukarr avatar mumbaikar007 avatar mvlassis avatar olivierli avatar prateeksingh009 avatar reidoda avatar rishabhjainps avatar sanjeev-s avatar sergio-nsk avatar tsravankumar 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  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

ctci-6th-edition-cpp's Issues

Ch 4. Trees and Graphs/4.4_Check_Balanced.cpp... wrong wrapper function

int checkHeight(TreeNode* root) {
if (root == nullptr) {
return 0;
}
int leftHeight = checkHeight(root->left);
if (leftHeight == -1) {
return -1;
}
int rightHeight = checkHeight(root->right);
if (rightHeight == -1) {
return -1;
}

if (abs(leftHeight - rightHeight) > 1) {
	return -1;
}
else {
	return max(leftHeight, rightHeight) + 1;
}

}

//wrapper function should be checkHeight != -1 ... not checkHeight == -1
bool isBalanced(TreeNode* root) {
//return (checkHeight == -1);
return (checkHeight != -1);
}

Cloning repository on Windows

Cloning the repository on windows platform gives an error.
This is caused by an extra space character at the end of the directory name

Ch 4. Trees and Graphs

Ch 4. Trees and Graphs / 4.2_Minimal_Tree.cpp syntax error

The code declares a pointer in line 10, but doesn't use pointer notation to access it

TreeNode* newNode = new TreeNode(arr[mid]);
newNode.left = createMinBST(arr, start, mid - 1);  // Should be newNode->left
newNode.right = createMinBST(arr, mid + 1, end); // Should be newNode->right

Using STL classes for linked lists.

I'm trying to understand why the implementation of the linked lists, as present in the class in C++, is not used. It would be easier to write, and the code would be a lot less, and cleaner.

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.