Skip to content

Instantly share code, notes, and snippets.

View realgio95's full-sized avatar

Giovanni HoSang realgio95

View GitHub Profile
#include<cmath>
#include<iostream>
#include<climits>
using namespace std;
int Maximum_Sum_Subarray(int arr[],int n) //Overall Time Complexity O(n)
{
int ans = A[0],sum = 0;
for(int i = 1;i < n; ++i) //Check if all are negative
ans = max(ans,arr[i]);
@realgio95
realgio95 / PreorderInorderPostorder_CPP.cpp
Created December 11, 2015 12:00 — forked from mycodeschool/PreorderInorderPostorder_CPP.cpp
Binary tree traversal: Preorder, Inorder, Postorder
/* Binary Tree Traversal - Preorder, Inorder, Postorder */
#include<iostream>
using namespace std;
struct Node {
char data;
struct Node *left;
struct Node *right;
};