Skip to content

cs-adda/dsa-codes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

dsa-codes

1.If sum pair exists

Problem Statement- Given two unsorted arrays A of size N of distinct elements, the task is to find if a pair exist whose sum is equal to X.
Explanation- https://youtu.be/-ccJsQa6pSI
Exercise-
1.1. Given An Integer Array, Return All Pairs Whose Sum Equals Target.
A=[-5,8,9,5,-2,6,2] Target=0
Output-[-5,+5],[-2,+2]
1.2. Given An Integer Array, Return All The Triplets Whose Sum Equals Target
A=[1,10,5,8,6,2,11,3,7] Target=16
Output-[10,5,1],[5,6,5],[8,3,5],[8,7,1],[6,2,8],[11,3,2],[3,7,6]

2.Dynamic Programming Understanding- Maximum sum less than X- Google Interview

Problem Statement- Given an array of positive integers of size N and another positive integer X, find the maximum sum obtained taking the combination of elements so that the sum is less than equal to X.
N=4, X=8, arr=[1,4,6,3] max sum<=X
Explanation- https://youtu.be/eTDYuYScl6w

About

Data Structure and Algorithm code tutorials

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages