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

OZ #18

Open
wants to merge 647 commits into
base: main
Choose a base branch
from
Open

OZ #18

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
647 commits
Select commit Hold shift + click to select a range
945cb03
sum_of_numbers_by_recursion
sourabh1428 Oct 4, 2022
32035db
Hacktoberfest-2022
divyanshgoyal07 Oct 4, 2022
efbb89b
solution
mohitparmar1 Oct 4, 2022
cf21230
Maximum_product_subarray
MKCA06 Oct 4, 2022
07b29de
Create c++3.cpp
Manish102003 Oct 4, 2022
bc92659
Create division.c
tanmay123-lab Oct 4, 2022
41185af
Abstract method
kumarspandan Oct 4, 2022
dd852b7
Add files via upload
arclub Oct 4, 2022
c715435
MergeSort
JayatheerthaSG Oct 4, 2022
e101fe2
Delete MergeSort.java
JayatheerthaSG Oct 4, 2022
fd5a0be
QuickSort
JayatheerthaSG Oct 4, 2022
aacda89
tic-tac-toe.java
Anushkaa-Kashyap Oct 4, 2022
d84d1e2
README.md
Anushkaa-Kashyap Oct 4, 2022
313a0c1
Greatest Number
Mahidhar05 Oct 4, 2022
1d16db4
BinarySearch
riddhidhawan Oct 4, 2022
79e89ed
GCD of two numbers
Mahidhar05 Oct 4, 2022
a2f35de
Area of triangle
Mahidhar05 Oct 4, 2022
84554f3
Vowel or Consonant
Mahidhar05 Oct 4, 2022
7a469f2
Bubblesort
janender0707 Oct 4, 2022
142129c
Create hacktoberfest-2022
Abhika3021 Oct 4, 2022
2faeffa
Add files via upload
SantaTheNoob Oct 4, 2022
5ba19e7
linked list
VISHNUGOVIND007 Oct 4, 2022
74f0c40
Leap Year
SantaTheNoob Oct 4, 2022
9ac66db
palindrome
SantaTheNoob Oct 4, 2022
bf9d279
Merge pull request #1 from SantaTheNoob/SantaTheNoob-patch-1
SantaTheNoob Oct 4, 2022
422e745
armstrong.java
anushhada46 Oct 5, 2022
0f3ae8f
transpose.java
anushhada46 Oct 5, 2022
0eece12
printarray.java
anushhada46 Oct 5, 2022
54cebc4
currentdirectory.java
anushhada46 Oct 5, 2022
a2811a3
Linear search
Mohitjpr Oct 5, 2022
9a2c009
selectionsort
Mohitjpr Oct 5, 2022
782fec8
create program to add two numbers
1305Tanmay Oct 5, 2022
b795eb3
Java Iterator
SyarifulMsth Oct 5, 2022
9469ca2
added file
SALONI-SHARMA-6 Oct 5, 2022
6ffdbb7
Java Operators
SyarifulMsth Oct 5, 2022
70b3b7e
Java algorithm sort
ig77ayush Oct 5, 2022
3e68ca9
chore: add rabin karp algo
yash-seth Oct 5, 2022
e043e36
Hactoberfest2022
Aniket-Shivhare Oct 5, 2022
240e2a9
Create palindromenumber.java
samartheory Oct 5, 2022
9c7b408
Add files via upload
rajathnh Oct 5, 2022
78bafe1
hacktoberfest-2022
bharath-acchu Oct 5, 2022
3bbee55
hacktoberfest-2022
bharath-acchu Oct 5, 2022
a2b0a3b
Add files via upload
chanchal200519 Oct 5, 2022
7022b44
Add files via upload
aathil1231 Oct 5, 2022
de9c9ca
Min Heap
haris-bit Oct 5, 2022
ec71d0e
code C
I-Am-Jigyanshu Oct 5, 2022
2cbba19
Game
Abhinab21 Oct 5, 2022
67b162a
shortest_common_supersequence
Snehagupta24 Oct 5, 2022
198c783
Create c++3.cpp
alokya998 Oct 5, 2022
2769a65
ComplexNumbers
02BHAVANI Oct 5, 2022
1ad5354
crossproduct
02BHAVANI Oct 5, 2022
14570b6
hacktoberfest-2022
bhagirath77 Oct 5, 2022
ae33779
brainfuck algorithm
Ayushbajpai19 Oct 5, 2022
b15d606
Create Bubblesort.cpp
Oct 5, 2022
4b1d778
Merge pull request #253 from anushhada46/patch-1
ajitkumar1264 Oct 5, 2022
2aae25a
Merge pull request #252 from anushhada46/main
ajitkumar1264 Oct 5, 2022
f2299cb
Merge pull request #251 from VISHNUGOVIND007/main
ajitkumar1264 Oct 5, 2022
1f6dc97
Merge pull request #250 from SantaTheNoob/main
ajitkumar1264 Oct 5, 2022
ddcbc2b
Merge pull request #249 from Abhika3021/Abhika3021-patch-1
ajitkumar1264 Oct 5, 2022
8e6544d
Merge pull request #248 from janender0707/main
ajitkumar1264 Oct 5, 2022
10adcb9
Merge pull request #247 from Mahidhar05/patch-4
ajitkumar1264 Oct 5, 2022
ca083eb
Merge pull request #246 from Mahidhar05/patch-3
ajitkumar1264 Oct 5, 2022
a7ad981
Merge pull request #245 from Mahidhar05/patch-2
ajitkumar1264 Oct 5, 2022
797d7dd
Merge pull request #244 from riddhidhawan/main
ajitkumar1264 Oct 5, 2022
d94fd7f
Merge pull request #243 from Mahidhar05/patch-1
ajitkumar1264 Oct 5, 2022
68c5b65
Merge pull request #242 from Anushkaa-Kashyap/tic-tac-toe
ajitkumar1264 Oct 5, 2022
31f5400
Merge pull request #241 from JayatheerthaSG/main
ajitkumar1264 Oct 5, 2022
3e07101
Merge pull request #239 from arclub/main
ajitkumar1264 Oct 5, 2022
85552ab
Merge pull request #238 from kumarspandan/main
ajitkumar1264 Oct 5, 2022
d9c0a4e
Merge pull request #236 from tanmay123-lab/main
ajitkumar1264 Oct 5, 2022
272bf67
Merge pull request #235 from Manish102003/main
ajitkumar1264 Oct 5, 2022
a3a90f1
Merge pull request #234 from MKCA06/main
ajitkumar1264 Oct 5, 2022
47019a9
Merge pull request #233 from mohitparmar1/main
ajitkumar1264 Oct 5, 2022
e31786d
Merge pull request #231 from divyanshgoyal07/main
ajitkumar1264 Oct 5, 2022
1b37f9c
Merge pull request #230 from sourabh1428/main
ajitkumar1264 Oct 5, 2022
89a7e83
Merge pull request #229 from JayGhadiya/patch-1
ajitkumar1264 Oct 5, 2022
f0b7750
Merge pull request #228 from riyaggarwal92/main
ajitkumar1264 Oct 5, 2022
221384e
Merge pull request #227 from rudra016/main
ajitkumar1264 Oct 5, 2022
ecfcb25
Merge pull request #226 from adithziva/main
ajitkumar1264 Oct 5, 2022
96a054c
Merge pull request #225 from SimplyHumanic/patch-1
ajitkumar1264 Oct 5, 2022
244a14b
Merge pull request #224 from aakashnagpal4567/main
ajitkumar1264 Oct 5, 2022
fd852ed
Merge pull request #223 from parmishh/main
ajitkumar1264 Oct 5, 2022
2cf2dd9
Merge pull request #222 from benedictprajwal/main
ajitkumar1264 Oct 5, 2022
74be0f3
Merge pull request #258 from SyarifulMsth/main
ajitkumar1264 Oct 5, 2022
7948878
Merge pull request #219 from hilmyrasyiq/hacktoberfest-2022
ajitkumar1264 Oct 5, 2022
0123161
Merge pull request #218 from AyushBhavsar/patch-1
ajitkumar1264 Oct 5, 2022
d4c5aec
Merge pull request #221 from Hariskhan2/main
ajitkumar1264 Oct 5, 2022
09ebd57
Merge pull request #254 from anushhada46/patch-2
ajitkumar1264 Oct 5, 2022
15e1caa
Merge pull request #255 from anushhada46/patch-3
ajitkumar1264 Oct 5, 2022
c7bf87b
Merge pull request #256 from Mohitjpr/main
ajitkumar1264 Oct 5, 2022
7630ecb
Merge pull request #257 from 1305Tanmay/main
ajitkumar1264 Oct 5, 2022
5318650
Merge pull request #259 from SALONI-SHARMA-6/geeks-and-strings
ajitkumar1264 Oct 5, 2022
e566923
Merge pull request #260 from ig77ayush/main
ajitkumar1264 Oct 5, 2022
29386bd
Merge pull request #261 from yash-seth/main
ajitkumar1264 Oct 5, 2022
d49b5d5
Merge pull request #262 from Aniket-Shivhare/main
ajitkumar1264 Oct 5, 2022
3f6b52e
Merge pull request #263 from samartheory/main
ajitkumar1264 Oct 5, 2022
f940eec
Counting_Number_of_leaf_nodes
Veeno-Rai Oct 5, 2022
c8e05a1
FizzBuzz
SantaTheNoob Oct 5, 2022
67d4b9a
Duck Number
SantaTheNoob Oct 5, 2022
17165b7
Diamond
SantaTheNoob Oct 5, 2022
70be9a2
Merge pull request #264 from SilverDragon12/main
ajitkumar1264 Oct 6, 2022
2f7df38
Merge pull request #265 from bharath-acchu/hacktoberfest2022
ajitkumar1264 Oct 6, 2022
b198695
Merge pull request #266 from chanchal200519/main
ajitkumar1264 Oct 6, 2022
5bb3c84
Merge pull request #267 from aathil1231/main
ajitkumar1264 Oct 6, 2022
e11f710
Merge pull request #268 from haris-bit/main
ajitkumar1264 Oct 6, 2022
927adca
Merge pull request #269 from I-Am-Jigyanshu/main
ajitkumar1264 Oct 6, 2022
255c2b3
Merge pull request #270 from Abhinab21/main
ajitkumar1264 Oct 6, 2022
bcad855
Merge pull request #271 from Snehagupta24/main
ajitkumar1264 Oct 6, 2022
46f46cc
Merge pull request #272 from alokya998/main
ajitkumar1264 Oct 6, 2022
4601dad
Merge pull request #273 from 02BHAVANI/main
ajitkumar1264 Oct 6, 2022
aad0721
Merge pull request #274 from bhagirath77/main
ajitkumar1264 Oct 6, 2022
14d0300
Merge pull request #275 from Ayushbajpai19/main
ajitkumar1264 Oct 6, 2022
0d8f270
Merge pull request #276 from Sakshiii1800/main
ajitkumar1264 Oct 6, 2022
7ccab3c
Merge pull request #278 from Veeno-Rai/main
ajitkumar1264 Oct 6, 2022
34e71ba
Merge pull request #279 from SantaTheNoob/main
ajitkumar1264 Oct 6, 2022
f58ed65
Merge pull request #280 from SantaTheNoob/SantaTheNoob-patch-1
ajitkumar1264 Oct 6, 2022
d2f8c89
Merge pull request #281 from SantaTheNoob/SantaTheNoob-patch-2
ajitkumar1264 Oct 6, 2022
d20c872
Update README.md
ankytastic Oct 6, 2022
7f7ab71
soortarray.java
rubiraj570 Oct 6, 2022
1a8a25c
permutation.java
rubiraj570 Oct 6, 2022
30ab1a6
findduplicate.java
rubiraj570 Oct 6, 2022
4ef08ec
reversestringusingloop.java
rubiraj570 Oct 6, 2022
3e89955
reversestringusingloop.java
rubiraj570 Oct 6, 2022
a739107
Create javaAlgo.java
dcryptau Oct 6, 2022
c331ddc
comparetwoobjects.java
santoshlal Oct 6, 2022
c2c210e
printASCIIvalue.java
santoshlal Oct 6, 2022
12742bd
righttrianglepatter.java
santoshlal Oct 6, 2022
4ea2492
ATM.java
santoshlal Oct 6, 2022
0b049cf
Bellman Ford
Wrrikk Oct 6, 2022
03fbe81
Merge pull request #282 from ankytastic/main
ajitkumar1264 Oct 6, 2022
c5b0038
buzznumber.java
abaddonahpuch Oct 6, 2022
377e1b6
Merge pull request #283 from rubiraj570/main
ajitkumar1264 Oct 6, 2022
26753ea
ducknumber.java
abaddonahpuch Oct 6, 2022
70df9fc
evilnumber..java
abaddonahpuch Oct 6, 2022
fd6f2aa
Merge pull request #284 from rubiraj570/patch-1
ajitkumar1264 Oct 6, 2022
bc1caa2
Merge pull request #285 from rubiraj570/patch-2
ajitkumar1264 Oct 6, 2022
5b9195f
bouncynumber.java
abaddonahpuch Oct 6, 2022
6bc6bcd
Merge pull request #286 from rubiraj570/patch-3
ajitkumar1264 Oct 6, 2022
0a20f6e
Merge pull request #287 from rubiraj570/patch-4
ajitkumar1264 Oct 6, 2022
1080ad3
Merge pull request #288 from dcryptau/main
ajitkumar1264 Oct 6, 2022
8af1e20
Merge pull request #289 from santoshlal/main
ajitkumar1264 Oct 6, 2022
dc86def
Merge pull request #290 from santoshlal/patch-1
ajitkumar1264 Oct 6, 2022
4bfcc23
Merge pull request #291 from santoshlal/patch-2
ajitkumar1264 Oct 6, 2022
a8514df
Merge pull request #292 from santoshlal/patch-3
ajitkumar1264 Oct 6, 2022
4892016
Merge pull request #293 from Wrrikk/main
ajitkumar1264 Oct 6, 2022
6cb10bc
Merge pull request #294 from abaddonahpuch/main
ajitkumar1264 Oct 6, 2022
e4b5457
Create JavaAlgo4
CoolCoder3955 Oct 6, 2022
d2f4f01
Adding quick sort program
Ravindra3837 Oct 6, 2022
866aa06
Create JavaAlgo.java
CoolCoder3955 Oct 6, 2022
a886939
Create PalindromeNumber.java
vmeet95 Oct 6, 2022
7a5f044
Queue.java
AyushBhavsar Oct 6, 2022
21a0b4e
Create c++400.cpp
Abhiw42 Oct 6, 2022
da3664e
Hackfest22
sbhavya26 Oct 6, 2022
3a656ff
Keshavg
Keshavgoyal09 Oct 6, 2022
524e53f
Create Harshpreet Singh3
Harshpreet5911 Oct 6, 2022
8268b58
hacktoberfest-2022
codeburn12 Oct 6, 2022
d8ecc48
Armstrong.java
Harsh8084 Oct 6, 2022
04a3f33
Create Calculator.java
MeetVaishnav23 Oct 6, 2022
0361910
Hactoberfest2022
Aniket-Shivhare Oct 6, 2022
33d4c2d
Search Binary Tree
Krunal-Sakhiya Oct 6, 2022
1a5f73f
rev_arr_recursion
sourabh1428 Oct 6, 2022
1bed8c1
binary search
harshvijay63 Oct 6, 2022
ef57ce1
Create C Calculator
modaksun Oct 6, 2022
8b35f2f
ApplicationException
bipin3002 Oct 6, 2022
810139a
Fibonacci
atin-das Oct 6, 2022
7dfed92
bytearraytohex.java
devildaikells Oct 6, 2022
e247b84
sortmapbyvalue.java
devildaikells Oct 6, 2022
feeb006
checkstringisnumeric.java
devildaikells Oct 6, 2022
cb75d4e
fileextension.java
devildaikells Oct 6, 2022
efd85b9
Create linked.cpp
Himanshu3691 Oct 6, 2022
00330ed
Create linkes_45.cpp
Himanshu3691 Oct 6, 2022
ce83e6d
Create stacqueuek.cpp
PriyanshiJain20012949 Oct 6, 2022
55a53a9
Add files via upload
mohitparmar1 Oct 6, 2022
3c71204
Hacktoberfest 20022
Kaliro26 Oct 6, 2022
bb0f99f
Hacktoberfest 20022
Kaliro26 Oct 6, 2022
a7aca4b
Hacktoberfest2022
bhuwan-2003 Oct 6, 2022
feb2ee7
Create cplus.cpp
Jayanth-BS Oct 6, 2022
30aa403
Add files via upload
swarnavopramanik Oct 6, 2022
98bea6b
Add files via upload
swarnavopramanik Oct 6, 2022
96c3f42
newbubblesort.java
Avicii-py Oct 6, 2022
68e783e
Create encapsulate1410.cpp
khushi-1410 Oct 6, 2022
cf08283
Add files via upload
Agam118 Oct 6, 2022
c61fea2
Create mergesort.java
Nivedithapm06 Oct 6, 2022
d8a61ce
first
stonedseeker Oct 6, 2022
f30f0b6
hacktoberfest2022
Aniket-Jadoun-au28 Oct 6, 2022
9255915
Hactoberfest2022
Kpriya1202 Oct 6, 2022
dcf23ac
Add files via upload
AkankshaSengar13 Oct 6, 2022
c62a911
Create C++45.cpp
Niketangoyal Oct 6, 2022
8281933
Queue
Banerjee2021 Oct 6, 2022
354c506
Create C++34.cpp
Niketangoyal Oct 6, 2022
a623be0
Create c++3,cpp
lallunallala87 Oct 6, 2022
d8ae3a3
Merge pull request #316 from AtinDas/main
ajitkumar1264 Oct 6, 2022
b8b4ef8
Merge pull request #315 from bipin3002/main
ajitkumar1264 Oct 6, 2022
28c1436
Merge pull request #317 from devildaikells/main
ajitkumar1264 Oct 6, 2022
226b784
Merge pull request #313 from harshvijay63/main
ajitkumar1264 Oct 6, 2022
d625ea8
Merge pull request #312 from Krunal-Sakhiya/main
ajitkumar1264 Oct 6, 2022
5c8b73d
Merge pull request #314 from modaksun/patch-1
ajitkumar1264 Oct 6, 2022
3a52cef
Merge pull request #310 from Aniket-Shivhare/main
ajitkumar1264 Oct 6, 2022
b553600
pascal triangle
Kartikay099 Oct 6, 2022
8b92ce2
Merge pull request #309 from MeetVaishnav23/patch-4
ajitkumar1264 Oct 6, 2022
9d629b0
Bubblesort
Prathamt27 Oct 6, 2022
7784f14
Merge pull request #308 from Harsh8084/main
ajitkumar1264 Oct 6, 2022
2bcbb7e
Merge pull request #307 from codeburn12/main
ajitkumar1264 Oct 6, 2022
e347388
Merge pull request #306 from Harshpreet5911/patch-1
ajitkumar1264 Oct 6, 2022
783966f
Merge pull request #305 from Keshavgoyal09/main
ajitkumar1264 Oct 6, 2022
db41569
Merge pull request #304 from sbhavya26/patch-1
ajitkumar1264 Oct 6, 2022
4931eb5
Create c++001.cpp
Hirdhyakk Oct 6, 2022
e0f5510
Merge pull request #303 from Abhiw42/main
ajitkumar1264 Oct 6, 2022
93d1f42
Merge pull request #302 from AyushBhavsar/patch-2
ajitkumar1264 Oct 6, 2022
8247eb2
Merge pull request #311 from sourabh1428/main
ajitkumar1264 Oct 6, 2022
74526de
Merge pull request #318 from devildaikells/patch-1
ajitkumar1264 Oct 6, 2022
9596661
Merge pull request #301 from vmeet95/patch-4
ajitkumar1264 Oct 6, 2022
0d6eaca
Merge pull request #319 from devildaikells/patch-2
ajitkumar1264 Oct 6, 2022
29ac9d3
Merge pull request #300 from CoolCoder3955/patch-2
ajitkumar1264 Oct 6, 2022
b9c26b7
Merge pull request #299 from Ravindra3837/patch-1
ajitkumar1264 Oct 6, 2022
4c746b5
Merge pull request #298 from CoolCoder3955/patch-1
ajitkumar1264 Oct 6, 2022
61ff77e
Merge pull request #297 from abaddonahpuch/patch-3
ajitkumar1264 Oct 6, 2022
2a53625
Merge pull request #296 from abaddonahpuch/patch-2
ajitkumar1264 Oct 6, 2022
af7edb6
Merge pull request #295 from abaddonahpuch/patch-1
ajitkumar1264 Oct 6, 2022
8fe4dbb
Merge pull request #320 from devildaikells/patch-3
ajitkumar1264 Oct 6, 2022
9b66e24
Merge pull request #322 from Himanshu3691/patch-1
ajitkumar1264 Oct 6, 2022
1150db9
Merge pull request #323 from Himanshu3691/main
ajitkumar1264 Oct 6, 2022
dd883eb
Merge pull request #324 from mohitparmar1/main
ajitkumar1264 Oct 6, 2022
6b018b6
Merge pull request #325 from PriyanshiJain20012949/main
ajitkumar1264 Oct 6, 2022
489a1ea
Hoax Number
arpit-22 Oct 6, 2022
fc7f4e9
disjoint set
rishabhverma1106 Oct 6, 2022
c2a2b3f
Create Insertion Sort
AvishkarParab Oct 6, 2022
3fbff16
Merge pull request #326 from bhuwan-2003/main
ajitkumar1264 Oct 6, 2022
7436449
Merge pull request #327 from Kaliro26/main
ajitkumar1264 Oct 6, 2022
5a13539
Merge pull request #328 from swarnavopramanik/main
ajitkumar1264 Oct 6, 2022
a1dca21
Merge pull request #329 from avicii029/main
ajitkumar1264 Oct 6, 2022
86f0bb8
Merge pull request #330 from khushi-1410/main
ajitkumar1264 Oct 6, 2022
b4674f9
Merge pull request #331 from Agam118/main
ajitkumar1264 Oct 6, 2022
80effce
Merge pull request #332 from Nivedithapm06/main
ajitkumar1264 Oct 6, 2022
981b9ea
Merge pull request #333 from Jayanth-BS/main
ajitkumar1264 Oct 6, 2022
58563b8
Merge pull request #334 from Aniket-Jadoun-au28/main
ajitkumar1264 Oct 6, 2022
e4c46f4
Merge pull request #335 from stonedseeker/first-contribution
ajitkumar1264 Oct 6, 2022
9631837
Merge pull request #336 from krishnapriya202/main
ajitkumar1264 Oct 6, 2022
bf49080
Merge pull request #337 from AkankshaSengar13/main
ajitkumar1264 Oct 6, 2022
c5f390e
Merge pull request #338 from Niketangoyal/patch-1
ajitkumar1264 Oct 6, 2022
88c6fe0
Merge pull request #339 from Banerjee2021/main
ajitkumar1264 Oct 6, 2022
abbe382
Merge pull request #340 from Niketangoyal/patch-2
ajitkumar1264 Oct 6, 2022
38f0d00
Merge pull request #341 from lallunallala87/main
ajitkumar1264 Oct 6, 2022
48f3e40
Merge pull request #342 from Kartikay099/main
ajitkumar1264 Oct 6, 2022
46f516f
Merge pull request #343 from Prathamt27/main
ajitkumar1264 Oct 6, 2022
89b5daa
Merge pull request #344 from Hirdhyakk/patch-1
ajitkumar1264 Oct 6, 2022
e8f840f
Merge pull request #345 from arpit-22/main
ajitkumar1264 Oct 6, 2022
6d80c2e
Merge pull request #346 from rishabhverma1106/main
ajitkumar1264 Oct 6, 2022
3854e20
Merge pull request #347 from AvishkarParab/main
ajitkumar1264 Oct 6, 2022
bcf0e7c
Create javabook.java
KUNJPro Oct 7, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Binary file added 1.1.exe
Binary file not shown.
69 changes: 69 additions & 0 deletions 1.PreOrder - Using Stack.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/**
* 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 preorder(TreeNode* root,vector<int> &ans)
{
if(root==NULL)
{
return;
}
else
{
ans.push_back(root->val);
preorder(root->left,ans);
preorder(root->right,ans);
}
}
public:
vector<int> preorderTraversal(TreeNode* root) {
vector<int> ans;
preorder(root,ans);
return ans;
}
};




Using stack

class Solution {
public:
vector<int> preorderTraversal(TreeNode* root) {
vector<int> ans;
if(root==NULL)
{
return ans;
}
else
{
stack<TreeNode*> st;
st.push(root);
while(!st.empty())
{
TreeNode* node = st.top();
st.pop();
if(node->right!=NULL)
{
st.push(node->right);
}
if(node->left!=NULL)
{
st.push(node->left);
}
ans.push_back(node->val);
}
return ans;
}
}
};
Binary file added 16649524524186456099865449383486.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
87 changes: 87 additions & 0 deletions 2.PostOrder - Using Stack.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
/**
* 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 postorder(TreeNode* root,vector<int> &ans)
{
if(root==NULL)
{
return;
}
else
{
postorder(root->left,ans);
postorder(root->right,ans);
ans.push_back(root->val);
}
}
public:
vector<int> postorderTraversal(TreeNode* root) {
vector<int> ans;
postorder(root,ans);
return ans;
}
};




class Solution {
public:
vector<int> postorderTraversal(TreeNode* root) {
vector<int> ans;
if(root==NULL)
{
return ans;
}
else if(root->left==NULL&root->right==NULL)
{
ans.push_back(root->val);
return ans;
}
else
{
stack<TreeNode*> st;
TreeNode* curr = root;
TreeNode* temp;
while(curr!=NULL||!st.empty())
{
if(curr!=NULL)
{
st.push(curr);
curr=curr->left;
}
else
{
temp = st.top()->right;
if(temp==NULL)
{
temp = st.top();
st.pop();
ans.push_back(temp->val);
while(!st.empty()&&temp==st.top()->right)
{
temp = st.top();
st.pop();
ans.push_back(temp->val);
}
}
else
{
curr = temp;
}
}
}
return ans;
}
}
};
82 changes: 82 additions & 0 deletions 3.InOrder Using Stack.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@

/**
* 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 inorder(TreeNode* root,vector<int> &ans)
{
if(root==NULL)
{
return;
}
else
{
inorder(root->left,ans);
ans.push_back(root->val);
inorder(root->right,ans);
}
}
public:
vector<int> inorderTraversal(TreeNode* root) {
vector<int> ans;
inorder(root,ans);
return ans;
}
};





class Solution {
public:
vector<int> inorderTraversal(TreeNode* root) {
vector<int> ans;
if(!root)
{
return ans;
}
else if(root->left==NULL&&root->right==NULL)
{
ans.push_back(root->val);
return ans;
}
else
{
stack<TreeNode*> st;
TreeNode* node = root;
while(true)
{
if(node!=NULL)
{
st.push(node);
node=node->left;
}
else
{
if(st.empty())
{
break;
}
else
{
node=st.top();
ans.push_back(node->val);
st.pop();
node = node->right;
}
}
}
return ans;
}
}
};
36 changes: 36 additions & 0 deletions 31aug6.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// Code to understand the working of the copy constructor.
#include <iostream>
using namespace std;
class person
{
private:
string name;
int age;

public:
person(string person_name, int person_age)
{
cout << "Constructor for both name and age is called" << endl;
name = person_name;
age = person_age;
}
person(const person &obj)
{
cout << "Copy constructor is called" << endl;
name = obj.name;
age = obj.age;
}
void display()
{
cout << "Name of current object : " << name << endl;
cout << "Age of current object : " << age << endl;
cout << endl;
}
};
int main()
{
person obj1("First person", 25);
obj1.display();
person obj2(obj1);
obj2.display();
};
Loading