Skip to content

SamxShin/CS3310_Final

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

CS3310 Final

This project contains solutions to these three coding problems:

  1. You are given an array of integers (both positive and negative values). Find the contiguous sequence with the largest sum.

EXAMPLE Input: 2, -8, 3, -2, 4, -10 Output: 5 which is the sequence [3, -2, 4]

This solution can be found in the file named "ContiguousLargestSum.java"

Time Complexity: O(n)

Space Complexity: O(1)

  1. Given 2 very large binary trees T1 and T2. Create an algorithm to deter-mine if T2 is a subtree of T1. Assume T1 is always much larger than T2

This solution can be found in the file named "SubTreeProblem.java"

Time Complexity: O(n * m)

Space Complexity: O(log(n) + log(m))

  1. Given an NxN matrix of positive and negative integers, find the submatrix with the largest possible sum

This solution can be found in the file named "SubmatrixProblem.java"

Time Complexity: O(n^3)

Space Complexity: O(n)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages