Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hactoberfest-2024 #1

Open
wants to merge 439 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
439 commits
Select commit Hold shift + click to select a range
4e24e8a
Merge pull request #101 from whitebeard10/patch-1
MSubhajitIND Oct 5, 2023
bf46ac5
Chessboard and Queens CSES problemset.
replyre Oct 5, 2023
f6f0cb1
Merge pull request #1 from replyre/replyre-patch-1
replyre Oct 5, 2023
059adb6
Create GrayCode.cpp
replyre Oct 5, 2023
6eba636
Create TowerOfHanoi.cpp
replyre Oct 5, 2023
a3b0c46
Merge pull request #104 from replyre/patch-2
MSubhajitIND Oct 5, 2023
abca16f
Merge pull request #103 from replyre/patch-1
MSubhajitIND Oct 5, 2023
d28bada
Merge pull request #105 from replyre/main
MSubhajitIND Oct 5, 2023
6ba89e9
Added Tower of hanoi code
abhaygzb15 Oct 5, 2023
bfb5dc6
Added Depth First Search for Traversal of Graph
Saatwik122 Oct 5, 2023
41a6a14
Binary_Search.cpp
Pragya1001 Oct 5, 2023
458034d
Create BinarySrch.cpp
Jugnu-Gupta Oct 5, 2023
61ba792
Merge pull request #110 from Jugnu-Gupta/main
MSubhajitIND Oct 5, 2023
2a0ccf2
Merge pull request #109 from Pragya1001/patch-1
MSubhajitIND Oct 5, 2023
e024866
Merge pull request #106 from abhaygzb15/main
MSubhajitIND Oct 5, 2023
a4132f7
Create Readme.md
Amisha2004 Oct 5, 2023
4a55107
Added stacks & Queues
Amisha2004 Oct 5, 2023
8d893e4
Merge pull request #111 from Amisha2004/main
MSubhajitIND Oct 5, 2023
ac123e3
shell sort
ujjwalbhandarii Oct 5, 2023
e90c829
shell sort
ujjwalbhandarii Oct 5, 2023
0e50d74
Create treap.cpp
surajwakka Oct 5, 2023
035f8ad
Merge pull request #115 from surajwakka/patch-1
MSubhajitIND Oct 5, 2023
a7c6adb
Merge pull request #114 from ujjwalbhandarii/main
MSubhajitIND Oct 5, 2023
2de674e
Create sudokusolver_backtracking.cpp
surajwakka Oct 5, 2023
07c4bfd
Create _Binary_Search.cpp
Jugnu-Gupta Oct 5, 2023
6686b69
Create BS.cpp
Jugnu-Gupta Oct 5, 2023
9fd0795
Create zigzag_binaryTree.cpp
Shivanipalya26 Oct 5, 2023
79d0b9f
Create Calculator.c
BupendraDhyan Oct 5, 2023
eed8f3a
Merge pull request #1 from Shivanipalya26/Shivanipalya26-patch-1
Shivanipalya26 Oct 5, 2023
62209a6
Merge pull request #117 from Jugnu-Gupta/main
MSubhajitIND Oct 5, 2023
d7bd88c
Merge pull request #118 from BupendraDhyan/main
MSubhajitIND Oct 5, 2023
9f354e1
Merge pull request #116 from surajwakka/patch-2
MSubhajitIND Oct 5, 2023
31cc08d
Create ReverseMadness.cpp
Aditya-devp Oct 5, 2023
51f0093
Create Vasilije in Cacak.cpp
Aditya-devp Oct 5, 2023
91a2279
Create TwoVessels.cpp
Aditya-devp Oct 5, 2023
1d954d5
Create B_S.cpp
Jugnu-Gupta Oct 5, 2023
d72cc78
Merge pull request #121 from Aditya-devp/patch-3
MSubhajitIND Oct 5, 2023
ef226d9
Merge pull request #120 from Aditya-devp/patch-2
MSubhajitIND Oct 5, 2023
b10f1c6
Merge pull request #119 from Aditya-devp/patch-1
MSubhajitIND Oct 5, 2023
750c5d1
Merge pull request #122 from Jugnu-Gupta/main
MSubhajitIND Oct 5, 2023
9a20c95
Create kadane_Algo.cpp
Jugnu-Gupta Oct 5, 2023
bede69f
Create Q5.cpp
naveen701526 Oct 5, 2023
8c0f46a
Update Readme.md
naveen701526 Oct 5, 2023
6f3ffb4
Merge pull request #124 from naveen701526/main
MSubhajitIND Oct 5, 2023
6bb5695
Merge pull request #123 from Jugnu-Gupta/main
MSubhajitIND Oct 5, 2023
9eafd3e
Create Kadane's Algorithm
tanisha91 Oct 5, 2023
8d148a7
Merge pull request #125 from tanisha91/patch-1
MSubhajitIND Oct 6, 2023
f9aea80
Merge pull request #108 from Saatwik122/main
MSubhajitIND Oct 6, 2023
4e7d6e4
Add files via upload
Dev-Abhay01 Oct 6, 2023
b9ca70c
Merge pull request #127 from Dev-Abhay01/main
MSubhajitIND Oct 6, 2023
88f4147
Added Snake Game in C++
shashank21raj Oct 6, 2023
3c00a3a
Merge pull request #128 from shashank21raj/main
MSubhajitIND Oct 6, 2023
44124c5
Create Treap.cpp
surajwakka Oct 6, 2023
f82748b
Merge pull request #129 from surajwakka/patch-3
MSubhajitIND Oct 6, 2023
8ba2cbc
Binomial Theorem using C
ArchismwanChatterjee Oct 6, 2023
b7a1bd3
Prim's Algorithm added
tusharkumar19701 Oct 6, 2023
a5f1311
added a pattern program in c
Akataruka Oct 6, 2023
c83f88b
Create BubbleSort.cpp
NileshPatil1912 Oct 6, 2023
1448546
Create FascinatingNumber.cpp
NileshPatil1912 Oct 6, 2023
f62022c
Create Maximum profit in Job Scheduling.cpp
DebosmitaChatterjee24 Oct 6, 2023
042ae64
Added Integer_break in DP
p1kalys Oct 6, 2023
82dbebe
Kth largest/smallest element in Binary Search Tree
Tr0nML Oct 6, 2023
4d74c70
Kahn’s Algorithm
Tr0nML Oct 6, 2023
2440642
Alien Dictionary
Tr0nML Oct 6, 2023
54d05f2
Binary tree construction
Tr0nML Oct 6, 2023
4f984ae
Merge pull request #142 from Tr0nML/patch-5
MSubhajitIND Oct 6, 2023
751d8f7
Merge pull request #141 from Tr0nML/patch-3
MSubhajitIND Oct 6, 2023
37ac9a2
Merge pull request #140 from Tr0nML/patch-2
MSubhajitIND Oct 6, 2023
5dbb5c7
Merge pull request #139 from Tr0nML/patch-1
MSubhajitIND Oct 6, 2023
94ea31c
Merge pull request #138 from p1kalys/pavan
MSubhajitIND Oct 6, 2023
3745381
Merge pull request #137 from DebosmitaChatterjee24/main
MSubhajitIND Oct 6, 2023
ad05dd5
Merge pull request #135 from NileshPatil1912/HactoberFest2023-NileshP…
MSubhajitIND Oct 6, 2023
6c439f6
Merge pull request #136 from NileshPatil1912/Hactoberfest2023-2
MSubhajitIND Oct 6, 2023
3069e08
Merge pull request #133 from Akataruka/Akataruka-patch-1
MSubhajitIND Oct 6, 2023
d9f901e
Merge pull request #132 from tusharkumar19701/another
MSubhajitIND Oct 6, 2023
959b06b
Merge pull request #131 from ArchismwanChatterjee/main
MSubhajitIND Oct 6, 2023
4aaf8b4
✨ feature: add `exec with fork` on c language
PunGrumpy Oct 6, 2023
3c5ac86
Merge branch 'random957654:main' into main
PunGrumpy Oct 6, 2023
5b90142
Merge pull request #143 from PunGrumpy/main
MSubhajitIND Oct 6, 2023
c7a8006
Searching in a Sorted Array
Parvsharma04 Oct 6, 2023
8c7996a
Merge pull request #144 from Parvsharma04/main
MSubhajitIND Oct 6, 2023
0df4744
find armstron number
YashAdake Oct 6, 2023
a64fde2
Create IntegerBreak.cpp
ronbil Oct 6, 2023
e9d991b
Create romantointeger.cpp
pawarp19 Oct 6, 2023
732a365
Create SearchingInSortedArray.cpp
Chinmayee7697 Oct 6, 2023
5021c09
Create LinkedList.cpp
Mahikagarg09 Oct 6, 2023
3740ade
Merge pull request #150 from Mahikagarg09/linkedlist
MSubhajitIND Oct 6, 2023
c69df1a
Merge pull request #149 from Chinmayee7697/new
MSubhajitIND Oct 6, 2023
3ef0d42
Merge pull request #148 from pawarp19/main
MSubhajitIND Oct 6, 2023
21af9d8
Merge pull request #147 from ronbil/patch-1
MSubhajitIND Oct 6, 2023
cd065d3
Merge pull request #146 from YashAdake/main
MSubhajitIND Oct 6, 2023
16fcff8
Merge pull request #151 from Shivanipalya26/main
MSubhajitIND Oct 6, 2023
0c24bf7
Update BinarySearch.cpp
Manya0209 Oct 6, 2023
5f4bf68
Merge pull request #153 from Manya0209/patch-1
MSubhajitIND Oct 6, 2023
e24c606
BinarySearch Added
anshul-132002 Oct 7, 2023
c257baf
Merge pull request #155 from anshul-132002/new-user
MSubhajitIND Oct 7, 2023
d3fd840
Create 316.Remove_Duplicate_Letters.cpp
AjayGurjar1 Oct 7, 2023
449dbd3
commit-1
Raghavendra2345678 Oct 7, 2023
c9b6b6b
Merge pull request #157 from Raghavendra2345678/main
MSubhajitIND Oct 7, 2023
fec0150
Revert "commit-1"
MSubhajitIND Oct 7, 2023
61a3c1b
Merge pull request #158 from random957654/revert-157-main
MSubhajitIND Oct 7, 2023
3d03747
Merge pull request #156 from AjayGurjar1/patch-1
MSubhajitIND Oct 7, 2023
c5815ae
Delete TowerofHanoi directory
MSubhajitIND Oct 7, 2023
808b503
NavigateQuest Game
AimanShykh Oct 7, 2023
797e900
Create 0,1Knapsack Problem.cpp
aditya7302 Oct 7, 2023
164fd5e
Merge pull request #162 from aditya7302/main
MSubhajitIND Oct 7, 2023
5127ff2
Merge pull request #160 from AimanShykh/main
MSubhajitIND Oct 7, 2023
85090cf
Create MissingNumberInArray.cpp
NileshPatil1912 Oct 7, 2023
816c562
add code to count the number of vowels in an input string
EniolaAdemola Oct 7, 2023
3fa3da1
Merge pull request #167 from EniolaAdemola/VowelCount-EniolaAdemola
MSubhajitIND Oct 7, 2023
4952654
Merge pull request #166 from NileshPatil1912/Hactoberfest2023_3
MSubhajitIND Oct 7, 2023
52df42b
Create Longest Common substring
wittysam8382 Oct 7, 2023
238bea1
Merge pull request #169 from wittysam8382/main
MSubhajitIND Oct 7, 2023
50c68c3
Added Dijkstra's shortest Path
harshmishra19 Oct 7, 2023
07784a3
Merge pull request #170 from harshmishra19/Add/Dijkstras-algo
MSubhajitIND Oct 7, 2023
25acd7e
Create SearchElementinSortedArray.cpp
Ishika0-0 Oct 7, 2023
fc7f6db
Merge pull request #171 from Ishika0-0/patch-1
MSubhajitIND Oct 7, 2023
9e382dc
Create SmallestLetter.cpp
Romit77 Oct 7, 2023
fc24bef
Merge pull request #172 from Romit77/patch-1
MSubhajitIND Oct 7, 2023
058f390
DSA Sorting CPP
Soumojitshome2023 Oct 8, 2023
81c4042
added dijkstra's Algorithm
03brainy-clicks Oct 8, 2023
c36c758
added dijkstra's Algorithm
03brainy-clicks Oct 8, 2023
4bab368
Merge pull request #175 from 03brainy-clicks/main
MSubhajitIND Oct 8, 2023
bb1d73f
Merge pull request #174 from Soumojitshome2023/main
MSubhajitIND Oct 8, 2023
330a0c1
Create BellmanFordsAlgo.cpp
UtkarshTrivedi2934 Oct 8, 2023
63c641a
Merge pull request #176 from UtkarshTrivedi2934/patch-1
MSubhajitIND Oct 8, 2023
c87f4ed
Create matrix_multiplication.cpp
shivanshusuryakar Oct 8, 2023
32ad14d
Create Threading_prime.cpp
shivanshusuryakar Oct 8, 2023
c5c0e2a
Create Number_guessing_game.cpp
shivanshusuryakar Oct 8, 2023
bfa2c42
Create File_encryption.cpp
shivanshusuryakar Oct 8, 2023
195093f
Linear & Binary Search Add
Soumojitshome2023 Oct 8, 2023
94733a2
Merge pull request #1 from Soumojitshome2023/Soumojitshome2023-patch-1
Soumojitshome2023 Oct 8, 2023
5938c5c
Merge pull request #182 from Soumojitshome2023/main
MSubhajitIND Oct 8, 2023
0901f7b
Merge pull request #181 from jiminnpark/patch-5
MSubhajitIND Oct 8, 2023
6ce6cac
Merge pull request #180 from jiminnpark/patch-4
MSubhajitIND Oct 8, 2023
d307be6
Merge pull request #179 from jiminnpark/patch-2
MSubhajitIND Oct 8, 2023
1915068
Merge pull request #178 from jiminnpark/patch-1
MSubhajitIND Oct 8, 2023
b8329f2
Create maxDotProcuts.cpp
ronbil Oct 8, 2023
2da715e
added removeDuplicate
Oct 8, 2023
4af17bc
added validSudoku.cpp
Oct 8, 2023
9400baf
added combination.cpp
Oct 8, 2023
1aafada
Create insertionsort.cpp
saurabh214p Oct 8, 2023
bb97589
Create Age_Calculator.cpp
SHREYASH96OG Oct 8, 2023
46ed23b
Merge pull request #188 from SHREYASH96OG/main
MSubhajitIND Oct 8, 2023
e7ca147
Merge pull request #187 from saurabh214p/patch-1
MSubhajitIND Oct 8, 2023
b8f1033
Merge pull request #186 from truptiQL/added-combination.cpp
MSubhajitIND Oct 8, 2023
e438223
Merge pull request #185 from truptiQL/added-validSudoku.cpp
MSubhajitIND Oct 8, 2023
e6b6049
Merge pull request #184 from truptiQL/added-removeDuplicate.cpp
MSubhajitIND Oct 8, 2023
df51e63
Merge pull request #183 from ronbil/patch-2
MSubhajitIND Oct 8, 2023
f3643fe
Create Program for Decimal to Binary Conversion
Priyapatel-07 Oct 8, 2023
0d34c9a
complete cpp stl
divyanshu29jha Oct 8, 2023
7042fad
Create 06_Heap_Sort.cpp
r5b6 Oct 8, 2023
e0947c9
added drawDiamondPattern
shailendrakawadkar Oct 8, 2023
dddac98
added counting sort algorithm
DishaSharma-dev Oct 8, 2023
5e8b91e
Create DSU.cpp
r5b6 Oct 8, 2023
2b4344b
Merge pull request #1 from r5b6/r5b6-patch-1
r5b6 Oct 8, 2023
a5133d6
added valid Palandrome
Oct 8, 2023
e0e13c3
Delete DSU.cpp
r5b6 Oct 8, 2023
d36e4f0
Create DSU.cpp
r5b6 Oct 8, 2023
40801f7
Create segmentTree.cpp
r5b6 Oct 8, 2023
ce4bc46
Create modular multiplicative inverse.cpp
r5b6 Oct 8, 2023
0695d78
Create n-queen.cpp
ShivaMani02 Oct 8, 2023
da42c4d
Create Best Time to Buy and Sell Stock with Transaction Fee.cpp
sujanrupu Oct 8, 2023
ba08535
Merge pull request #192 from shailendrakawadkar/main
MSubhajitIND Oct 8, 2023
e1e3a96
Create cyclesort.cpp
ishaanvireet Oct 8, 2023
77a1aec
C++ program for Knight Tour problem
prasad-chaudhari172 Oct 8, 2023
5e8c464
Create Rat_in_a_maze.cpp
prasad-chaudhari172 Oct 8, 2023
b72bcbf
Create Rat-in-a-maze.cpp
prasad-chaudhari172 Oct 8, 2023
755db48
Create 3sum.cpp
MilanGohel Oct 8, 2023
744dff2
Merge pull request #204 from prasad-chaudhari172/main-2
MSubhajitIND Oct 8, 2023
0c86d91
Merge pull request #189 from Priyapatel-07/main
MSubhajitIND Oct 8, 2023
535dd69
Merge pull request #205 from MilanGohel/main
MSubhajitIND Oct 8, 2023
b4f0236
Merge pull request #203 from prasad-chaudhari172/patch-1
MSubhajitIND Oct 8, 2023
e3e3a59
Merge pull request #202 from ishaanvireet/ishaanvireet-patch-1
MSubhajitIND Oct 8, 2023
f985d2f
Merge pull request #199 from sujanrupu/main
MSubhajitIND Oct 8, 2023
baab07f
Merge pull request #198 from ShivaMani02/main
MSubhajitIND Oct 8, 2023
6716af6
Merge pull request #197 from r5b6/modular-multiplicative-inverse
MSubhajitIND Oct 8, 2023
7842cf8
Merge pull request #196 from r5b6/segmentTreeBranch
MSubhajitIND Oct 8, 2023
714244c
Merge pull request #195 from r5b6/dsuBranch
MSubhajitIND Oct 8, 2023
86fa206
Merge pull request #194 from truptiQL/added-validPalandrome
MSubhajitIND Oct 8, 2023
84111bf
Merge pull request #193 from DishaSharma-dev/main
MSubhajitIND Oct 8, 2023
9ada26d
Merge pull request #190 from divyanshu29jha/main
MSubhajitIND Oct 8, 2023
7111d5b
bubbleSort add
Soumojitshome2023 Oct 8, 2023
974ccd3
Merge pull request #2 from Soumojitshome2023/Soumojitshome2023-patch-2
Soumojitshome2023 Oct 8, 2023
73fd7c6
Create bubble_sort.cpp
Soumojitshome2023 Oct 8, 2023
f83fbab
Merge pull request #207 from Soumojitshome2023/patch-1
MSubhajitIND Oct 8, 2023
b1cc777
Create Unique Number of Occurrences
Triamb-Talwar Oct 8, 2023
9d7c24e
Adding count the subset of the given sum problem
MasudAlamMolla99 Oct 8, 2023
adff57f
Merge pull request #209 from MasudAlamMolla99/main
MSubhajitIND Oct 8, 2023
d2fe83c
Merge pull request #208 from Triamb-Talwar/main
MSubhajitIND Oct 8, 2023
ce665ba
Merge branch 'random957654:main' into main
Soumojitshome2023 Oct 9, 2023
bd125d0
Tree Add
Soumojitshome2023 Oct 9, 2023
061329b
Merge pull request #3 from Soumojitshome2023/Soumojitshome2023-patch-3
Soumojitshome2023 Oct 9, 2023
d6d7e9c
Merge pull request #213 from Soumojitshome2023/main
MSubhajitIND Oct 9, 2023
54043a5
added circular queue in S8.cpp
shresritik Oct 9, 2023
3039e62
added q6 Readme.md
shresritik Oct 9, 2023
5a18afc
changed S8 to Q6
shresritik Oct 9, 2023
cc4d1ed
Leap year program in cpp
Prajwalkamde Oct 9, 2023
a80fad8
HCM program in cpp
Prajwalkamde Oct 9, 2023
b76f3c7
Merge pull request #216 from Prajwalkamde/prajwal2
MSubhajitIND Oct 9, 2023
c661d8d
Merge pull request #214 from shresritik/main
MSubhajitIND Oct 9, 2023
71c72d9
added program to remove duplicate from string in cpp
Prajwalkamde Oct 9, 2023
a6a9780
added program from prime number in cpp
Prajwalkamde Oct 9, 2023
53a54a4
Merge pull request #218 from Prajwalkamde/prajwal4
MSubhajitIND Oct 9, 2023
2772613
Add files via upload
sandesh-khatiwada Oct 9, 2023
8dc5030
Add files via upload
sandesh-khatiwada Oct 9, 2023
a8687f8
Merge pull request #219 from sandesh-theMayGuy/main
MSubhajitIND Oct 9, 2023
6f3d46a
added bankprogram.cpp
Muanra217 Oct 9, 2023
038e07d
Create Pairwise swap elements of a linked list.cpp
Sneham102 Oct 9, 2023
bc671a6
Create 0001.cpp
ngarg2k2 Oct 9, 2023
ee2c02b
Create 0078.cpp
ngarg2k2 Oct 9, 2023
d452d12
Create 0103.cpp
ngarg2k2 Oct 9, 2023
e07ce61
Create 0113.cpp
ngarg2k2 Oct 9, 2023
de1cfd1
Create 0112.cpp
ngarg2k2 Oct 9, 2023
30b5438
Merge_sort.cpp
Oct 9, 2023
0887149
Merge pull request #228 from Nipunya1601/patch-1
MSubhajitIND Oct 9, 2023
690ad37
Merge pull request #227 from ngarg2k2/patch-4
MSubhajitIND Oct 9, 2023
bd919f3
Merge pull request #226 from ngarg2k2/patch-3
MSubhajitIND Oct 9, 2023
8781f68
Merge pull request #225 from ngarg2k2/patch-2
MSubhajitIND Oct 9, 2023
89318df
Merge pull request #224 from ngarg2k2/patch-1
MSubhajitIND Oct 9, 2023
cf024f1
Merge pull request #223 from ngarg2k2/main
MSubhajitIND Oct 9, 2023
af7b013
Merge pull request #221 from Sneham102/main
MSubhajitIND Oct 9, 2023
2f2aaf2
Merge pull request #220 from Muanra217/Muanra217-patch-1
MSubhajitIND Oct 9, 2023
36a01e5
Create RSA-encryption-algorithm.cpp
NITHIN3387 Oct 9, 2023
a9e4fb5
Create trie.cpp
Ankushjagga Oct 9, 2023
347aabc
Create reverse_word.cpp
mohdrehanrq0 Oct 9, 2023
18f6068
Merge pull request #233 from mohdrehanrq0/main
MSubhajitIND Oct 9, 2023
d419521
Merge pull request #231 from Ankushjagga/Ankushjagga-patch-1
MSubhajitIND Oct 9, 2023
5714e2e
Merge pull request #230 from NITHIN3387/NITHIN3387-patch-1
MSubhajitIND Oct 9, 2023
6f23c8b
seegah
seegah Oct 9, 2023
aaead2f
Create Guess a number
hassnain0 Oct 9, 2023
e7237a5
Added Modular_Exponentiation.cpp
AbhijeetThakur1 Oct 9, 2023
f2329fb
Merge pull request #236 from seegah/main
MSubhajitIND Oct 9, 2023
7a085b1
Merge pull request #238 from hassnain0/C++
MSubhajitIND Oct 9, 2023
b9bd71e
Merge pull request #239 from AbhijeetThakur1/modular_exponentiation
MSubhajitIND Oct 9, 2023
06dd26a
Some pattern programs
praveer7398 Oct 9, 2023
dc6fd43
Create Travelling_SalesMan_problem.cpp
rishi058 Oct 10, 2023
463cc73
Create Tower_of_Hanoi.cpp
rishi058 Oct 10, 2023
cfb957f
Added a new cpp file Dutch_National_flag_algorithm_Sort.cpp
Wafmulla Oct 10, 2023
245a880
Added new c++ file Dutch_National_flag_algorithm_Sort.cpp
Wafmulla Oct 10, 2023
30a1f8a
Added Odd Even Sorting Algorithm
shanvijha30 Oct 10, 2023
8785455
Create 07 Trees_frominorder_preorder
tishubohra Oct 10, 2023
8f56804
Merge pull request #248 from tishubohra/patch-1
MSubhajitIND Oct 10, 2023
db5a758
Merge pull request #247 from shanvijha30/algo_shanvi
MSubhajitIND Oct 10, 2023
fc6d25d
Merge pull request #246 from Wafmulla/add/cppissue200
MSubhajitIND Oct 10, 2023
5da8fe4
Merge pull request #245 from rishi058/patch-2
MSubhajitIND Oct 10, 2023
0eafd07
Merge pull request #244 from rishi058/patch-1
MSubhajitIND Oct 10, 2023
fcb2026
Merge pull request #242 from praveer7398/main
MSubhajitIND Oct 10, 2023
b789eba
Create duplicate.py
AbhishekSAngadi Oct 10, 2023
769becd
Merge pull request #1 from AbhishekSAngadi/AbhishekSAngadi-patch-1
AbhishekSAngadi Oct 10, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"configurations": [
{
"name": "Win32",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
]
}
],
"version": 4
}
38 changes: 38 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Bash on Windows Launch",
"type": "cppdbg",
"request": "launch",
"program": "enter program name, for example ${workspaceFolder}/a.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${fileDirname}",
"environment": [],
"externalConsole": false,
"pipeTransport": {
"debuggerPath": "/usr/bin/gdb",
"pipeProgram": "${env:windir}\\system32\\bash.exe",
"pipeArgs": ["-c"],
"pipeCwd": ""
},
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "Set Disassembly Flavor to Intel",
"text": "-gdb-set disassembly-flavor intel",
"ignoreFailures": true
}
]
}

]
}
47 changes: 47 additions & 0 deletions 0,1Knapsack Problem.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/* A Naive recursive implementation of
0-1 Knapsack problem */
#include <bits/stdc++.h>
using namespace std;

// A utility function that returns
// maximum of two integers
int max(int a, int b) { return (a > b) ? a : b; }

// Returns the maximum value that
// can be put in a knapsack of capacity W
int knapSack(int W, int wt[], int val[], int n)
{

// Base Case
if (n == 0 || W == 0)
return 0;

// If weight of the nth item is more
// than Knapsack capacity W, then
// this item cannot be included
// in the optimal solution
if (wt[n - 1] > W)
return knapSack(W, wt, val, n - 1);

// Return the maximum of two cases:
// (1) nth item included
// (2) not included
else
return max(
val[n - 1]
+ knapSack(W - wt[n - 1], wt, val, n - 1),
knapSack(W, wt, val, n - 1));
}

// Driver code
int main()
{
int profit[] = { 60, 100, 120 };
int weight[] = { 10, 20, 30 };
int W = 50;
int n = sizeof(profit) / sizeof(profit[0]);
cout << knapSack(W, weight, profit, n);
return 0;
}

// This code is contributed by rathbhupendra
15 changes: 15 additions & 0 deletions 0001.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
class Solution {
public:
vector<int> twoSum(vector<int>& nums, int target) {
unordered_map<int,int>mp;
int tmp;
for(int i=0;i<nums.size();i++){
tmp=target-nums[i];
if(mp.find(tmp)!=mp.end()){
return {mp[tmp],i};
}
mp[nums[i]]=i;
}
return{-1,-1};
}
};
20 changes: 20 additions & 0 deletions 0078.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
class Solution {
public:
void helper(int idx,int n,vector<int>& nums,vector<int>& tmp,vector<vector<int>>& ans){
if(idx==n){
ans.push_back(tmp);
return;
}
tmp.push_back(nums[idx]);
helper(idx+1,n,nums,tmp,ans);
tmp.pop_back();
helper(idx+1,n,nums,tmp,ans);
}
vector<vector<int>> subsets(vector<int>& nums) {
vector<vector<int>>ans;
vector<int>tmp;
int n=nums.size();
helper(0,n,nums,tmp,ans);
return ans;
}
};
46 changes: 46 additions & 0 deletions 0103.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right(right) {}
* };
*/
class Solution {
public:
vector<vector<int>> zigzagLevelOrder(TreeNode* root) {
vector<vector<int>>ans;
int flag=0;
if(root==NULL){
return ans;
}
queue<TreeNode*>q;
q.push(root);
while(!q.empty()){
int count=0;
vector<int>tmp;
int n=q.size();
for(int i=0;i<n;i++){
TreeNode* t=q.front();
q.pop();
tmp.push_back(t->val);
if(t->left){
q.push(t->left);
}
if(t->right){
q.push(t->right);
}
}

if(flag%2!=0){
reverse(tmp.begin(),tmp.end());
}
flag++;
ans.push_back(tmp);
}
return ans;
}
};
40 changes: 40 additions & 0 deletions 0112.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right(right) {}
* };
*/
class Solution {
public:
bool dfs(TreeNode* root,int targetSum){
if(root==NULL){
return false;
}
if(root->val==targetSum&&root->left==NULL&&root->right==NULL){
return true;
}

if(dfs(root->left,targetSum-root->val)){
return true;
}
if(dfs(root->right,targetSum-root->val)){
return true;
}

return false;
}
bool hasPathSum(TreeNode* root, int targetSum) {
// if(root==NULL){
// return false;
// }
// if(root->val==targetSum){
// return true;
// }
return dfs(root,targetSum);
}
};
32 changes: 32 additions & 0 deletions 0113.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right(right) {}
* };
*/
class Solution {
public:
void dfs(TreeNode* root,int targetSum,vector<int>&tmp,vector<vector<int>>&ans){
if(root==NULL){
return;
}
tmp.push_back(root->val);
if(root->val==targetSum&&root->left==NULL&&root->right==NULL){
ans.push_back(tmp);
}
dfs(root->left,targetSum-root->val,tmp,ans);
dfs(root->right,targetSum-root->val,tmp,ans);
tmp.pop_back();
}
vector<vector<int>> pathSum(TreeNode* root, int targetSum) {
vector<vector<int>>ans;
vector<int>tmp;
dfs(root,targetSum,tmp,ans);
return ans;
}
};
45 changes: 45 additions & 0 deletions 01_Bubble_Sort.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#include<iostream>
using namespace std;

/*
Best Time Complexity : O(n)
Average Time Complexity : O(n^2)
Worst Time Complexity : O(n^2)
Worst Space Complexity : O(1)
*/

void printArray(int A[], int n){
for (int i = 0; i < n; i++)
{
cout<<A[i]<<", ";
}
cout<<endl;
}

void bubbleSort(int A[], int n){
int temp;
for (int i = 0; i < n-1; i++)
{
for (int j = 0; j <n-1-i ; j++)
{
if(A[j]>A[j+1]){
temp = A[j];
A[j] = A[j+1];
A[j+1] = temp;
}
}
}
}



int main(){

int A[] = {1, 2, 5, 6, 12, 54, 625, 7, 23, 9, 987};

int n = 11;
printArray(A, n);
bubbleSort(A, n);
printArray(A, n);
return 0;
}
66 changes: 66 additions & 0 deletions 01_Linear_Binary_Search.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#include <stdio.h>

int linearSearch(int arr[], int size, int element)
{
/*
Best Time Complexity : O(1)
Average Time Complexity : O(n)
Worst Time Complexity : O(n)
Worst Space Complexity : O(1)
*/
for (int i = 0; i < size; i++)
{
if (arr[i] == element)
{
return i;
}
}
return -1;
}

int binarySearch(int arr[], int size, int element)
{
/*
Best Time Complexity : O(1)
Average Time Complexity : O(logn)
Worst Time Complexity : O(logn)
Worst Space Complexity : O(1)
*/

int low, mid, high;
low = 0;
high = size - 1;
// Keep searching until low <= high
while (low <= high)
{
mid = (low + high) / 2;
if (arr[mid] == element)
{
return mid;
}
if (arr[mid] < element)
{
low = mid + 1;
}
else
{
high = mid - 1;
}
}
return -1;
}

int main()
{
// Unsorted array for linear search
// int arr[] = {1,3,5,56,4,3,23,5,4,54634,56,34};
// int size = sizeof(arr)/sizeof(int);

// Sorted array for binary search
int arr[] = {1, 3, 5, 56, 64, 73, 123, 225, 444};
int size = sizeof(arr) / sizeof(int);
int element = 444;
int searchIndex = binarySearch(arr, size, element);
printf("The element %d was found at index %d \n", element, searchIndex);
return 0;
}
Loading