Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
5c0cb3f
Add Kevin in Contributing.md
Oct 4, 2022
0aeb710
Merge pull request #6 from Anuragcoderealy/main
Anurag2622002 Oct 4, 2022
15fa495
Merge pull request #5 from TheCodeyWizard/patch-1
Anurag2622002 Oct 4, 2022
0e038b7
Create c
utksin13 Oct 4, 2022
2e7bca5
Merge pull request #7 from utksin13/patch-1
Anurag2622002 Oct 4, 2022
93e010d
BellmanFord
Oct 4, 2022
04565af
Create create cc
utksin13 Oct 4, 2022
4e102de
FloydWarshall Algo
Shivamvats2102 Oct 4, 2022
41b4d25
Merge pull request #10 from ayushi-2501/main
Anurag2622002 Oct 4, 2022
e8bb467
Merge pull request #9 from Shivamvats2102/main
Anurag2622002 Oct 4, 2022
9cc316a
Merge pull request #8 from utksin13/patch-2
Anurag2622002 Oct 4, 2022
3b1cc9e
Creating fIle of heap sort program
amriteshgupta Oct 4, 2022
379d327
MergeSort & MergeSortInPlace in JAVA
rudra016 Oct 4, 2022
daa679c
Merge pull request #12 from rudra016/main
Anurag2622002 Oct 4, 2022
4c5bc52
Merge pull request #11 from amriteshgupta/patch-1
Anurag2622002 Oct 4, 2022
7ba3a5f
Updated QuickSort by adding Recusion.
rudra016 Oct 4, 2022
1215b87
Topological Sort CPP
sahanmndl Oct 4, 2022
96528d7
Create Diamond Pattern in Python
Oct 4, 2022
0df27de
Merge pull request #15 from TheCodeyWizard/patch-2
Anurag2622002 Oct 4, 2022
2104938
Merge pull request #14 from sahanmndl/sahanmndl
Anurag2622002 Oct 4, 2022
2d2be21
Merge pull request #13 from rudra016/patch-1
Anurag2622002 Oct 4, 2022
95fb189
Display Affirmation
aarushisksk Oct 4, 2022
2e9aee6
Merge pull request #16 from aarushiksk/main
Anurag2622002 Oct 4, 2022
7da735e
Tower of Hanoi using c
RangerRishabh Oct 4, 2022
822a229
Merge pull request #17 from RangerRishabh/main
Anurag2622002 Oct 4, 2022
ce00ad5
Add files via upload
yashgoel2211 Oct 4, 2022
dbc5ea2
added insertionSort
bhavy007 Oct 4, 2022
37a40d4
Merge pull request #18 from yashgoel2211/main
Anurag2622002 Oct 4, 2022
eb9eb84
Longest increasing subsequence
chir263 Oct 4, 2022
3cb1ff6
Merge pull request #19 from bhavy007/main
Anurag2622002 Oct 4, 2022
8df3bed
Merge pull request #20 from chir263/branch_cpp_lis
Anurag2622002 Oct 4, 2022
1549514
added heapSort
bhavy007 Oct 4, 2022
33ec8fa
Merge pull request #21 from bhavy007/main
Anurag2622002 Oct 4, 2022
bb7b12d
Alternate element swap of an array
Vishal35679 Oct 4, 2022
2b77079
Simple atm program using switch
Vishal35679 Oct 4, 2022
c6e1d42
nCr problem
Vishal35679 Oct 4, 2022
eeeff2e
Decimal to Binary conversion code
Vishal35679 Oct 4, 2022
b800abc
Binary to Decimal Conversion code
Vishal35679 Oct 4, 2022
f7a0361
Merge pull request #22 from Vishal35679/main
Anurag2622002 Oct 4, 2022
4ecdc21
added selection sort
kiranmayek Oct 4, 2022
79de48b
Merge pull request #23 from kiranmayek/ak
Anurag2622002 Oct 4, 2022
78ed070
Add files via upload
Kamana54855 Oct 4, 2022
e5143fc
Merge pull request #24 from Kamana54855/main
Anurag2622002 Oct 4, 2022
ba68ec6
added binary search and counting frequency of each element in array u…
kiranmayek Oct 4, 2022
e09ff14
Merge pull request #25 from kiranmayek/ak
Anurag2622002 Oct 4, 2022
d08c184
added bfs and dfs in C
Oct 4, 2022
7847e37
Merge pull request #26 from palaksv/BFS_DFS
Anurag2622002 Oct 4, 2022
307a46a
My Commit
23SumiTM Oct 4, 2022
3a11c41
Merge pull request #27 from 23SumiTM/main
Anurag2622002 Oct 4, 2022
2070152
Created longest_palindromic_subsequence.cpp
bilwa496 Oct 4, 2022
958cc2a
Create Hollow_Rectangle_Pattern.cpp
darklordhere Oct 4, 2022
e9db3ae
Create Fibonnaci.py
Ayush1347 Oct 4, 2022
75a2576
Merge pull request #30 from Ayush1347/main
Anurag2622002 Oct 4, 2022
646c023
Merge pull request #29 from darklordhere/patch-1
Anurag2622002 Oct 4, 2022
03a8083
Merge pull request #28 from bilwa496/patch-1
Anurag2622002 Oct 4, 2022
226e746
Create Tower of Hanoi.py
Ayush1347 Oct 4, 2022
6837017
Reverse the K group in Linked List
borkarSahil Oct 4, 2022
58c9902
Merge pull request #32 from borkarSahil/main
Anurag2622002 Oct 4, 2022
213c7c9
Merge pull request #31 from Ayush1347/patch-1
Anurag2622002 Oct 4, 2022
63158d8
Create BubbleSort_OptimisedCode.cpp
thakurRashmi Oct 4, 2022
1341d42
Merge pull request #33 from thakurRashmi/patch-1
Anurag2622002 Oct 4, 2022
c6c703d
Added Shell Sort Code
RinzlerN26 Oct 4, 2022
3c30f94
Merge pull request #34 from RinzlerN26/main
Anurag2622002 Oct 4, 2022
aa06385
Create generateparantheses.cpp
ankitb2023 Oct 4, 2022
46bef01
Merge pull request #35 from ankitb2023/patch-1
Anurag2622002 Oct 4, 2022
b8b384d
Binary search algorithim in C
shubhamessier Oct 4, 2022
2c6b7fd
Merge pull request #36 from 404shubham/patch-1
Anurag2622002 Oct 4, 2022
3f3cc6e
Insertion sort algorithims
shubhamessier Oct 4, 2022
92d6613
Merge pull request #37 from 404shubham/patch-2
Anurag2622002 Oct 4, 2022
40627b9
Tower of Hanoi Problem using Recursion in C++
imshivam18 Oct 4, 2022
5431089
Create Cocktail Sort.cpp
shrutij1247 Oct 4, 2022
3faeab7
Backtracking Problem Rat in Maze using C++
imshivam18 Oct 4, 2022
0cffbda
Merge pull request #40 from imshivam18/patch-2
Anurag2622002 Oct 4, 2022
22ab0c9
Merge pull request #39 from shrutij1247/patch-1
Anurag2622002 Oct 4, 2022
7f7bc93
Merge pull request #38 from imshivam18/patch-1
Anurag2622002 Oct 4, 2022
f25b97b
Create lengthOfLongestSubstring.java
skshubham09 Oct 4, 2022
5ed5f41
Merge pull request #41 from skshubham09/java
Anurag2622002 Oct 4, 2022
6703979
Create Median_of_TwoSortedArrays_OptimisedCode.cpp
thakurRashmi Oct 4, 2022
615a8b3
Merge pull request #42 from thakurRashmi/patch-2
Anurag2622002 Oct 4, 2022
83aed4b
Create SumOfElements_between_k1Smallest_and_k2SmallestElements.cpp
thakurRashmi Oct 4, 2022
3d243f5
Merge pull request #43 from thakurRashmi/patch-3
Anurag2622002 Oct 4, 2022
14583f6
Create PeakElement_of_an_Array.cpp
thakurRashmi Oct 4, 2022
cc2e650
Merge pull request #44 from thakurRashmi/patch-4
Anurag2622002 Oct 4, 2022
ae25e9d
print rax in assembly language
GuilhermeBn198 Oct 4, 2022
97c1c43
Create Top_k_Frequent_Numbers_InAnArray.cpp
thakurRashmi Oct 4, 2022
20406bb
added balancedParenthesis
akshaykhatter Oct 4, 2022
f1ecbaf
Merge pull request #47 from akshaykhatter/main
Anurag2622002 Oct 5, 2022
81f6bcc
Merge pull request #46 from thakurRashmi/patch-5
Anurag2622002 Oct 5, 2022
9d54d44
Merge pull request #45 from GuilhermeBn198/main
Anurag2622002 Oct 5, 2022
0ade402
added program to sort an input array in wave form
abhijais27 Oct 5, 2022
d14bc7d
Merge pull request #48 from abhijais27/main
Anurag2622002 Oct 5, 2022
e4570cf
heapSort in python
gauravag091 Oct 12, 2022
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
77 changes: 77 additions & 0 deletions AffirmationsInPython.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 4 15:32:00 2022

@author: aarus
"""

# Import turtle package
import turtle

# Creating a turtle object(pen)
pen = turtle.Turtle()

# Defining a method to draw curve
def curve():
for i in range(200):

# Defining step by step curve motion
pen.right(1)
pen.forward(1)

# Defining method to draw a full heart
def heart():

# Set the fill color to red
pen.fillcolor('red')

# Start filling the color
pen.begin_fill()

# Draw the left line
pen.left(140)
pen.forward(113)

# Draw the left curve
curve()
pen.left(120)

# Draw the right curve
curve()

# Draw the right line
pen.forward(112)

# Ending the filling of the color
pen.end_fill()

# Defining method to write text
def txt():

# Move turtle to air
pen.up()

# Move turtle to a given position
pen.setpos(-68, 95)

# Move the turtle to the ground
pen.down()

# Set the text color to lightgreen
pen.color('black')

# Write the specified text in
# specified font style and size
pen.write("YOU MATTER!!", font=(
"Andada Pro", 15, "bold"))



# Draw a heart
heart()

# Write text
txt()

# To hide turtle
pen.ht()
35 changes: 35 additions & 0 deletions AlternateSwap.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#include <iostream>
using namespace std;

void swapAlternate(int arr[], int size)
{
for (int i = 0; i < size; i += 2)
{
if (i + 1 < size)
{
swap(arr[i], arr[i + 1]);
}
}
}

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

int main()
{
int arr[8] = {1, 3, 5, 7, 9, 2, 6, 0};
int brr[5] = {1, 3, 5, 7, 9};

swapAlternate(arr, 8);
printArray(arr, 8);

swapAlternate(brr, 5);
printArray(brr, 5);
return 0;
}
56 changes: 56 additions & 0 deletions BellmanFord.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#include "bits/stdc++.h"
using namespace std;

const int INF = 1e9;

int main(){
int n,m;cin>>n>>m;
vector<vector<int>> edges;
cout<<"u v w"<<endl;
for (int i = 0; i < m; i++)
{
int u,v,w;
cin>>u>>v>>w;
edges.push_back({u,v,w});
}
cout<<endl;
cout<<"SOURCE : "<<endl;
int src; cin>>src;
vector<int> dist(n,INF);
dist[src] = 0;
for (int iter = 0; iter < n-1; iter++)
{
bool change = false;

for(auto e : edges){
int u = e[0];
int v = e[1];
int w = e[2];

//for detection of cycle
if(dist[v] > w + dist[u]){
change = true;
}
dist[v] = min(dist[v], w + dist[u]);
}
}
cout<<"VERTEX DISTANCE FROM SOURCE"<<endl;
for(int i=0;i<n;i++){
cout<<i<<" "<<dist[i]<<endl;
}
cout<<endl;

return 0;
}

// 5 8
// 1 2 3
// 3 2 5
// 1 3 2
// 3 1 1
// 1 4 2
// 0 2 4
// 4 3 -3
// 0 1 -1
// 0
// 0 -1 2 -2 1
19 changes: 19 additions & 0 deletions BinToDec.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include <iostream>
#include <math.h>
using namespace std;

int main()
{
int n;
cin >> n;
int ans=0;
int i=0;
while(n!=0)
{
int bit = n%10;
n/=10;
ans = (bit * pow(2,i)) + ans;
i++;
}
cout<< "Answer is " << ans <<endl;
}
31 changes: 31 additions & 0 deletions Binary Search
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
//code for binnary search algorithim in C

#include <stdio.h>

int binarySearch(int arr[], int l, int r, int x)
{
if (r >= l) {
int mid = l + (r - l) / 2;

if (arr[mid] == x)
return mid;

if (arr[mid] > x)
return binarySearch(arr, l, mid - 1, x);

return binarySearch(arr, mid + 1, r, x);
}
return -1;
}

int main(void)
{
int arr[] = { 2, 3, 4, 10, 40 };
int n = sizeof(arr) / sizeof(arr[0]);
int x = 10;
int result = binarySearch(arr, 0, n - 1, x);
(result == -1)
? printf("Element is not present in array")
: printf("Element is present at index %d", result);
return 0;
}
37 changes: 37 additions & 0 deletions BreadthFirstSearch.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#include <stdio.h>
void BFS(int a[10][10], int n, int src, int s[10])
{
int f = 0, r = -1, q[20], i, v;
printf("Source Node: %d\n", src);
s[src] = 1;
q[++r] = src;
printf("Visited Nodes using BFS:\n");
while (f <= r)
{
v = q[f++];
for (i = 1; i <= n; i++)
if (s[i] == 0 && a[v][i])
{
q[++r] = i;
printf("%d\t", i);
s[i] = 1;
}
}
}
int main()
{
int a[10][10], n, i, j, s[20], src;
printf("Enter no. of Nodes in Graph\n");
scanf("%d", &n);
printf("Enter the connections of Graph in Adjacency Matrix\n");
for (i = 1; i <= n; i++)
for (j = 1; j <= n; j++)
scanf("%d", &a[i][j]);
printf("Enter the Source Node\n");
scanf("%d", &src);
for (i = 1; i <= n; i++)
s[i] = 0;
BFS(a, n, src, s);
printf("\n");
return 0;
}
63 changes: 63 additions & 0 deletions BubbleSort_OptimisedCode.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
// Optimized implementation of Bubble sort to avoid extra spaces.

#include <iostream>
#include <bits/stdc++.h>
using namespace std;


void bubbleSort(int arr[], int n)
{
int i, j, flag, temp;

for (i = 0; i < n-1; i++)
{
flag=0;
for (j = 0; j < n-1-i; j++)
{
if (arr[j] > arr[j+1])
{
temp=arr[j];
arr[j]=arr[j+1];
arr[j+1]=temp;
flag=1;
}
}

// IF no two elements were swapped
// by inner loop, then break
if (flag==0)
break;
}
}

// Function to print an array
void printArray(int arr[], int size)
{
for (int i = 0; i < size; i++)
{
cout <<" "<< arr[i];
}
}

// Driver program to test above functions
int main()
{
int n;// size of the array
cout<<"Enter the size of Array"<<endl;
cin>>n;

int arr[n];
cout<<"Enter the elements of the Array"<<endl;
for(int i=0; i<n; i++)
{
cin>>arr[i];
}

bubbleSort(arr, n);
cout <<"Sorted array: \n";
printArray(arr, n);
return 0;
}
// Time Complexity:
// Best Case: O(n)
// Worst case: O(n^2)
3 changes: 3 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
A repo for beginner contributors in hacktober 2022 , you can create a file and upload a new program and pull. MAke sure the program is error free. Multiple languages allowed .
Happy coding.


[Abhishek Kevin Gomes.txt](https://github.com/Anurag2622002/Codefornewccoder/files/9703528/Abhishek.Kevin.Gomes.txt)
Loading