├── AdditionNonStat.java ├── Anagram.java ├── Aniket_Tewari_Inventory_Management_System.ipynb ├── AreaOfTriangle.java ├── ArithmaticNonStat.java ├── ArithmeticOperatorPlus.js ├── BIt.cpp ├── Binary_Search.cpp ├── Binary_Search.exe ├── Bipartite_Graph.cpp ├── BitonicArray.java ├── BlockBreaker ├── .classpath ├── .project ├── .settings │ └── org.eclipse.jdt.core.prefs ├── ball.png ├── bin │ ├── Animate.class │ ├── Block.class │ ├── BlockBreakerPanel.class │ └── Main.class ├── blue.png ├── extra.png ├── green.png ├── paddle.png ├── red.png ├── src │ ├── Animate.java │ ├── Block.java │ ├── BlockBreakerPanel.java │ └── Main.java └── yellow.png ├── Breadth_First_Search.cpp ├── Bridge_cutEdge.cpp ├── Bubble sort cpp program ├── Bubble-effect ├── index.html └── script.js ├── C++ Program to Remove or Delete Vowels from a String ├── C++ Program to check whether a String is Palindrome or not ├── COVID-Tracker-App_hemangdtu ├── .gitignore ├── .metadata ├── README.md ├── android │ ├── .gitignore │ ├── .project │ ├── .settings │ │ └── org.eclipse.buildship.core.prefs │ ├── app │ │ ├── build.gradle │ │ └── src │ │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ │ ├── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── kotlin │ │ │ │ └── com │ │ │ │ │ └── example │ │ │ │ │ └── covid_tracker │ │ │ │ │ └── MainActivity.kt │ │ │ └── res │ │ │ │ ├── drawable-v21 │ │ │ │ └── launch_background.xml │ │ │ │ ├── drawable │ │ │ │ └── launch_background.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── values-night │ │ │ │ └── styles.xml │ │ │ │ └── values │ │ │ │ └── styles.xml │ │ │ └── profile │ │ │ └── AndroidManifest.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ └── gradle-wrapper.properties │ └── settings.gradle ├── fonts │ ├── CircularAir-Light.ttf │ ├── CircularStd-Bold.ttf │ └── CircularStd-Medium.ttf ├── ios │ ├── .gitignore │ ├── Flutter │ │ ├── AppFrameworkInfo.plist │ │ ├── Debug.xcconfig │ │ └── Release.xcconfig │ ├── Runner.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ │ └── WorkspaceSettings.xcsettings │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ ├── Runner.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ └── Runner │ │ ├── AppDelegate.swift │ │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ ├── Icon-App-20x20@1x.png │ │ │ ├── Icon-App-20x20@2x.png │ │ │ ├── Icon-App-20x20@3x.png │ │ │ ├── Icon-App-29x29@1x.png │ │ │ ├── Icon-App-29x29@2x.png │ │ │ ├── Icon-App-29x29@3x.png │ │ │ ├── Icon-App-40x40@1x.png │ │ │ ├── Icon-App-40x40@2x.png │ │ │ ├── Icon-App-40x40@3x.png │ │ │ ├── Icon-App-60x60@2x.png │ │ │ ├── Icon-App-60x60@3x.png │ │ │ ├── Icon-App-76x76@1x.png │ │ │ ├── Icon-App-76x76@2x.png │ │ │ └── Icon-App-83.5x83.5@2x.png │ │ └── LaunchImage.imageset │ │ │ ├── Contents.json │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ └── README.md │ │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ │ ├── Info.plist │ │ └── Runner-Bridging-Header.h ├── lib │ ├── constants │ │ ├── colors.dart │ │ └── textData.dart │ ├── homepage.dart │ ├── main.dart │ ├── sections │ │ ├── information.dart │ │ ├── mostAffected.dart │ │ └── worldStats.dart │ └── widgets │ │ ├── countryCatalogue.dart │ │ ├── faq.dart │ │ └── search.dart ├── pubspec.lock ├── pubspec.yaml ├── screenshots │ ├── Screenshot_1.png │ ├── Screenshot_2.png │ ├── Screenshot_3.png │ └── Screenshot_4.png ├── test │ └── widget_test.dart └── web │ ├── favicon.png │ ├── icons │ ├── Icon-192.png │ └── Icon-512.png │ ├── index.html │ └── manifest.json ├── Calculator.java ├── Calculator_of_two_Numbe.java ├── Check_The_Case.java ├── Class1.java ├── Class2.java ├── Class3.java ├── Class4.java ├── Class5.java ├── Class6.java ├── Class7.java ├── Class8.java ├── Currency_converter.java ├── DNF_Sort.cpp ├── Deletion_inbetween_CircularDoublyLinkedList.cpp ├── DetectLoopinLinkedlist.cpp ├── Dictionary Extension ├── Readme.md ├── dic.png ├── manifest.json ├── popup.css ├── popup.html ├── popup.js └── ss.png ├── Distance_speed_time.py ├── Even_or_odd.java ├── Factorial ├── Fibonacci Triangle.cpp ├── Fibonacci with a Twist.cpp ├── Find one extra character in a string ├── Floyd_Cycle_Detection.cpp ├── Generate_Passwords ├── main.py └── requirements.txt ├── Happy_birthday.java ├── InsertionAnywhereCSLL.cpp ├── InsertionSort.java ├── Insertion_in_DoubleLinkedL.cpp ├── Insertion_in_DoubleLinkedList.cpp ├── IntCalculator.java ├── Kadane's_algorithm.cpp ├── KadanesAlgo.java ├── Kickstart(round G).cpp ├── Kruskal.py ├── Largest_value.java ├── LinearSearch.cpp ├── LinearSearch.java ├── Linked_list_detection_of_cycle.cpp ├── Machine Learning └── LinearRegression.ipynb ├── Main.java ├── Matrix Chain Multiplication ├── Matrix Multiplication.java ├── MaxInArray.java ├── Maximum width of binary tree ├── Maximum_Subarray_Sum.cpp ├── MeetulSingh.cpp ├── MergeSort.cpp ├── NextChar.java ├── NonStatic1.java ├── OrderAgnosticBinarySearch.java ├── Personal_Assistant.py ├── Print upper and lower triangle of a matrix.cpp ├── Quick_Sort.cpp ├── Quotes ├── 1.py ├── 2.png ├── bgimg.png └── quotesimg.png ├── README.md ├── Rabin Karp Search Algorithm ├── RadixSort.class ├── RadixSort.java ├── SARIMAX.ipynb ├── Segment Tree.cpp ├── Singleinheritance. Java ├── Snake & Ladder.cpp ├── SpaceShooterGame.py ├── background-black.png ├── explosion.wav ├── invaderkilled.wav ├── main_code.py ├── pixel_laser_blue.png ├── pixel_laser_green.png ├── pixel_laser_red.png ├── pixel_laser_yellow.png ├── pixel_ship_blue_small.png ├── pixel_ship_green_small.png ├── pixel_ship_red_small.png ├── pixel_ship_yellow.png └── shoot.wav ├── Speed_Test.py ├── Static1.java ├── Static2.java ├── Static3.java ├── Static4.java ├── Stone-paper-scissor-game.py ├── SumOfTwoNumbers.java ├── SwapWithTemp.java ├── SwapWithoutTemp.java ├── TicTacToe.py ├── Transpose of Matrix.cpp ├── ValidTraingle.java ├── Vocabluary ├── animal.html ├── animal.js ├── animals.jpg ├── audio.js ├── baboon.png ├── bear.png ├── black-cat.png ├── camel.png ├── crocodile.png ├── deer.png ├── dog.png ├── elephant.png ├── fox.png ├── frog.png ├── fruits.css ├── lion.png ├── rhinoceros.png ├── sheep.png ├── squirel.png ├── style.css └── tiger.png ├── Vocabs ├── Capsicums.png ├── asparagus.png ├── audio.js ├── beetroot.png ├── broccoli.png ├── cabbage.png ├── carrot.png ├── corn.png ├── cucumber.png ├── eggplant.png ├── garlic.png ├── ginger.png ├── mushroom.png ├── onion.png ├── pumpkin.png ├── soy.png ├── style.css ├── vegetable.css ├── vegetable.html ├── vegetable.jpg └── vegetable.js ├── Wave_Sort.cpp ├── Website_Blocker.py ├── app.js ├── arra_num.py ├── bagOfWords.py ├── balancedParentheses.java ├── binary_Search.dart ├── binary_search_recursion.dart ├── breadth_first_search.dart ├── cargame.cpp ├── check_armstrong.cpp ├── combination_sum.cpp ├── depth_first_search.dart ├── detectLoop.java ├── digit_frequency.C ├── dijkstra_algo.cpp ├── distance using lat and long.py ├── doublylinklist.cpp ├── fibonacci_Search.dart ├── image gallery ├── index.html ├── index.js ├── insertion_at_end_singly_linked_list.cpp ├── interpolation_Search.dart ├── jump_Search.dart ├── largestrectangle.java ├── linear_Search.dart ├── models ├── blogData.js └── commentData.js ├── nearest_neighbour_algorithm.dart ├── package.json ├── peak_element.dart ├── primeornot.c ├── public └── css │ ├── edit.css │ ├── index.css │ ├── new.css │ ├── show.css │ ├── show_bak.css │ └── style.css ├── pythongoogle.py ├── rajtirole_linearsearch.c ├── remove_duplicates.py ├── road_cross by Tamanna-S ├── README.md ├── car.py ├── game_ss.png ├── main.py ├── player.py └── score.py ├── rock-paper-scissors ├── bg-mobile.jpg ├── bg.jpg ├── favicon.png ├── index.html ├── script.js └── style.css ├── routes └── blog.js ├── sieve_eratosthenes.cpp ├── style.css ├── ternary_Search.dart ├── text_to_emoji.py ├── tictactoe.java ├── todo app ├── index.html ├── todo.css └── todoj.js ├── vectorcommand.cpp ├── views └── blog │ ├── edit.ejs │ ├── index.ejs │ ├── new.ejs │ ├── partials │ └── p1.ejs │ └── show.ejs ├── war.cpp ├── weather-website ├── package-lock.json ├── package.json ├── public │ ├── css │ │ └── style.css │ ├── images │ │ └── undraw_snow_globe_923j.svg │ └── js │ │ └── main.js ├── src │ └── app.js └── templates │ ├── partials │ └── footer.hbs │ └── views │ ├── 404error.hbs │ ├── about.hbs │ ├── index.hbs │ └── weather.hbs └── z_function.cpp /AdditionNonStat.java: -------------------------------------------------------------------------------- 1 | package com.company; 2 | 3 | import java.util.Scanner; 4 | 5 | public class AdditionNonStat { 6 | public static void main(String[] args) { 7 | Scanner in = new Scanner(System.in); 8 | System.out.println("Enter first no: "); 9 | int num1 = in.nextInt(); 10 | System.out.println("Enter Second no: "); 11 | int num2 = in.nextInt(); 12 | int sum = num1+num2; 13 | System.out.println("Addition = " +sum); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /Anagram.java: -------------------------------------------------------------------------------- 1 | package strings; 2 | 3 | import java.util.Scanner; 4 | 5 | public class Anagram { 6 | 7 | public static void main(String[] args) { 8 | 9 | Scanner sc=new Scanner(System.in); 10 | 11 | System.out.println("Enter the first string"); 12 | String a = sc.nextLine(); 13 | System.out.println("Enter the second string"); 14 | String b = sc.nextLine(); 15 | 16 | boolean isAnagram =false; 17 | boolean visited[]= new boolean[b.length()]; 18 | 19 | if(a.length() == b.length()) { 20 | for(int i=0;i

9 | 10 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /BIt.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | 5 | // To check if given number is power of 2 or not 6 | 7 | int main(){ 8 | 9 | int n; 10 | 11 | cout<<"Enter a number: "; 12 | cin>>n; 13 | 14 | if((n<1) or ((n&(n-1)))) { 15 | cout< 2 | 3 | #include 4 | using namespace std; 5 | //driver code 6 | int main() 7 | { 8 | int n,i, num, first, last, middle; 9 | cout<< "Enter the number of elements in array:\n"; 10 | cin>>n; 11 | int arr[n]; 12 | cout<<"Enter the Elements (in ascending order):\n"; 13 | for(i=0; i>arr[i]; 15 | cout<<"\nEnter Element to be Searched: "; 16 | cin>>num; 17 | first = 0; 18 | last = n-1; 19 | middle = (first+last)/2; 20 | while(first <= last) 21 | { 22 | if(arr[middle]last) 34 | cout<<"\nThe number, "< 2 | using namespace std; 3 | 4 | bool dfs_helper(vector graph[], int node, int parent, int *visited, int color) { 5 | //if color equals 1 or 2, it means it is visited 6 | visited[node] = color; 7 | 8 | for(auto nbr : graph[node]) { 9 | if(visited[nbr] == 0) { 10 | //check for neighbour of current node 11 | bool subprob = dfs_helper(graph, nbr, node, visited, 3-color); 12 | if(!subprob) { 13 | return false; 14 | } 15 | } 16 | //Cycle detected 17 | else if(nbr!=parent && visited[nbr] == color) { 18 | return false; 19 | } 20 | } 21 | 22 | return true; 23 | } 24 | 25 | bool dfs(vector graph[], int N) { 26 | //Initially all nodes are marked 0 (not visited) 27 | int visited[N] = {0}; 28 | 29 | bool ans = dfs_helper(graph, 1, -1, visited, 1); 30 | 31 | return ans; 32 | } 33 | 34 | int main() { 35 | int N,x,y,e; 36 | cout<<"Enter the number of nodes: "; 37 | cin>>N; 38 | cout<<"Enter the number of edges: "; 39 | cin>>e; 40 | N++; 41 | 42 | vector graph[N]; 43 | 44 | cout<<"Enter the nodes present at each edge\n"; 45 | for(int i=0;i>x>>y; 47 | graph[x].push_back(y); 48 | graph[y].push_back(x); 49 | } 50 | 51 | if(dfs(graph, N)) { 52 | cout<<"Bipartite Graph\n"; 53 | }else { 54 | cout<<"Non Bipartite Graph\n"; 55 | } 56 | 57 | return 0; 58 | 59 | } 60 | -------------------------------------------------------------------------------- /BitonicArray.java: -------------------------------------------------------------------------------- 1 | // Bitonic Araay or mountain array 2 | 3 | // find the greatest element in the array that is first gradually increasing and then decreasing like mountain 4 | // {1,3,6,9,15,14,8,7,2,0}; here ans is 15 5 | public class BitonicArray { 6 | public static void main(String[] args) { 7 | int arr[] = { 1, 3, 6, 9, 17, 19, 20, 29, 15, 14, 8, 7, 2, 0 }; 8 | int ans = search(arr); 9 | System.out.println(ans); 10 | } 11 | 12 | static int search(int[] arr) { 13 | 14 | int start = 0; 15 | int end = arr.length - 1; 16 | int great = 0; 17 | while (start <= end) { 18 | int mid = start + (end - start) / 2; 19 | 20 | if (arr[mid] > arr[mid + 1]) { 21 | great = arr[mid]; 22 | end = mid - 1; 23 | } else { 24 | start = mid + 1; 25 | } 26 | } 27 | return great; 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /BlockBreaker/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /BlockBreaker/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | BlockBreaker 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.jdt.core.javanature 16 | 17 | 18 | -------------------------------------------------------------------------------- /BlockBreaker/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 4 | org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve 5 | org.eclipse.jdt.core.compiler.compliance=1.8 6 | org.eclipse.jdt.core.compiler.debug.lineNumber=generate 7 | org.eclipse.jdt.core.compiler.debug.localVariable=generate 8 | org.eclipse.jdt.core.compiler.debug.sourceFile=generate 9 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 10 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 11 | org.eclipse.jdt.core.compiler.source=1.8 12 | -------------------------------------------------------------------------------- /BlockBreaker/ball.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/BlockBreaker/ball.png -------------------------------------------------------------------------------- /BlockBreaker/bin/Animate.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/BlockBreaker/bin/Animate.class -------------------------------------------------------------------------------- /BlockBreaker/bin/Block.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/BlockBreaker/bin/Block.class -------------------------------------------------------------------------------- /BlockBreaker/bin/BlockBreakerPanel.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/BlockBreaker/bin/BlockBreakerPanel.class -------------------------------------------------------------------------------- /BlockBreaker/bin/Main.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/BlockBreaker/bin/Main.class -------------------------------------------------------------------------------- /BlockBreaker/blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/BlockBreaker/blue.png -------------------------------------------------------------------------------- /BlockBreaker/extra.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/BlockBreaker/extra.png -------------------------------------------------------------------------------- /BlockBreaker/green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/BlockBreaker/green.png -------------------------------------------------------------------------------- /BlockBreaker/paddle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/BlockBreaker/paddle.png -------------------------------------------------------------------------------- /BlockBreaker/red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/BlockBreaker/red.png -------------------------------------------------------------------------------- /BlockBreaker/src/Animate.java: -------------------------------------------------------------------------------- 1 | 2 | public class Animate implements Runnable{ 3 | BlockBreakerPanel bp; 4 | 5 | Animate(BlockBreakerPanel b) { 6 | bp = b; 7 | } 8 | public void run() { 9 | while (true) { 10 | bp.update(); 11 | try { 12 | Thread.sleep(10); 13 | } catch (InterruptedException e) { 14 | // TODO Auto-generated catch block 15 | e.printStackTrace(); 16 | } 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /BlockBreaker/src/Block.java: -------------------------------------------------------------------------------- 1 | import java.awt.Component; 2 | import java.awt.Graphics; 3 | import java.awt.Image; 4 | import java.awt.Rectangle; 5 | import java.awt.Toolkit; 6 | 7 | @SuppressWarnings("serial") 8 | public class Block extends Rectangle{ 9 | Image pic; 10 | int dx = 3; 11 | int dy = -3; 12 | Rectangle left, right; 13 | boolean destroyed = false; 14 | boolean powerup = false; 15 | Block(int a, int b, int w, int h, String s) { 16 | x = a; 17 | y = b; 18 | width = w; 19 | height = h; 20 | left = new Rectangle(a-1, b, 1, h); 21 | right = new Rectangle(a+w+1, b, 1, h); 22 | pic = Toolkit.getDefaultToolkit().getImage(s); 23 | } 24 | 25 | public void draw(Graphics g, Component c) { 26 | if(!destroyed) { 27 | g.drawImage(pic, x, y, width, height, c); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /BlockBreaker/src/Main.java: -------------------------------------------------------------------------------- 1 | import javax.swing.JFrame; 2 | 3 | public class Main { 4 | public static void main(String[] args) { 5 | JFrame frame = new JFrame("Block Breaker"); 6 | 7 | BlockBreakerPanel panel = new BlockBreakerPanel(); 8 | 9 | frame.getContentPane().add(panel); 10 | 11 | frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 12 | 13 | frame.setVisible(true); 14 | frame.setSize(490, 600); 15 | 16 | frame.setResizable(false); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /BlockBreaker/yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/BlockBreaker/yellow.png -------------------------------------------------------------------------------- /Breadth_First_Search.cpp: -------------------------------------------------------------------------------- 1 | // BFS Implementation using C++ 2 | #include 3 | using namespace std; 4 | 5 | vector v; 6 | vector> g; 7 | 8 | void edge(int a, int b) 9 | { 10 | g[a].push_back(b); 11 | // for undirected graph add this line 12 | // g[b].pb(a); 13 | } 14 | 15 | void bfs(int u) 16 | { 17 | queue q; 18 | 19 | q.push(u); 20 | v[u] = true; 21 | 22 | while (!q.empty()) 23 | { 24 | int f = q.front(); 25 | q.pop(); 26 | cout << f << " "; 27 | for (auto i = g[f].begin(); i != g[f].end(); i++) 28 | { 29 | if (!v[*i]) 30 | { 31 | q.push(*i); 32 | v[*i] = true; 33 | } 34 | } 35 | } 36 | } 37 | 38 | int main() 39 | { 40 | int n, e; 41 | cin >> n >> e; 42 | v.assign(n,false); 43 | g.assign(n,vector()); 44 | int a,b; 45 | for(int i=0;i> a >> b; 48 | edge(a,b); 49 | } 50 | for (int i = 0; i < n; i++) 51 | { 52 | if(!v[i]) 53 | { 54 | bfs(i); 55 | } 56 | } 57 | return 0; 58 | } 59 | // Sample Input: 60 | // 8 10 61 | // 0 1 62 | // 0 2 63 | // 0 3 64 | // 0 4 65 | // 1 5 66 | // 2 5 67 | // 3 6 68 | // 4 6 69 | // 5 7 70 | // 6 7 71 | 72 | // Output: 73 | // 0 1 2 3 4 5 6 7 74 | -------------------------------------------------------------------------------- /Bubble sort cpp program: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | int main() 4 | { 5 | int n, i, arr[50], j, temp; 6 | cout<<"Enter the Size (max. 50): "; 7 | cin>>n; 8 | cout<<"Enter "<>arr[i]; 11 | cout<<"\nSorting the Array using Bubble Sort Technique..\n"; 12 | for(i=0; i<(n-1); i++) 13 | { 14 | for(j=0; j<(n-i-1); j++) 15 | { 16 | if(arr[j]>arr[j+1]) 17 | { 18 | temp = arr[j]; 19 | arr[j] = arr[j+1]; 20 | arr[j+1] = temp; 21 | } 22 | } 23 | } 24 | cout<<"\nArray Sorted Successfully!\n"; 25 | cout<<"\nThe New Array is: \n"; 26 | for(i=0; i 2 | 3 | 4 | 5 | 6 | Bubble effect 7 | 8 | 9 | 15 | Your browser does not support the HTML canvas tag. 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /Bubble-effect/script.js: -------------------------------------------------------------------------------- 1 | const canvas = document.getElementById('bubble_effect'); 2 | const context = canvas.getContext('2d'); 3 | 4 | 5 | 6 | let circles = []; 7 | for(let i=0;i<400;i++){ 8 | 9 | let circleData = {} // let circleData = new Object(); 10 | circleData.speed = Math.random()*10; 11 | circleData.radius = Math.random()*30; 12 | circleData.color = `rgba(${Math.random()*255},${Math.random()*255},${Math.random()*255},0.75)`; 13 | 14 | circleData.x = Math.random()*1200; 15 | circleData.y = Math.random()*600; 16 | 17 | circleData.x_vel = Math.random()*4; 18 | circleData.y_vel = Math.random()*4; 19 | circleData.x_flag = 1; 20 | circleData.y_flag = 1; 21 | circles.push(circleData); 22 | } 23 | console.log(circles); 24 | 25 | 26 | 27 | function startAnimation(){ 28 | context.clearRect(0,0,1200,600); 29 | for(i =0;i=1200){ 43 | circles[i].x_flag = 1 44 | } 45 | 46 | if((circles[i].x-circles[i].x_vel)<=0){ 47 | circles[i].x_flag = 0 48 | } 49 | 50 | if((circles[i].y+circles[i].y_vel)>=600){ 51 | circles[i].y_flag = 1 52 | } 53 | 54 | if((circles[i].y-circles[i].y_vel)<=0){ 55 | circles[i].y_flag = 0 56 | } 57 | 58 | 59 | 60 | 61 | if(circles[i].x_flag === 1){ 62 | circles[i].x -= circles[i].x_vel; 63 | } 64 | if(circles[i].x_flag === 0){ 65 | circles[i].x += circles[i].x_vel; 66 | } 67 | if(circles[i].y_flag === 1){ 68 | circles[i].y -= circles[i].y_vel; 69 | } 70 | if(circles[i].y_flag === 0){ 71 | circles[i].y += circles[i].y_vel; 72 | } 73 | 74 | } 75 | } 76 | startAnimation(); 77 | -------------------------------------------------------------------------------- /C++ Program to Remove or Delete Vowels from a String: -------------------------------------------------------------------------------- 1 | /* C++ Program to Remove or Delete Vowels from a String */ 2 | 3 | #include 4 | #include 5 | #include 6 | using namespace std; 7 | 8 | int main() 9 | { 10 | char str[50],str1[50]; 11 | int len, i, j; 12 | cout<<"\nEnter any string :: "; 13 | gets(str); 14 | 15 | strcpy(str1,str); 16 | 17 | len=strlen(str); 18 | for(i=0; i 4 | using namespace std; 5 | 6 | int main() 7 | { 8 | int i,j,len,flag=1; 9 | char a[20]; 10 | cout<<"\nEnter any string :: "; 11 | cin>>a; 12 | 13 | for(len=0;a[len]!='\0';++len); 14 | for(i=0,j=len-1;i 11 | [API Documentation](https://corona.lmao.ninja/docs/) 12 | -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | 9 | # Remember to never publicly share your keystore. 10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app 11 | key.properties 12 | -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/android/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | android 4 | Project android created by Buildship. 5 | 6 | 7 | 8 | 9 | org.eclipse.buildship.core.gradleprojectbuilder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.buildship.core.gradleprojectnature 16 | 17 | 18 | 19 | 1633949326835 20 | 21 | 30 22 | 23 | org.eclipse.core.resources.regexFilterMatcher 24 | node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__ 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/android/.settings/org.eclipse.buildship.core.prefs: -------------------------------------------------------------------------------- 1 | arguments= 2 | auto.sync=false 3 | build.scans.enabled=false 4 | connection.gradle.distribution=GRADLE_DISTRIBUTION(VERSION(7.0-rc-1)) 5 | connection.project.dir= 6 | eclipse.preferences.version=1 7 | gradle.user.home= 8 | java.home=C\:/Users/Lenovo/AppData/Local/Programs/AdoptOpenJDK/jdk-11.0.11.9-hotspot 9 | jvm.arguments= 10 | offline.mode=false 11 | override.workspace.settings=true 12 | show.console.view=true 13 | show.executions.view=true 14 | -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | android { 29 | compileSdkVersion 30 30 | 31 | sourceSets { 32 | main.java.srcDirs += 'src/main/kotlin' 33 | } 34 | 35 | defaultConfig { 36 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 37 | applicationId "com.example.covid_tracker" 38 | minSdkVersion 16 39 | targetSdkVersion 30 40 | versionCode flutterVersionCode.toInteger() 41 | versionName flutterVersionName 42 | } 43 | 44 | buildTypes { 45 | release { 46 | // TODO: Add your own signing config for the release build. 47 | // Signing with the debug keys for now, so `flutter run --release` works. 48 | signingConfig signingConfigs.debug 49 | } 50 | } 51 | } 52 | 53 | flutter { 54 | source '../..' 55 | } 56 | 57 | dependencies { 58 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 59 | } 60 | -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 13 | 17 | 21 | 26 | 30 | 31 | 32 | 33 | 34 | 35 | 37 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/android/app/src/main/kotlin/com/example/covid_tracker/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.covid_tracker 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/COVID-Tracker-App_hemangdtu/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/COVID-Tracker-App_hemangdtu/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/COVID-Tracker-App_hemangdtu/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/COVID-Tracker-App_hemangdtu/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/COVID-Tracker-App_hemangdtu/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.3.50' 3 | repositories { 4 | google() 5 | jcenter() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:4.1.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | jcenter() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | } 25 | subprojects { 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | task clean(type: Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip 7 | -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties") 4 | def properties = new Properties() 5 | 6 | assert localPropertiesFile.exists() 7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } 8 | 9 | def flutterSdkPath = properties.getProperty("flutter.sdk") 10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" 12 | -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/fonts/CircularAir-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/COVID-Tracker-App_hemangdtu/fonts/CircularAir-Light.ttf -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/fonts/CircularStd-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/COVID-Tracker-App_hemangdtu/fonts/CircularStd-Bold.ttf -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/fonts/CircularStd-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/COVID-Tracker-App_hemangdtu/fonts/CircularStd-Medium.ttf -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/ios/.gitignore: -------------------------------------------------------------------------------- 1 | *.mode1v3 2 | *.mode2v3 3 | *.moved-aside 4 | *.pbxuser 5 | *.perspectivev3 6 | **/*sync/ 7 | .sconsign.dblite 8 | .tags* 9 | **/.vagrant/ 10 | **/DerivedData/ 11 | Icon? 12 | **/Pods/ 13 | **/.symlinks/ 14 | profile 15 | xcuserdata 16 | **/.generated/ 17 | Flutter/App.framework 18 | Flutter/Flutter.framework 19 | Flutter/Flutter.podspec 20 | Flutter/Generated.xcconfig 21 | Flutter/app.flx 22 | Flutter/app.zip 23 | Flutter/flutter_assets/ 24 | Flutter/flutter_export_environment.sh 25 | ServiceDefinitions.json 26 | Runner/GeneratedPluginRegistrant.* 27 | 28 | # Exceptions to above rules. 29 | !default.mode1v3 30 | !default.mode2v3 31 | !default.pbxuser 32 | !default.perspectivev3 33 | -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/COVID-Tracker-App_hemangdtu/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/COVID-Tracker-App_hemangdtu/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/COVID-Tracker-App_hemangdtu/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/COVID-Tracker-App_hemangdtu/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/COVID-Tracker-App_hemangdtu/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/COVID-Tracker-App_hemangdtu/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/COVID-Tracker-App_hemangdtu/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/COVID-Tracker-App_hemangdtu/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/COVID-Tracker-App_hemangdtu/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/COVID-Tracker-App_hemangdtu/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/COVID-Tracker-App_hemangdtu/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/COVID-Tracker-App_hemangdtu/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/COVID-Tracker-App_hemangdtu/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/COVID-Tracker-App_hemangdtu/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/COVID-Tracker-App_hemangdtu/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/COVID-Tracker-App_hemangdtu/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/COVID-Tracker-App_hemangdtu/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/COVID-Tracker-App_hemangdtu/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | covid_tracker 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/lib/constants/colors.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | Color primaryBlack = Color(0xff202c3b); 4 | Color quoteBox = Colors.orange[200]; 5 | -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:covid_tracker/constants/colors.dart'; 2 | import 'package:covid_tracker/homepage.dart'; 3 | import 'package:flutter/material.dart'; 4 | 5 | void main() { 6 | runApp(COVIDTracker()); 7 | } 8 | 9 | class COVIDTracker extends StatelessWidget { 10 | @override 11 | Widget build(BuildContext context) { 12 | return MaterialApp( 13 | debugShowCheckedModeBanner: false, 14 | theme: ThemeData( 15 | fontFamily: "Circular", 16 | primaryColor: primaryBlack, 17 | ), 18 | home: SafeArea( 19 | child: HomePage(), 20 | ), 21 | ); 22 | } 23 | } 24 | 25 | // class COVIDTracker extends StatelessWidget { 26 | // @override 27 | // Widget build(BuildContext context) { 28 | // return DynamicTheme( 29 | // data: (brightness) { 30 | // return ThemeData( 31 | // primaryColor: primaryBlack, 32 | // fontFamily: 'Circular', 33 | // brightness: brightness == Brightness.light 34 | // ? Brightness.light 35 | // : Brightness.dark, 36 | // scaffoldBackgroundColor: brightness == Brightness.dark 37 | // ? Colors.blueGrey[900] 38 | // : Colors.white); 39 | // }, 40 | // themedWidgetBuilder: (context, theme) { 41 | // return MaterialApp( 42 | // debugShowCheckedModeBanner: false, 43 | // theme: theme, 44 | // home: HomePage(), 45 | // ); 46 | // }, 47 | // ); 48 | // } 49 | // } -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/lib/sections/mostAffected.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class MostAffectedPanel extends StatelessWidget { 4 | final List countryData; 5 | 6 | const MostAffectedPanel({Key key, this.countryData}) : super(key: key); 7 | 8 | @override 9 | Widget build(BuildContext context) { 10 | return Container( 11 | child: ListView.builder( 12 | shrinkWrap: true, 13 | physics: NeverScrollableScrollPhysics(), 14 | itemBuilder: (context, index) { 15 | return Container( 16 | margin: EdgeInsets.symmetric(horizontal: 10, vertical: 10), 17 | child: Row( 18 | children: [ 19 | Image.network( 20 | countryData[index]['countryInfo']['flag'], 21 | height: 25, 22 | ), 23 | SizedBox( 24 | width: 10, 25 | ), 26 | Text( 27 | countryData[index]['country'], 28 | style: TextStyle(fontWeight: FontWeight.bold), 29 | ), 30 | SizedBox( 31 | width: 10, 32 | ), 33 | Text( 34 | 'Deaths:' + countryData[index]['deaths'].toString(), 35 | style: 36 | TextStyle(color: Colors.red, fontWeight: FontWeight.bold), 37 | ) 38 | ], 39 | ), 40 | ); 41 | }, 42 | itemCount: 5, 43 | ), 44 | ); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/lib/widgets/faq.dart: -------------------------------------------------------------------------------- 1 | import 'package:covid_tracker/constants/textData.dart'; 2 | import 'package:flutter/material.dart'; 3 | 4 | class FAQPage extends StatelessWidget { 5 | @override 6 | Widget build(BuildContext context) { 7 | return Scaffold( 8 | appBar: AppBar( 9 | title: Text('FAQs'), 10 | ), 11 | body: ListView.builder( 12 | itemCount: TextData.questionAnswers.length, 13 | itemBuilder: (context, index) { 14 | return ExpansionTile( 15 | title: Text( 16 | TextData.questionAnswers[index]['question'], 17 | style: TextStyle(fontWeight: FontWeight.bold), 18 | ), 19 | children: [ 20 | Padding( 21 | padding: const EdgeInsets.all(12.0), 22 | child: Text(TextData.questionAnswers[index]['answer']), 23 | ) 24 | ], 25 | ); 26 | }), 27 | ); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/screenshots/Screenshot_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/COVID-Tracker-App_hemangdtu/screenshots/Screenshot_1.png -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/screenshots/Screenshot_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/COVID-Tracker-App_hemangdtu/screenshots/Screenshot_2.png -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/screenshots/Screenshot_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/COVID-Tracker-App_hemangdtu/screenshots/Screenshot_3.png -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/screenshots/Screenshot_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/COVID-Tracker-App_hemangdtu/screenshots/Screenshot_4.png -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility that Flutter provides. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:covid_tracker/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget(COVIDTracker()); 17 | 18 | // Verify that our counter starts at 0. 19 | expect(find.text('0'), findsOneWidget); 20 | expect(find.text('1'), findsNothing); 21 | 22 | // Tap the '+' icon and trigger a frame. 23 | await tester.tap(find.byIcon(Icons.add)); 24 | await tester.pump(); 25 | 26 | // Verify that our counter has incremented. 27 | expect(find.text('0'), findsNothing); 28 | expect(find.text('1'), findsOneWidget); 29 | }); 30 | } 31 | -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/COVID-Tracker-App_hemangdtu/web/favicon.png -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/COVID-Tracker-App_hemangdtu/web/icons/Icon-192.png -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/COVID-Tracker-App_hemangdtu/web/icons/Icon-512.png -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | covid_tracker 30 | 31 | 32 | 33 | 36 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /COVID-Tracker-App_hemangdtu/web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "covid_tracker", 3 | "short_name": "covid_tracker", 4 | "start_url": ".", 5 | "display": "standalone", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 8 | "description": "A new Flutter project.", 9 | "orientation": "portrait-primary", 10 | "prefer_related_applications": false, 11 | "icons": [ 12 | { 13 | "src": "icons/Icon-192.png", 14 | "sizes": "192x192", 15 | "type": "image/png" 16 | }, 17 | { 18 | "src": "icons/Icon-512.png", 19 | "sizes": "512x512", 20 | "type": "image/png" 21 | } 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /Calculator.java: -------------------------------------------------------------------------------- 1 | package com.company; 2 | 3 | import java.util.Scanner; 4 | 5 | public class Calculator { 6 | public static void main(String[] args) { 7 | //Take input from user till user does not press 8 | Scanner in = new Scanner(System.in); 9 | int ans = 0; 10 | while (true) { 11 | //take operator as input 12 | System.out.println("Enter the operator:"); 13 | char op = in.next().trim().charAt(0); 14 | if (op == '+' || op == '-' || op == '*' || op == '/' || op == '%') { 15 | 16 | //input the no 17 | System.out.println("Enter two numbers:"); 18 | int num1 = in.nextInt(); 19 | int num2 = in.nextInt(); 20 | 21 | if (op == '+') { 22 | ans = num1+num2; 23 | } 24 | if (op == '-') { 25 | ans = num1-num2; 26 | } 27 | if (op == '*') { 28 | ans = num1*num2; 29 | } 30 | if (op == '/') { 31 | if (num2 != 0) 32 | { 33 | ans = num1/num2; 34 | } 35 | } 36 | if (op == '%') { 37 | ans = num1%num2; 38 | } 39 | 40 | }else if(op == 'x' || op == 'X') 41 | { 42 | break; 43 | }else{ 44 | System.out.println("Invalide operation!"); 45 | } 46 | System.out.println("Ans is:" +ans); 47 | } 48 | 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Calculator_of_two_Numbe.java: -------------------------------------------------------------------------------- 1 | package com.company; 2 | 3 | import java.util.Scanner; 4 | 5 | public class Calculator_of_two_Numbe { 6 | public static void main(String[] args) 7 | { 8 | char operation; 9 | Scanner op = new Scanner(System.in); 10 | int a = 15; 11 | int b = 20; 12 | 13 | operation = op.next().charAt(0); 14 | 15 | if(operation == '+') 16 | { 17 | System.out.println(a + b); 18 | } 19 | else if(operation == '-') 20 | { 21 | System.out.println(a - b); 22 | } 23 | else if(operation == '*') 24 | { 25 | System.out.println(a * b); 26 | } 27 | else if(operation == '/') 28 | { 29 | System.out.println(a / b); 30 | } 31 | else 32 | { 33 | System.out.println("Please check the input."); 34 | } 35 | 36 | 37 | 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Check_The_Case.java: -------------------------------------------------------------------------------- 1 | package com.company; 2 | 3 | import java.util.Scanner; 4 | 5 | public class Check_The_Case { 6 | public static void main(String[] args) 7 | { 8 | //Q.Check the type of character. 9 | Scanner in = new Scanner(System.in); 10 | /*What is trim and charAt? 11 | trim means that are remove all extra spaces that are the end of the word. 12 | charAt means give me the index of the string its array type*/ 13 | char ch = in.next().trim().charAt(0); 14 | 15 | if(ch > 'a' && ch <= 'z') 16 | { 17 | System.out.println("Lowercase"); 18 | } 19 | else{ 20 | System.out.println("Uppercase"); 21 | } 22 | 23 | System.out.println(ch); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Class1.java: -------------------------------------------------------------------------------- 1 | package Generic_Tree; 2 | 3 | import java.util.*; 4 | 5 | public class Class1 { 6 | 7 | public static class Node{ 8 | int data; 9 | ArrayList children = new ArrayList<>(); 10 | } 11 | 12 | public static void display(Node node) { 13 | String str = node.data+" -> "; 14 | for(Node child: node.children) { 15 | str += child.data + ", "; 16 | } 17 | str+="."; 18 | System.out.println(str); 19 | 20 | for(Node child: node.children) { 21 | display(child); 22 | } 23 | } 24 | 25 | public static void main(String[] args) { 26 | int arr[] = {10, 20, 50, -1, 60, -1, -1, 30, 70, -1, 80, 110, -1, 120, -1, -1, 90, -1, -1, 40, 100, -1, -1, -1}; 27 | 28 | Node root = null; 29 | Stack st = new Stack<>(); 30 | 31 | for(int i=0; i 0) { 39 | st.peek().children.add(t); 40 | }else { 41 | root = t; 42 | } 43 | st.push(t); 44 | } 45 | } 46 | display(root); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Class2.java: -------------------------------------------------------------------------------- 1 | package Generic_Tree; 2 | 3 | import java.io.*; 4 | import java.util.*; 5 | 6 | public class Class2 { 7 | private static class Node { 8 | int data; 9 | ArrayList children = new ArrayList<>(); 10 | } 11 | 12 | public static void display(Node node) { 13 | String str = node.data + " -> "; 14 | for (Node child : node.children) { 15 | str += child.data + ", "; 16 | } 17 | str += "."; 18 | System.out.println(str); 19 | 20 | for (Node child : node.children) { 21 | display(child); 22 | } 23 | } 24 | 25 | public static Node construct(int[] arr) { 26 | Node root = null; 27 | 28 | Stack st = new Stack<>(); 29 | for (int i = 0; i < arr.length; i++) { 30 | if (arr[i] == -1) { 31 | st.pop(); 32 | } else { 33 | Node t = new Node(); 34 | t.data = arr[i]; 35 | 36 | if (st.size() > 0) { 37 | st.peek().children.add(t); 38 | } else { 39 | root = t; 40 | } 41 | 42 | st.push(t); 43 | } 44 | } 45 | 46 | return root; 47 | } 48 | 49 | public static int size(Node node){ 50 | // write your code here 51 | int s = 0; 52 | for(Node child: node.children) { 53 | int cs = size(child); 54 | s = s + cs; 55 | } 56 | s = s + 1; 57 | return s; 58 | } 59 | 60 | public static void main(String[] args) throws Exception { 61 | BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); 62 | int n = Integer.parseInt(br.readLine()); 63 | int[] arr = new int[n]; 64 | String[] values = br.readLine().split(" "); 65 | for (int i = 0; i < n; i++) { 66 | arr[i] = Integer.parseInt(values[i]); 67 | } 68 | 69 | Node root = construct(arr); 70 | int sz = size(root); 71 | System.out.println(sz); 72 | // display(root); 73 | } 74 | 75 | } -------------------------------------------------------------------------------- /Class3.java: -------------------------------------------------------------------------------- 1 | package Generic_Tree; 2 | 3 | import java.io.*; 4 | import java.util.*; 5 | 6 | public class Class3 { 7 | private static class Node { 8 | int data; 9 | ArrayList children = new ArrayList<>(); 10 | } 11 | 12 | public static void display(Node node) { 13 | String str = node.data + " -> "; 14 | for (Node child : node.children) { 15 | str += child.data + ", "; 16 | } 17 | str += "."; 18 | System.out.println(str); 19 | 20 | for (Node child : node.children) { 21 | display(child); 22 | } 23 | } 24 | 25 | public static Node construct(int[] arr) { 26 | Node root = null; 27 | 28 | Stack st = new Stack<>(); 29 | for (int i = 0; i < arr.length; i++) { 30 | if (arr[i] == -1) { 31 | st.pop(); 32 | } else { 33 | Node t = new Node(); 34 | t.data = arr[i]; 35 | 36 | if (st.size() > 0) { 37 | st.peek().children.add(t); 38 | } else { 39 | root = t; 40 | } 41 | 42 | st.push(t); 43 | } 44 | } 45 | 46 | return root; 47 | } 48 | 49 | public static int size(Node node) { 50 | int s = 0; 51 | 52 | for (Node child : node.children) { 53 | s += size(child); 54 | } 55 | s += 1; 56 | 57 | return s; 58 | } 59 | 60 | public static int max(Node node) { 61 | // write your code here 62 | 63 | int max = Integer.MIN_VALUE; 64 | 65 | for(Node child: node.children) { 66 | int cm = max(child); 67 | max = Math.max(max, cm); 68 | } 69 | max = Math.max(node.data, max); 70 | 71 | return max; 72 | } 73 | 74 | public static void main(String[] args) throws Exception { 75 | BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); 76 | int n = Integer.parseInt(br.readLine()); 77 | int[] arr = new int[n]; 78 | String[] values = br.readLine().split(" "); 79 | for (int i = 0; i < n; i++) { 80 | arr[i] = Integer.parseInt(values[i]); 81 | } 82 | 83 | Node root = construct(arr); 84 | int m = max(root); 85 | System.out.println(m); 86 | // display(root); 87 | } 88 | 89 | } -------------------------------------------------------------------------------- /Class4.java: -------------------------------------------------------------------------------- 1 | package Generic_Tree; 2 | 3 | import java.io.*; 4 | import java.util.*; 5 | 6 | public class Class4 { 7 | private static class Node { 8 | int data; 9 | ArrayList children = new ArrayList<>(); 10 | } 11 | 12 | public static void display(Node node) { 13 | String str = node.data + " -> "; 14 | for (Node child : node.children) { 15 | str += child.data + ", "; 16 | } 17 | str += "."; 18 | System.out.println(str); 19 | 20 | for (Node child : node.children) { 21 | display(child); 22 | } 23 | } 24 | 25 | public static Node construct(int[] arr) { 26 | Node root = null; 27 | 28 | Stack st = new Stack<>(); 29 | for (int i = 0; i < arr.length; i++) { 30 | if (arr[i] == -1) { 31 | st.pop(); 32 | } else { 33 | Node t = new Node(); 34 | t.data = arr[i]; 35 | 36 | if (st.size() > 0) { 37 | st.peek().children.add(t); 38 | } else { 39 | root = t; 40 | } 41 | 42 | st.push(t); 43 | } 44 | } 45 | 46 | return root; 47 | } 48 | 49 | public static int size(Node node) { 50 | int s = 0; 51 | 52 | for (Node child : node.children) { 53 | s += size(child); 54 | } 55 | s += 1; 56 | 57 | return s; 58 | } 59 | 60 | public static int max(Node node) { 61 | int m = Integer.MIN_VALUE; 62 | 63 | for (Node child : node.children) { 64 | int cm = max(child); 65 | m = Math.max(m, cm); 66 | } 67 | m = Math.max(m, node.data); 68 | 69 | return m; 70 | } 71 | 72 | public static int height(Node node) { 73 | // write your code here 74 | int height = -1; 75 | for(Node child: node.children) { 76 | int ch = height(child); 77 | height = Math.max(ch, height); 78 | } 79 | height+=1; 80 | 81 | return height; 82 | } 83 | 84 | public static void main(String[] args) throws Exception { 85 | BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); 86 | int n = Integer.parseInt(br.readLine()); 87 | int[] arr = new int[n]; 88 | String[] values = br.readLine().split(" "); 89 | for (int i = 0; i < n; i++) { 90 | arr[i] = Integer.parseInt(values[i]); 91 | } 92 | 93 | Node root = construct(arr); 94 | int h = height(root); 95 | System.out.println(h); 96 | // display(root); 97 | } 98 | 99 | } -------------------------------------------------------------------------------- /Class8.java: -------------------------------------------------------------------------------- 1 | package Generic_Tree; 2 | 3 | public class Class8 { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /Currency_converter.java: -------------------------------------------------------------------------------- 1 | package com.company; 2 | 3 | import java.util.Scanner; 4 | 5 | public class Currency_converter { 6 | public static void main(String[] args) 7 | { 8 | float rup; 9 | Scanner ip = new Scanner(System.in); 10 | rup = ip.nextFloat(); 11 | float usd = rup / 75; 12 | System.out.println(usd); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /DNF_Sort.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | void DNFSort(int arr[], int n){ 5 | int low = 0; 6 | int mid = 0; 7 | int high = n-1; 8 | while(mid<=high){ 9 | if(arr[mid] == 0){ 10 | swap(arr[mid], arr[low]); 11 | low++; 12 | mid++; 13 | } 14 | 15 | else if(arr[mid] == 1){ 16 | mid++; 17 | } 18 | 19 | else{ 20 | swap(arr[mid], arr[high]); 21 | high--; 22 | } 23 | } 24 | } 25 | 26 | int main(){ 27 | int n; 28 | cout<<"Enter N: "; 29 | cin>>n; 30 | 31 | int arr[n]; 32 | cout<<"Enter Elements of Array: "; 33 | for(int i=0; i>arr[i]; 35 | 36 | DNFSort(arr, n); 37 | 38 | cout<<"Sorted Array :: \n"; 39 | for(int i=0; i 2 | using namespace std; 3 | struct node{ 4 | int data; 5 | node *ptr,*pre; 6 | }; 7 | node *head=NULL; 8 | void insertathead(int a){ 9 | node *temp=new node; 10 | temp->data=a; 11 | temp->ptr=temp->pre=temp; 12 | if(head==NULL) 13 | head=temp; 14 | else{ 15 | temp->ptr=head; 16 | temp->pre=head->pre; 17 | head->pre=temp; 18 | temp->pre->ptr=temp; 19 | head=temp; 20 | } 21 | } 22 | void deletionathead(){ 23 | if(head==NULL) 24 | cout<<"EMPTY\n"; 25 | else{ 26 | node *p=head; 27 | if(head->ptr==head) 28 | head=NULL; 29 | else{ 30 | head->pre->ptr=head->ptr; 31 | head->ptr->pre=head->pre; 32 | head=head->ptr; 33 | } 34 | p=NULL; 35 | } 36 | } 37 | void display(){ 38 | node *p=head; 39 | while(p->ptr!=head){ 40 | cout<data<ptr; 42 | } 43 | cout<data< 3 | using namespace std; 4 | 5 | /* Link list node */ 6 | class Node { 7 | public: 8 | int data; 9 | Node* next; 10 | }; 11 | 12 | void push(Node** head_ref, int new_data) 13 | { 14 | 15 | Node* new_node = new Node(); 16 | 17 | new_node->data = new_data; 18 | 19 | new_node->next = (*head_ref); 20 | 21 | (*head_ref) = new_node; 22 | } 23 | 24 | int detectLoop(Node* head) 25 | { 26 | Node *fast_pointer = head; 27 | Node *slow_pointer = head; 28 | 29 | while(fast_pointer && fast_pointer->next) 30 | { 31 | slow_pointer = slow_pointer->next; 32 | fast_pointer = fast_pointer->next->next; 33 | if(fast_pointer == slow_pointer) 34 | { 35 | return 1; 36 | } 37 | } 38 | 39 | return 0; 40 | } 41 | 42 | 43 | int main() 44 | { 45 | /* Start with the empty list */ 46 | Node* head = NULL; 47 | 48 | push(&head, 20); 49 | push(&head, 4); 50 | push(&head, 15); 51 | push(&head, 15); 52 | push(&head, 10); 53 | 54 | /* Create a loop for testing */ 55 | head->next->next->next = head; 56 | if (detectLoop(head)) 57 | cout << "Loop found"; 58 | else 59 | cout << "No Loop"; 60 | return 0; 61 | } -------------------------------------------------------------------------------- /Dictionary Extension/Readme.md: -------------------------------------------------------------------------------- 1 | # English dictionary extension 2 | 3 | ## Description 4 | 5 | -> This is a browser extension developed using the following free API: 6 | https://dictionaryapi.dev/ 7 | 8 | ### Directions of use: 9 | 10 | 1. chrome://extensions/ 11 | 2. Switch on the developer mode through an option given on top right corner. 12 | 3. Now, we can add extensions created by our own selves. 13 | 4. Click on "Load Unpacked" on top left corner below the top bar. 14 | 5. Choose the complete extension folder and click "Select Folder". 15 | 16 | #### Technologies 17 | 18 | -> Javascript 19 | 20 | ##### Screenshot 21 | 22 | > ![Image](ss.png) 23 | -------------------------------------------------------------------------------- /Dictionary Extension/dic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/Dictionary Extension/dic.png -------------------------------------------------------------------------------- /Dictionary Extension/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Dictionary Extension", 3 | "version": "1.0", 4 | "description": "Finds the meaning of the word entered by user", 5 | "browser_action": { 6 | "default_title": "Hello there! What is it that you're looking for", 7 | "default_popup": "popup.html", 8 | "default_icon": { 9 | "16": "dic.png", 10 | "32": "dic.png" 11 | } 12 | }, 13 | "content_scripts": [ 14 | { 15 | "matches": [""], 16 | "js": ["popup.js"] 17 | } 18 | ], 19 | "manifest_version": 2 20 | } 21 | -------------------------------------------------------------------------------- /Dictionary Extension/popup.css: -------------------------------------------------------------------------------- 1 | body{ 2 | margin: 0; 3 | border:1px solid rgb(197, 150, 63); 4 | background-color:rgb(204, 142, 27); 5 | padding: 30px; 6 | border-radius: 50%; 7 | font-family: 'Oxygen', sans-serif; 8 | width: 300px; 9 | line-height: 2em; 10 | 11 | } 12 | 13 | 14 | input{ 15 | margin: 20px 0; 16 | padding: 12px; 17 | display: inline-block; 18 | border: 1px solid #ccc; 19 | border-radius: 4px; 20 | box-sizing: border-box; 21 | } 22 | 23 | input[type=text] { 24 | font-size: 14px; 25 | } 26 | 27 | input:focus{ 28 | outline: none; 29 | } 30 | 31 | button{ 32 | margin: 20px 0; 33 | padding: 12px 20px; 34 | background-color:rgb(182, 99, 21); 35 | border: none; 36 | border-radius: 4px; 37 | color: white; 38 | text-decoration: none; 39 | cursor: pointer; 40 | } 41 | 42 | 43 | 44 | #material{ 45 | font-size: 16px; 46 | transition: all 1s ease; 47 | } -------------------------------------------------------------------------------- /Dictionary Extension/popup.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | Find Meaning 11 | 12 | 13 |

Hello there! What is it that you're looking for?

14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /Dictionary Extension/popup.js: -------------------------------------------------------------------------------- 1 | var url = "https://api.dictionaryapi.dev/api/v2/entries/en_US" 2 | var input = document.getElementById("input"); 3 | var button = document.getElementById("btn"); 4 | var mat = document.getElementById("material"); 5 | 6 | 7 | if(button !== null){ 8 | button.addEventListener("click", async function(){ 9 | mat.innerHTML = ""; 10 | var val = input.value; 11 | if(val !== ""){ 12 | var temp_url = url + "/" + val; 13 | var json_data = await httpGet(temp_url); 14 | 15 | 16 | var data = JSON.parse(json_data); 17 | if(data.title){ 18 | mat.innerHTML = data.message; 19 | return; 20 | } 21 | 22 | var l = data[0].meanings.length; 23 | for(var i=0;i { 47 | var xmlHttp = new XMLHttpRequest(); 48 | xmlHttp.onload = function () { 49 | if (this.status >= 200 && this.status < 300) { 50 | resolve(xmlHttp.response); 51 | } 52 | if (this.status == 404) { 53 | resolve(xmlHttp.response); 54 | } 55 | }; 56 | xmlHttp.open("GET", theUrl, true); // true for asynchronous request 57 | xmlHttp.send(null); 58 | }); 59 | } 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /Dictionary Extension/ss.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/Dictionary Extension/ss.png -------------------------------------------------------------------------------- /Even_or_odd.java: -------------------------------------------------------------------------------- 1 | //package com.company; 2 | // 3 | //import java.util.Scanner; 4 | // 5 | // /*Java Program to check whether a number is even or odd*/ 6 | // public static 7 | //void main(String args[]) 8 | // { 9 | // //To take input from the user 10 | // //Create an object of scanner class 11 | // Scanner input = new Scanner(System.in); 12 | // int num; //Declare a variable 13 | // System.out.println("Enter a number:"); 14 | // num = input.nextInt(); 15 | // 16 | // //If number is divisible by 2 then it's an even number 17 | // //else odd number 18 | // if ( num % 2 == 0 ) 19 | // System.out.println("The entered number is even"); 20 | // elsepublic class Even_or_odd { 21 | // 22 | // System.out.println("The entered number is odd"); 23 | // } 24 | //} 25 | -------------------------------------------------------------------------------- /Factorial: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int factorial(int n) 5 | { 6 | if(n > 1) 7 | return n * factorial(n - 1); 8 | else 9 | return 1; 10 | } 11 | 12 | int main() 13 | { 14 | int n=5; 15 | cout << " " << n << " = " << factorial(n); 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /Fibonacci Triangle.cpp: -------------------------------------------------------------------------------- 1 | //Fibonacci Triangle 2 | #include 3 | using namespace std; 4 | int main() 5 | { 6 | 7 | int a=0,b=1,i,c,n,j; 8 | cout<<"Enter the limit: "; 9 | cin>>n; 10 | for(i=1; i<=n; i++) 11 | { 12 | a=0; 13 | b=1; 14 | cout< 2 | using namespace std; 3 | int fibo(int n) { 4 | if(n == 0){ 5 | return 0; 6 | } else if(n == 1) { 7 | return 1; 8 | } else { 9 | return (fibo(n-1) + fibo(n-2)); 10 | } 11 | } 12 | int check(int n) 13 | { 14 | int flag=0; 15 | for (int i = 2; i <= n / 2; ++i) { 16 | if (n % i == 0) { 17 | flag = 1; 18 | break; 19 | }} 20 | if(n>1&&flag==0) 21 | return 0; 22 | else 23 | { 24 | if(n%5==0) 25 | return 0; 26 | else 27 | return n; 28 | } 29 | 30 | } 31 | int main() 32 | { 33 | int n; 34 | cout<<"Enter n: "; 35 | cin>>n; 36 | int a[n]; 37 | for(int i=0;i<=n;i++) 38 | { 39 | a[i]=fibo(i); 40 | } 41 | for(int i=0;i<=n;i++) 42 | { 43 | a[i]= check(a[i]); 44 | } 45 | cout<<"Fibonacci series :"; 46 | for(int i=1;i<=n;i++) 47 | cout< 4 | using namespace std; 5 | 6 | char findExtraCharcter(string strA, string strB) 7 | { 8 | // store string values in map 9 | unordered_map m1; 10 | 11 | // store second string in map with frequency 12 | for (int i = 0; i < strB.length(); i++) 13 | m1[strB[i]]++; 14 | 15 | // store first string in map with frequency 16 | for (int i = 0; i < strA.length(); i++) 17 | m1[strA[i]]--; 18 | 19 | for (auto h1 = m1.begin(); h1 != m1.end(); h1++) { 20 | 21 | // if the frequency is 1 then this 22 | // character is which is added extra 23 | if (h1->second == 1) 24 | return h1->first; 25 | } 26 | } 27 | 28 | int main() 29 | { 30 | // given string 31 | string strA = "abcd"; 32 | string strB = "cbdad"; 33 | 34 | // find Extra Character 35 | cout << findExtraCharcter(strA, strB); 36 | } 37 | -------------------------------------------------------------------------------- /Floyd_Cycle_Detection.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | class Node{ 5 | public: 6 | int data; 7 | Node* next; 8 | 9 | Node(int val){ 10 | data = val; 11 | next = NULL; 12 | } 13 | }; 14 | 15 | void insertatTail(Node* &head, int val){ 16 | Node* n = new Node(val); 17 | if(head == NULL){ 18 | head = n; 19 | return; 20 | } 21 | 22 | Node* temp = head; 23 | while(temp->next != NULL){ 24 | temp = temp->next; 25 | } 26 | temp->next = n; 27 | } 28 | 29 | void makeCycle(Node* &head, int pos){ 30 | Node* temp = head; 31 | Node* startNode; 32 | 33 | int count = 1; 34 | 35 | while(temp->next!=NULL){ 36 | if(count==pos) 37 | startNode = temp; 38 | temp = temp->next; 39 | count++; 40 | } 41 | temp->next = startNode; 42 | } 43 | 44 | void display(Node* head){ 45 | while(head!=NULL){ 46 | cout<data<<"->"; 47 | head = head->next; 48 | } 49 | cout<<"NULL"<next!=NULL)/*We will check for 57 | case when there is no cycle (fast is always ahead of slow)*/ 58 | { 59 | slow = slow->next; 60 | fast = fast->next->next; 61 | 62 | if(slow==fast){ 63 | return true; 64 | } 65 | } 66 | return false; 67 | } 68 | 69 | int main(){ 70 | Node* head = NULL; 71 | insertatTail(head, 1); 72 | insertatTail(head, 2); 73 | insertatTail(head, 3); 74 | insertatTail(head, 4); 75 | insertatTail(head, 5); 76 | insertatTail(head, 6); 77 | insertatTail(head, 7); 78 | insertatTail(head, 8); 79 | insertatTail(head, 9); 80 | 81 | makeCycle(head, 4); 82 | // display(head); 83 | 84 | cout< 2 | using namespace std; 3 | 4 | struct node{ 5 | int data; 6 | struct node *ptr; 7 | }; 8 | 9 | node *head = NULL; 10 | // 11 | void InsertAtHead(int a){ 12 | node *temp = new node; 13 | temp->data=a; 14 | temp->ptr = temp; 15 | if(head==NULL){ 16 | head=temp; 17 | } 18 | else{ 19 | // 40->30->20->10 20 | temp->ptr=head; 21 | node *p=head; 22 | while(p->ptr!=head){ 23 | p=p->ptr; 24 | } 25 | p->ptr=temp; 26 | head=temp; 27 | } 28 | } 29 | //40->30->20-> 15 ->10 30 | void InsertAnywhere(int add, int x){ 31 | node *temp1 = new node; 32 | temp1->data = add; 33 | temp1->ptr = NULL; 34 | node *p = head; 35 | while(p&&p->data!=x){ 36 | p=p->ptr; 37 | } 38 | temp1->ptr = p->ptr; 39 | p->ptr= temp1; 40 | 41 | 42 | } 43 | 44 | void display(){ 45 | node *p=head; 46 | while(p->ptr!=head){ 47 | cout<data<ptr; 49 | } 50 | cout<data< -1) && ( array [i] > key ) ) { 8 | array [i+1] = array [i]; 9 | i--; 10 | } 11 | array[i+1] = key; 12 | } 13 | } 14 | 15 | public static void main(String a[]){ 16 | int[] arr1 = {9,14,3,2,43,11,58,22}; 17 | System.out.println("Before Insertion Sort"); 18 | for(int i:arr1){ 19 | System.out.print(i+" "); 20 | } 21 | System.out.println(); 22 | 23 | insertionSort(arr1);//sorting array using insertion sort 24 | 25 | System.out.println("After Insertion Sort"); 26 | for(int i:arr1){ 27 | System.out.print(i+" "); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Insertion_in_DoubleLinkedL.cpp: -------------------------------------------------------------------------------- 1 | // INSERTION IN BETWEEN 2 | // INPUT THE FIRST VARIABLE WITH NUM TO BE INSERTED 3 | // AND THE SECOND INPUT TO SPECIFY AFTER WHICH NUM 4 | // THE INPUT NUM IS TO BE INSERTED 5 | #include 6 | using namespace std; 7 | struct node{ 8 | int data; 9 | node *ptr,*pre; 10 | }; 11 | node *head=NULL; 12 | void insertathead(int a){ 13 | node *p=new node; 14 | p->data=a; 15 | p->pre=p->ptr=NULL; 16 | if(head==NULL){ 17 | head=p; 18 | } 19 | else{ 20 | head->pre=p; 21 | p->ptr=head; 22 | head=p; 23 | } 24 | } 25 | void insertioninbetween(int a,int b){ 26 | node *p=new node; 27 | p->data=a; 28 | p->pre=p->ptr=NULL; 29 | if(head==NULL) 30 | p=head; 31 | else { 32 | node *temp=head; 33 | while(temp && temp->data!=b){ 34 | temp=temp->ptr; 35 | } 36 | if(temp==NULL){ 37 | cout<<"ELEMENT NOT FOUND\n"; 38 | temp=p=NULL; 39 | } 40 | else if(temp->ptr==NULL){ 41 | p->pre=temp; 42 | temp->ptr=p; 43 | } 44 | else{ 45 | p->pre=temp; 46 | p->ptr=temp->ptr; 47 | temp->ptr->pre=p; 48 | temp->ptr=p; 49 | } 50 | } 51 | } 52 | void displayfromhead(){ 53 | node *p=head; 54 | while(p!=NULL){ 55 | cout<data<ptr; 57 | } 58 | } 59 | int main() 60 | { 61 | insertathead(50); 62 | insertathead(40); 63 | insertathead(30); 64 | insertathead(20); 65 | insertathead(10); 66 | cout<<"BEFORE INSERTION\n"; 67 | displayfromhead(); 68 | insertioninbetween(500,30); 69 | insertioninbetween(100,20); 70 | cout<<"AFTER INSERTION\n"; 71 | displayfromhead(); 72 | return 0; 73 | } 74 | -------------------------------------------------------------------------------- /Insertion_in_DoubleLinkedList.cpp: -------------------------------------------------------------------------------- 1 | // INSERTION IN BETWEEN 2 | // INPUT THE FIRST VARIABLE WITH NUM TO BE INSERTED 3 | // AND THE SECOND INPUT TO SPECIFY AFTER WHICH NUM 4 | // THE INPUT NUM IS TO BE INSERTED 5 | #include 6 | using namespace std; 7 | struct node{ 8 | int data; 9 | node *ptr,*pre; 10 | }; 11 | node *head=NULL; 12 | void insertathead(int a){ 13 | node *p=new node; 14 | p->data=a; 15 | p->pre=p->ptr=NULL; 16 | if(head==NULL){ 17 | head=p; 18 | } 19 | else{ 20 | head->pre=p; 21 | p->ptr=head; 22 | head=p; 23 | } 24 | } 25 | void insertioninbetween(int a,int b){ 26 | node *p=new node; 27 | p->data=a; 28 | p->pre=p->ptr=NULL; 29 | if(head==NULL) 30 | p=head; 31 | else { 32 | node *temp=head; 33 | while(temp && temp->data!=b){ 34 | temp=temp->ptr; 35 | } 36 | if(temp==NULL){ 37 | cout<<"ELEMENT NOT FOUND\n"; 38 | temp=p=NULL; 39 | } 40 | else if(temp->ptr==NULL){ 41 | p->pre=temp; 42 | temp->ptr=p; 43 | } 44 | else{ 45 | p->pre=temp; 46 | p->ptr=temp->ptr; 47 | temp->ptr->pre=p; 48 | temp->ptr=p; 49 | } 50 | } 51 | } 52 | void displayfromhead(){ 53 | node *p=head; 54 | while(p!=NULL){ 55 | cout<data<ptr; 57 | } 58 | } 59 | int main() 60 | { 61 | insertathead(50); 62 | insertathead(40); 63 | insertathead(30); 64 | insertathead(20); 65 | insertathead(10); 66 | cout<<"BEFORE INSERTION\n"; 67 | displayfromhead(); 68 | insertioninbetween(500,30); 69 | insertioninbetween(100,20); 70 | cout<<"AFTER INSERTION\n"; 71 | displayfromhead(); 72 | return 0; 73 | } 74 | -------------------------------------------------------------------------------- /IntCalculator.java: -------------------------------------------------------------------------------- 1 | package com.company; 2 | 3 | import java.util.Scanner; 4 | 5 | public class IntCalculator { 6 | public static void main(String[] args) 7 | { 8 | Scanner sc = new Scanner(System.in); 9 | System.out.println("Enter Two Numbers to Calculate Sum:"); 10 | int fno = sc.nextInt(); 11 | int sno = sc.nextInt(); 12 | float sum; 13 | sum = fno + sno; 14 | System.out.println("Sum of two number is:" + sum); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Kadane's_algorithm.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | class Solution { 5 | public: 6 | long long maxSubarraySum(int arr[], int n) { 7 | long long max_No = INT_MIN, sum = 0; 8 | for (long long i = 0; i < n; i++) 9 | { 10 | sum = sum + arr[i]; 11 | if (max_No < sum) 12 | max_No = sum; 13 | 14 | if (sum < 0) 15 | sum = 0; 16 | } 17 | return max_No; 18 | 19 | } 20 | }; 21 | 22 | int main() 23 | { 24 | int t, n; 25 | cin >> t; 26 | while (t--) 27 | { 28 | cin >> n; 29 | int a[n]; 30 | for (int i = 0; i < n; i++) 31 | cin >> a[i]; 32 | Solution ob; 33 | cout << ob.maxSubarraySum(a, n) << endl; 34 | } 35 | } -------------------------------------------------------------------------------- /KadanesAlgo.java: -------------------------------------------------------------------------------- 1 | import java.io.*; 2 | 3 | class Main { 4 | 5 | public static int maxSubArraySum(int a[], int size) 6 | { 7 | int current=0; 8 | int maxSum=0; 9 | 10 | for (int i = 1; i < size; i++) 11 | { 12 | current+=a[i]; 13 | maxSum=Math.max(current,maxSum); 14 | if(current<0) 15 | current=0; 16 | } 17 | return maxSum; 18 | } 19 | 20 | public static void main(String[] args) 21 | { 22 | int a[] = {-2, -3, 4, -1, -2, 1, 5, -3}; 23 | int n = a.length; 24 | int ans = maxSubArraySum(a, n); 25 | System.out.println("Maximum contiguous sum is " 26 | +ans); 27 | } 28 | } -------------------------------------------------------------------------------- /Kickstart(round G).cpp: -------------------------------------------------------------------------------- 1 | //https://codingcompetitions.withgoogle.com/kickstart/round/00000000004362d6/00000000008b3771(link for the problem) 2 | #include 3 | using namespace std; 4 | #define ll long long int 5 | int main() 6 | { #ifndef ONLINE_JUDGE 7 | freopen("input.txt", "r", stdin); 8 | freopen("output.txt", "w", stdout); 9 | #endif 10 | ll tc; 11 | cin >> tc; 12 | ll gg = 1; 13 | while (gg <= tc) 14 | { 15 | cout << "Case #" << gg << ": "; 16 | gg++; 17 | ll n, d, c, m; 18 | cin >> n >> d >> c >> m;//taking input 19 | string s; 20 | cin >> s; 21 | ll dog = 0; 22 | ll cat = 0; 23 | ll lid = 0; 24 | ll lic = 0; 25 | for (ll i = 0; i < n; i++)//count number of dogs and cats 26 | { 27 | if (s[i] == 'D') 28 | { 29 | lid = i; 30 | lic = cat; 31 | dog++; 32 | } 33 | else 34 | cat++; 35 | } 36 | //lic=n-(lid+1); 37 | if (dog == 0)//check edge cases 38 | { 39 | cout << "YES\n"; 40 | continue; 41 | } 42 | if (dog > d) 43 | { 44 | cout << "NO\n"; 45 | continue; 46 | } 47 | if (cat > c)// if at any point dogs are left and cat food is finished then ans is no 48 | { 49 | int flag = 1; 50 | for (ll i = 0; i < lid; i++) 51 | { 52 | if (s[i] == 'D') 53 | { 54 | c += m; 55 | continue; 56 | } 57 | if (s[i] == 'C') 58 | { 59 | if (c > 0) 60 | { 61 | c -= 1; 62 | } 63 | else 64 | { 65 | flag = 0; 66 | break; 67 | } 68 | } 69 | } 70 | if (flag == 0) 71 | cout << "NO\n"; 72 | else 73 | cout << "YES\n"; 74 | } 75 | else 76 | { 77 | cout << "YES\n"; 78 | } 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /Kruskal.py: -------------------------------------------------------------------------------- 1 | class Graph: 2 | def __init__(self, vertex): 3 | self.V = vertex 4 | self.graph = [] 5 | 6 | def add_edge(self, u, v, w): 7 | self.graph.append([u, v, w]) 8 | 9 | 10 | def search(self, parent, i): 11 | if parent[i] == i: 12 | return i 13 | return self.search(parent, parent[i]) 14 | 15 | def apply_union(self, parent, rank, x, y): 16 | xroot = self.search(parent, x) 17 | yroot = self.search(parent, y) 18 | if rank[xroot] < rank[yroot]: 19 | parent[xroot] = yroot 20 | elif rank[xroot] > rank[yroot]: 21 | parent[yroot] = xroot 22 | else: 23 | parent[yroot] = xroot 24 | rank[xroot] += 1 25 | 26 | 27 | def kruskal(self): 28 | result = [] 29 | i, e = 0, 0 30 | self.graph = sorted(self.graph, key=lambda item: item[2]) 31 | parent = [] 32 | rank = [] 33 | for node in range(self.V): 34 | parent.append(node) 35 | rank.append(0) 36 | while e < self.V - 1: 37 | u, v, w = self.graph[i] 38 | i = i + 1 39 | x = self.search(parent, u) 40 | y = self.search(parent, v) 41 | if x != y: 42 | e = e + 1 43 | result.append([u, v, w]) 44 | self.apply_union(parent, rank, x, y) 45 | for u, v, weight in result: 46 | print("Edge:",u, v,end =" ") 47 | print("-",weight) 48 | 49 | 50 | g = Graph(5) 51 | g.add_edge(0, 1, 8) 52 | g.add_edge(0, 2, 5) 53 | g.add_edge(1, 2, 9) 54 | g.add_edge(1, 3, 11) 55 | g.add_edge(2, 3, 15) 56 | g.add_edge(2, 4, 10) 57 | g.add_edge(3, 4, 7) 58 | g.kruskal() 59 | -------------------------------------------------------------------------------- /Largest_value.java: -------------------------------------------------------------------------------- 1 | package com.company; 2 | 3 | import java.util.Scanner; 4 | 5 | public class Largest_value { 6 | public static void main(String[] args) 7 | { 8 | int a,b; 9 | Scanner op = new Scanner(System.in); 10 | System.out.println("Please enter two numbers:"); 11 | a = op.nextInt(); 12 | b = op.nextInt(); 13 | if(a>b){ 14 | System.out.println("the largest number is: " +a ); 15 | } 16 | if(a 4 | #include 5 | 6 | using namespace std; 7 | 8 | int searching(vector vec, int target) 9 | { 10 | for(int i = 0 ; i < vec.size() ; i++) 11 | { 12 | if (vec[i] == target) 13 | return i; 14 | } 15 | 16 | return -1; 17 | } 18 | 19 | int main() 20 | { 21 | vector vec; 22 | int n, target, a; 23 | 24 | cout << "Enter the terms of array: " << endl; 25 | cin >> n; 26 | 27 | for(int i = 0 ; i> a; 29 | vec.push_back(a); 30 | } 31 | 32 | cout << "Enter the target element: " << endl; 33 | cin >> target; 34 | 35 | int result = searching(vec, target); 36 | 37 | cout << "Target is at index: " << result << endl; 38 | 39 | return 0; 40 | } 41 | -------------------------------------------------------------------------------- /LinearSearch.java: -------------------------------------------------------------------------------- 1 | package com.company; 2 | 3 | public class LinearSearch { 4 | /*public static void main(String[] args) { 5 | int[] nums ={23, 45, 1, 2, 8, 19, -3, 16, -11, 28}; 6 | int target = 19; 7 | int ans = linearSearch(nums,target); 8 | System.out.println(ans); 9 | } 10 | */ 11 | 12 | //search in the array : return the index of the item found 13 | //otherwise if item not found return -1 14 | 15 | static int linearSearch(int arr[], int target){ 16 | if(arr.length ==0){ 17 | return -1; 18 | } 19 | 20 | // run a for loop 21 | for(int index =0; index< arr.length; index++){ 22 | //check for element at every index if it is equal to target 23 | int element = arr[index]; 24 | if(element == target){ 25 | return index; 26 | } 27 | } 28 | // This line will execute if none of the return statements above have executed 29 | //Hence the target not found 30 | return -1; 31 | } 32 | 33 | // Even digits problem- 34 | public static void main(String[] args) { 35 | int[] nums = {12,345,2,6,7896}; 36 | System.out.println(findNumbers(nums)); 37 | System.out.println(digits(5678)); 38 | } 39 | 40 | static int findNumbers(int[] nums){ 41 | int count =0; 42 | for(int num:nums){ 43 | if(even(num)){ 44 | count++; 45 | } 46 | } 47 | return count; 48 | } 49 | 50 | // function to check whether a number contains even digits or not 51 | static boolean even(int num){ 52 | int numberOfDigits = digits(num); 53 | /* 54 | if(numberOfDigits % 2==0){ 55 | return true; 56 | ) 57 | return false; 58 | */ 59 | return numberOfDigits% 2==0; 60 | } 61 | 62 | // count number of digits( int num) 63 | static int digits(int num){ 64 | int count = 0; 65 | if(num <0){ 66 | num = num*-1; 67 | } 68 | if(num ==0){ 69 | return 1; 70 | } 71 | while(num>0){ 72 | count++; 73 | num /= 10; 74 | } 75 | return count; 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /Linked_list_detection_of_cycle.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | typedef long long ll; 4 | 5 | class node { 6 | public: 7 | int data; 8 | node* next; 9 | node(int val) { 10 | data = val; 11 | next = NULL; 12 | } 13 | }; 14 | 15 | //Insert a element in the last of linked list 16 | void insertAtTail(node* &head, int val) { 17 | node* n = new node(val); 18 | if (head == NULL) { 19 | head = n; 20 | return; 21 | } 22 | node* temp = head; 23 | while (temp->next != NULL) { 24 | temp = temp->next; 25 | } 26 | temp->next = n; 27 | } 28 | 29 | //Display linked list 30 | void display(node* head) { 31 | node* temp = head; 32 | while (temp != NULL) { 33 | cout << temp->data << "->"; 34 | temp = temp->next; 35 | } 36 | cout << "NULL" << endl; 37 | } 38 | 39 | // Making a cycle in linked list 40 | void makecycle(node* &head, int pos) 41 | { 42 | node* temp = head; 43 | node* startNode; 44 | 45 | int count =1; 46 | while(temp->next != NULL){ 47 | if(count==pos){ 48 | startNode = temp; 49 | } 50 | temp = temp->next; 51 | count++; 52 | } 53 | 54 | temp->next = startNode; 55 | } 56 | 57 | //Find the linked list cycle is not? 58 | bool detectedcycle(node* &head){ 59 | node* slow = head; 60 | node* fast = head; 61 | 62 | while(fast != NULL && fast->next != NULL) 63 | { 64 | slow = slow->next; 65 | fast = fast->next->next; 66 | if(slow==fast){ 67 | return true; 68 | } 69 | } 70 | return false; 71 | } 72 | 73 | //Remove the cycle from linked list 74 | void removecycle(node* head) 75 | { 76 | node* slow = head; 77 | node* fast = head; 78 | 79 | do{ 80 | slow = slow->next; 81 | fast = fast->next->next; 82 | }while(slow!=fast); 83 | 84 | fast = head; 85 | while(fast->next != slow->next) 86 | { 87 | slow = slow->next; 88 | fast = fast->next; 89 | } 90 | 91 | slow->next = NULL; 92 | } 93 | 94 | int main() 95 | { 96 | node* head = NULL; 97 | insertAtTail(head, 1); 98 | display(head); 99 | insertAtTail(head, 2); 100 | display(head); 101 | insertAtTail(head, 3); 102 | display(head); 103 | insertAtTail(head, 4); 104 | display(head); 105 | insertAtTail(head, 5); 106 | display(head); 107 | insertAtTail(head, 6); 108 | display(head); 109 | 110 | makecycle(head,3); 111 | // display(head); 112 | cout< 4 | using namespace std; 5 | 6 | // Matrix Ai has dimension p[i-1] x p[i] 7 | // for i = 1..n 8 | int MatrixChainOrder(int p[], int i, int j) 9 | { 10 | if (i == j) 11 | return 0; 12 | int k; 13 | int min = INT_MAX; 14 | int count; 15 | 16 | // place parenthesis at different places 17 | // between first and last matrix, recursively 18 | // calculate count of multiplications for 19 | // each parenthesis placement and return the 20 | // minimum count 21 | for (k = i; k < j; k++) 22 | { 23 | count = MatrixChainOrder(p, i, k) 24 | + MatrixChainOrder(p, k + 1, j) 25 | + p[i - 1] * p[k] * p[j]; 26 | 27 | if (count < min) 28 | min = count; 29 | } 30 | 31 | // Return minimum count 32 | return min; 33 | } 34 | 35 | // Driver Code 36 | int main() 37 | { 38 | int arr[] = { 1, 2, 3, 4, 3 }; 39 | int n = sizeof(arr) / sizeof(arr[0]); 40 | 41 | cout << "Minimum number of multiplications is " 42 | << MatrixChainOrder(arr, 1, n - 1); 43 | } 44 | 45 | // This code is contributed by Shivi_Aggarwal 46 | -------------------------------------------------------------------------------- /Matrix Multiplication.java: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | // Other imports go here, Do NOT change the class name 3 | class Main 4 | { 5 | public static void main(String[] args) 6 | { 7 | 8 | Scanner obj=new Scanner(System.in); 9 | int t=obj.nextInt(); 10 | for(int s=0;smaxVal){ 14 | maxVal = arr[i]; 15 | } 16 | } 17 | return maxVal; 18 | } 19 | 20 | 21 | 22 | 23 | } 24 | -------------------------------------------------------------------------------- /Maximum_Subarray_Sum.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main(){ 5 | int n; 6 | cin>>n; 7 | 8 | int a[n]; 9 | for(int i=0; i>a[i]; 11 | 12 | int currsum[n+1]; 13 | currsum[0]=0; 14 | for(int i=1; i<=n; i++){ 15 | currsum[i] = currsum[i-1] + a[i-1]; 16 | } 17 | 18 | int maxsum = INT_MIN; 19 | for(int i=1; i<=n; i++){ 20 | int sum=0; 21 | for(int j=0; j arr[mid]) { 42 | end = mid - 1; 43 | } else { 44 | start = mid + 1; 45 | } 46 | } 47 | } 48 | return -1; 49 | } 50 | } 51 | 52 | // Output 53 | 54 | // Enter the target element : 10 55 | // -1 (not found) 56 | 57 | // Enter the target element : 98 58 | // 1 (found at index 1) 59 | 60 | // Contributed by Abhishek Bhatt : @AbhishekBhatt072003 61 | -------------------------------------------------------------------------------- /Print upper and lower triangle of a matrix.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main(){ 5 | int n; 6 | cin>>n; 7 | int arr[n][n]; 8 | for(int i=0;i>arr[i][j]; 11 | } 12 | } 13 | 14 | for(int i=0;ii){ 17 | 18 | cout<i){ 29 | 30 | cout< 2 | #include 3 | 4 | using namespace std; 5 | 6 | 7 | // Partition func tries to put pivot element at its correct position. 8 | int partition(vector&arr,int s,int e){ 9 | 10 | int pivot=arr[e]; // taking last element as pivot 11 | int i=s-1; 12 | 13 | for(int j=s;j&arr,int s,int e){ 27 | // Base case 28 | if(s>=e){ 29 | // then no or one elements 30 | return; 31 | } 32 | // Recursive case 33 | int p=partition(arr,s,e); // let p be the pivot element 34 | quickSort(arr,s,p-1); 35 | quickSort(arr,p+1,e); 36 | 37 | } 38 | 39 | int main(){ 40 | 41 | int n;cin>>n; 42 | vectorarr(n); 43 | for(int i=0;i>arr[i]; 45 | } 46 | 47 | quickSort(arr,0,(n-1)); 48 | 49 | for(int i=0;i 4 | using namespace std; 5 | 6 | // d is the number of characters in the input alphabet 7 | #define d 256 8 | 9 | /* pat -> pattern 10 | txt -> text 11 | q -> A prime number 12 | */ 13 | void search(char pat[], char txt[], int q) 14 | { 15 | int M = strlen(pat); 16 | int N = strlen(txt); 17 | int i, j; 18 | int p = 0; // hash value for pattern 19 | int t = 0; // hash value for txt 20 | int h = 1; 21 | 22 | // The value of h would be "pow(d, M-1)%q" 23 | for (i = 0; i < M - 1; i++) 24 | h = (h * d) % q; 25 | 26 | // Calculate the hash value of pattern and first 27 | // window of text 28 | for (i = 0; i < M; i++) 29 | { 30 | p = (d * p + pat[i]) % q; 31 | t = (d * t + txt[i]) % q; 32 | } 33 | 34 | // Slide the pattern over text one by one 35 | for (i = 0; i <= N - M; i++) 36 | { 37 | 38 | // Check the hash values of current window of text 39 | // and pattern. If the hash values match then only 40 | // check for characters one by one 41 | if ( p == t ) 42 | { 43 | bool flag = true; 44 | /* Check for characters one by one */ 45 | for (j = 0; j < M; j++) 46 | { 47 | if (txt[i+j] != pat[j]) 48 | { 49 | flag = false; 50 | break; 51 | } 52 | if(flag) 53 | cout< mx) 13 | mx = arr[i]; 14 | return mx; 15 | } 16 | 17 | static void countSort(int arr[], int n, int exp) 18 | { 19 | int output[] = new int[n]; // output array 20 | int i; 21 | int count[] = new int[10]; 22 | Arrays.fill(count, 0); 23 | 24 | // Store count of occurrences in count[] 25 | for (i = 0; i < n; i++) 26 | count[(arr[i] / exp) % 10]++; 27 | 28 | // Change count[i] so that count[i] now contains 29 | // actual position of this digit in output[] 30 | for (i = 1; i < 10; i++) 31 | count[i] += count[i - 1]; 32 | 33 | // Build the output array 34 | for (i = n - 1; i >= 0; i--) { 35 | output[count[(arr[i] / exp) % 10] - 1] = arr[i]; 36 | count[(arr[i] / exp) % 10]--; 37 | } 38 | 39 | // Copy the output array to arr[], so that arr[] now 40 | // contains sorted numbers according to current digit 41 | for (i = 0; i < n; i++) 42 | arr[i] = output[i]; 43 | } 44 | 45 | // The main function to that sorts arr[] of size n using 46 | // Radix Sort 47 | static void radixsort(int arr[], int n) 48 | { 49 | // Find the maximum number to know number of digits 50 | int m = getMax(arr, n); 51 | 52 | // Do counting sort for every digit. Note that 53 | // instead of passing digit number, exp is passed. 54 | // exp is 10^i where i is current digit number 55 | for (int exp = 1; m / exp > 0; exp *= 10) 56 | countSort(arr, n, exp); 57 | } 58 | 59 | // A utility function to print an array 60 | static void print(int arr[], int n) 61 | { 62 | for (int i = 0; i < n; i++) 63 | System.out.print(arr[i] + " "); 64 | } 65 | 66 | /*Driver Code*/ 67 | public static void main(String[] args) 68 | { 69 | int arr[] = { 170, 45, 75, 90, 802, 24, 2, 66 }; 70 | int n = arr.length; 71 | 72 | // Function Call 73 | radixsort(arr, n); 74 | print(arr, n); 75 | } 76 | } 77 | 78 | -------------------------------------------------------------------------------- /Singleinheritance. Java: -------------------------------------------------------------------------------- 1 | class A 2 | { 3 | public void methodA() 4 | { 5 | System.out.println("Base class method"); 6 | } 7 | } 8 | 9 | class SingleInherit extends A 10 | { 11 | public void methodB() 12 | { 13 | System.out.println("Child class method"); 14 | } 15 | public static void main(String args[]) 16 | { 17 | SingleInherit obj = new SingleInherit(); 18 | obj.methodA(); 19 | obj.methodB(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /SpaceShooterGame.py/background-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/SpaceShooterGame.py/background-black.png -------------------------------------------------------------------------------- /SpaceShooterGame.py/explosion.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/SpaceShooterGame.py/explosion.wav -------------------------------------------------------------------------------- /SpaceShooterGame.py/invaderkilled.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/SpaceShooterGame.py/invaderkilled.wav -------------------------------------------------------------------------------- /SpaceShooterGame.py/pixel_laser_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/SpaceShooterGame.py/pixel_laser_blue.png -------------------------------------------------------------------------------- /SpaceShooterGame.py/pixel_laser_green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/SpaceShooterGame.py/pixel_laser_green.png -------------------------------------------------------------------------------- /SpaceShooterGame.py/pixel_laser_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/SpaceShooterGame.py/pixel_laser_red.png -------------------------------------------------------------------------------- /SpaceShooterGame.py/pixel_laser_yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/SpaceShooterGame.py/pixel_laser_yellow.png -------------------------------------------------------------------------------- /SpaceShooterGame.py/pixel_ship_blue_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/SpaceShooterGame.py/pixel_ship_blue_small.png -------------------------------------------------------------------------------- /SpaceShooterGame.py/pixel_ship_green_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/SpaceShooterGame.py/pixel_ship_green_small.png -------------------------------------------------------------------------------- /SpaceShooterGame.py/pixel_ship_red_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/SpaceShooterGame.py/pixel_ship_red_small.png -------------------------------------------------------------------------------- /SpaceShooterGame.py/pixel_ship_yellow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/SpaceShooterGame.py/pixel_ship_yellow.png -------------------------------------------------------------------------------- /SpaceShooterGame.py/shoot.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/SpaceShooterGame.py/shoot.wav -------------------------------------------------------------------------------- /Speed_Test.py: -------------------------------------------------------------------------------- 1 | import speedtest # pip install speedtest-cli 2 | import time 3 | s = speedtest.Speedtest() 4 | 5 | print("Loading Servers") 6 | s.get_servers() # Getting the servers 7 | 8 | print("Connecting to the Best Server") 9 | bestServer = s.get_best_server() # Choosing the best server 10 | print(f"Connected to {bestServer['host']} located in {bestServer['country']} ") 11 | time.sleep(1) 12 | 13 | print("Starting Speed Test...") 14 | time.sleep(2) 15 | 16 | print("Pinging The Server...") 17 | ping = s.results.ping # Ping the server 18 | time.sleep(1) 19 | 20 | print("Downloading...") 21 | download = s.download() # Download test 22 | time.sleep(1) 23 | 24 | print("Uploading...") 25 | upload = s.upload() # Upload test 26 | time.sleep(1) 27 | 28 | def border_msg(msg): # For the border message 29 | row = len(msg) 30 | print(row) 31 | h = ''.join(['+'] + ['-' *row] + ['+']) 32 | result = h + '\n'"|"+msg+"|"'\n' + h 33 | print(result) 34 | 35 | print("*************RESULTS*************") 36 | border_msg(f"Ping: {ping:.2f} ms") 37 | border_msg(f"Download Speed: {download /1024/1024:.2f} Mbit/s") 38 | border_msg(f"Upload Speed: {upload /1024/1024:.2f} Mbit/s") 39 | print("************THANKYOU************") -------------------------------------------------------------------------------- /Static1.java: -------------------------------------------------------------------------------- 1 | package com.company; 2 | 3 | class Class1 { 4 | // Static variable 5 | static int a = 3; 6 | final static int b = 4; 7 | // Static constant 8 | static final int c = 5; 9 | // Static function 10 | static void fun() { System.out.println("Welcome to java!"); } 11 | } 12 | public class Static1 { 13 | public static void main(String args[]) { 14 | System.out.println(Class1.a); 15 | System.out.println(Class1.b); 16 | System.out.println(Class1.c); 17 | Class1.fun(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Static2.java: -------------------------------------------------------------------------------- 1 | package com.company; 2 | 3 | import javax.swing.*; 4 | 5 | public class Static2 { 6 | public static void main(String[] args) { 7 | JOptionPane.showMessageDialog(null, "Welcome to java!"); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Static3.java: -------------------------------------------------------------------------------- 1 | package com.company; 2 | 3 | import javax.swing.*; 4 | 5 | public class Static3 { 6 | public static void main(String[] args) { 7 | String name = JOptionPane.showInputDialog(null, "Please enter your name: "); 8 | JOptionPane.showMessageDialog(null, "Welcome " + name); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Static4.java: -------------------------------------------------------------------------------- 1 | package com.company; 2 | 3 | import javax.swing.*; 4 | 5 | public class Static4 { 6 | public static void main(String[] args) { 7 | // Addition of two number 8 | String s1, s2; 9 | s1 = JOptionPane.showInputDialog(null, "Enter first number: "); 10 | s2 = JOptionPane.showInputDialog(null, "Enter second number: "); 11 | 12 | // Convert it into int 13 | int a = Integer.parseInt(s1); 14 | int b = Integer.parseInt(s2); 15 | 16 | // Taking sum of Integer 17 | int sum = a + b; 18 | 19 | JOptionPane.showMessageDialog(null, "Addition of " + a + " and " + b + 20 | " is " + sum); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Stone-paper-scissor-game.py: -------------------------------------------------------------------------------- 1 | import random 2 | b='y' 3 | 4 | while(b=='y'): 5 | def gamewin(comp,you): 6 | if comp==you: 7 | return None 8 | elif comp== 'st': 9 | if you== 'p': 10 | return True 11 | else: 12 | return False 13 | elif comp== 'p': 14 | if you== 'sc': 15 | return True 16 | else: 17 | return False 18 | else: 19 | if you== 'st': 20 | return True 21 | else: 22 | return False 23 | 24 | 25 | print("Computer's turn: Stone(st), Paper(p), Scissor(sc)") 26 | randon=random.randint(1,3) 27 | if randon==1: 28 | comp='st' 29 | elif randon==2: 30 | comp='p' 31 | else: 32 | comp='sc' 33 | 34 | 35 | you = input("Your Turn: Stone(st), Paper(p), Scissor(sc)") 36 | 37 | print("Computer chose: " +comp) 38 | print("You chose: "+you) 39 | 40 | a=gamewin(comp,you) 41 | 42 | if a==None: 43 | print("Match is draw!!:)") 44 | elif a==True: 45 | print("Hurray!! You win!!:D") 46 | else: 47 | print("Alas!You lose:(") 48 | 49 | b=input("Do you want to play again(y/n)") 50 | if(b=='n'): 51 | print("Thanks for playing :D") 52 | 'break' 53 | 54 | -------------------------------------------------------------------------------- /SumOfTwoNumbers.java: -------------------------------------------------------------------------------- 1 | package com.company; 2 | 3 | //main class 4 | public class SumOfTwoNumbers { 5 | 6 | 7 | //main function 8 | public static void main(String[] args) { 9 | int a =30; 10 | int b = 20; 11 | int sum = a + b; 12 | System.out.println("Addition of " +a+ " And " +b+ " is " +sum); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /SwapWithTemp.java: -------------------------------------------------------------------------------- 1 | package com.company; 2 | 3 | import java.util.Scanner; 4 | 5 | public class SwapWithTemp { 6 | public static void main(String[] args) { 7 | Scanner in = new Scanner(System.in); 8 | System.out.println("Please enter first number: "); 9 | int num1 = in.nextInt(); 10 | System.out.println("Please enter second number: "); 11 | int num2 = in.nextInt(); 12 | int temp = 0; 13 | temp = num1; 14 | num1 = num2; 15 | num2 = temp; 16 | System.out.println("After swapping first number is: " + num1); 17 | System.out.println("After swapping second number is: " + num2); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /SwapWithoutTemp.java: -------------------------------------------------------------------------------- 1 | package com.company; 2 | 3 | import java.util.Scanner; 4 | 5 | public class SwapWithoutTemp { 6 | public static void main(String[] args) { 7 | Scanner in = new Scanner(System.in); 8 | System.out.println("Please enter first number: "); 9 | int a = in.nextInt(); 10 | System.out.println("Please enter second number: "); 11 | int b = in.nextInt(); 12 | a = a + b; 13 | b = a - b; 14 | a = a - b; 15 | System.out.println("After swapping first number is: " + a); 16 | System.out.println("After swapping second number is: " + b); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Transpose of Matrix.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | int main() 5 | { 6 | int n, m; 7 | cin >> n >> m; 8 | int arr[3][3] = {{1,2,3},{4,5,6},{7,8,9}}; 9 | 10 | 11 | 12 | for (int i = 0; i < n; i++) 13 | { 14 | for (int j = 0; j <=i; j++) 15 | { 16 | swap(arr[i][j],arr[j][i]); 17 | } 18 | } 19 | 20 | for (int i = 0; i < n; i++) 21 | { 22 | for (int j = 0; j < m; j++) 23 | { 24 | cout << arr[i][j] << " "; 25 | } 26 | cout << endl; 27 | } 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /ValidTraingle.java: -------------------------------------------------------------------------------- 1 | package com.company; 2 | 3 | import java.util.Scanner; 4 | 5 | public class ValidTraingle { 6 | public static void main(String[] args) { 7 | Scanner in = new Scanner(System.in); 8 | System.out.println("Enter Three Site of Triangle: "); 9 | double a = in.nextDouble(); 10 | double b = in.nextDouble(); 11 | double c = in.nextDouble(); 12 | if(a+b>c && a+c>b && b+c>a){ 13 | System.out.println("Valid Triangle."); 14 | }else{ 15 | System.out.println("Invalid Triangle."); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Vocabluary/animal.js: -------------------------------------------------------------------------------- 1 | let questions = document.querySelectorAll(".name"), 2 | i; 3 | function pronus (n) 4 | { 5 | for(i=0;i< allAnimals.length;i++) 6 | { 7 | if( n== allAnimals[i].id) 8 | { 9 | document.getElementById("mysong").src=allAnimals[i].source; 10 | var mysong = document.getElementById("mysong"); 11 | mysong.play(); 12 | // document.getElementById("name").innerHTML=allFruits[i].name; 13 | questions[i].innerHTML = allAnimals[i].name; 14 | } 15 | } 16 | 17 | 18 | } -------------------------------------------------------------------------------- /Vocabluary/animals.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/Vocabluary/animals.jpg -------------------------------------------------------------------------------- /Vocabluary/baboon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/Vocabluary/baboon.png -------------------------------------------------------------------------------- /Vocabluary/bear.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/Vocabluary/bear.png -------------------------------------------------------------------------------- /Vocabluary/black-cat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/Vocabluary/black-cat.png -------------------------------------------------------------------------------- /Vocabluary/camel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/Vocabluary/camel.png -------------------------------------------------------------------------------- /Vocabluary/crocodile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/Vocabluary/crocodile.png -------------------------------------------------------------------------------- /Vocabluary/deer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/Vocabluary/deer.png -------------------------------------------------------------------------------- /Vocabluary/dog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/Vocabluary/dog.png -------------------------------------------------------------------------------- /Vocabluary/elephant.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/Vocabluary/elephant.png -------------------------------------------------------------------------------- /Vocabluary/fox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/Vocabluary/fox.png -------------------------------------------------------------------------------- /Vocabluary/frog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/Vocabluary/frog.png -------------------------------------------------------------------------------- /Vocabluary/fruits.css: -------------------------------------------------------------------------------- 1 | @import url("https://fonts.googleapis.com/css2?family=Poppins:wght@200;300;400;500;600;700&display=swap"); 2 | 3 | * { 4 | margin: 0; 5 | padding: 0; 6 | font-family: "Poppins", sans-serif; 7 | box-sizing: border-box; 8 | text-decoration: none; 9 | 10 | } 11 | .body{ 12 | width: 100%; 13 | overflow: hidden; 14 | } 15 | 16 | 17 | /*images*/ 18 | .all-img{ 19 | margin-top: 100px; 20 | display:inline-block; 21 | margin-left: 380px; 22 | margin-right: 180px; 23 | } 24 | 25 | .images-content{ 26 | display:inline-block; 27 | margin: 0 30px; 28 | text-align: center; 29 | cursor: pointer; 30 | flex-direction: column; 31 | position: relative; 32 | z-index: 0; 33 | transition: 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55); 34 | margin-bottom: 30px; 35 | 36 | } 37 | 38 | .image{ 39 | height: 100px; 40 | width: 100px; 41 | margin-top: 30px; 42 | } 43 | 44 | .image:hover{ 45 | opacity: 0.8; 46 | width:110px ; 47 | height: 110px; 48 | } 49 | 50 | /*cursor*/ 51 | .images-content .tooltip{ 52 | position: absolute; 53 | top:10px; 54 | z-index: 1; 55 | background: #fff; 56 | color: black; 57 | padding: 5px 8px; 58 | font-size: 20px; 59 | font-weight: 500; 60 | border-radius: 25px; 61 | opacity: 0; 62 | pointer-events: none; 63 | box-shadow: 0px 10px 10px rgba(0,0,0,0.1); 64 | transition: 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55); 65 | margin-bottom: 0px; 66 | } 67 | 68 | .images-content:hover .tooltip{ 69 | top:-10px; 70 | opacity: 1; 71 | pointer-events: auto; 72 | } 73 | 74 | .tooltip:before{ 75 | position: absolute; 76 | content: ""; 77 | height: 15px; 78 | width: 15px; 79 | background: #fff; 80 | left: 50%; 81 | bottom: -6px; 82 | transform: translateX(-50%) rotate(45deg); 83 | transition: 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55); 84 | } 85 | 86 | 87 | /*responsive*/ 88 | @media screen and (max-width: 1200px) { 89 | 90 | 91 | /*images*/ 92 | .all-img{ 93 | margin-left: 170px; 94 | margin-right: 170px; 95 | } 96 | } 97 | 98 | @media screen and (max-width: 992px) { 99 | 100 | /*images*/ 101 | .all-img{ 102 | margin-left: 80px; 103 | margin-right: 80px; 104 | } 105 | } 106 | 107 | 108 | /*reponsive end*/ 109 | 110 | 111 | -------------------------------------------------------------------------------- /Vocabluary/lion.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/Vocabluary/lion.png -------------------------------------------------------------------------------- /Vocabluary/rhinoceros.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/Vocabluary/rhinoceros.png -------------------------------------------------------------------------------- /Vocabluary/sheep.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/Vocabluary/sheep.png -------------------------------------------------------------------------------- /Vocabluary/squirel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/Vocabluary/squirel.png -------------------------------------------------------------------------------- /Vocabluary/tiger.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/Vocabluary/tiger.png -------------------------------------------------------------------------------- /Vocabs/Capsicums.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/Vocabs/Capsicums.png -------------------------------------------------------------------------------- /Vocabs/asparagus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/Vocabs/asparagus.png -------------------------------------------------------------------------------- /Vocabs/beetroot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/Vocabs/beetroot.png -------------------------------------------------------------------------------- /Vocabs/broccoli.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/Vocabs/broccoli.png -------------------------------------------------------------------------------- /Vocabs/cabbage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/Vocabs/cabbage.png -------------------------------------------------------------------------------- /Vocabs/carrot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/Vocabs/carrot.png -------------------------------------------------------------------------------- /Vocabs/corn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/Vocabs/corn.png -------------------------------------------------------------------------------- /Vocabs/cucumber.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/Vocabs/cucumber.png -------------------------------------------------------------------------------- /Vocabs/eggplant.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/Vocabs/eggplant.png -------------------------------------------------------------------------------- /Vocabs/garlic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/Vocabs/garlic.png -------------------------------------------------------------------------------- /Vocabs/ginger.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/Vocabs/ginger.png -------------------------------------------------------------------------------- /Vocabs/mushroom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/Vocabs/mushroom.png -------------------------------------------------------------------------------- /Vocabs/onion.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/Vocabs/onion.png -------------------------------------------------------------------------------- /Vocabs/pumpkin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/Vocabs/pumpkin.png -------------------------------------------------------------------------------- /Vocabs/soy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/Vocabs/soy.png -------------------------------------------------------------------------------- /Vocabs/vegetable.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/Vocabs/vegetable.jpg -------------------------------------------------------------------------------- /Vocabs/vegetable.js: -------------------------------------------------------------------------------- 1 | let questions = document.querySelectorAll(".name"), 2 | i; 3 | function pronus (n) 4 | { 5 | for(i=0;i< allVegetables.length;i++) 6 | { 7 | if( n== allVegetables[i].id) 8 | { 9 | document.getElementById("mysong").src=allVegetables[i].source; 10 | var mysong = document.getElementById("mysong"); 11 | mysong.play(); 12 | // document.getElementById("name").innerHTML=allFruits[i].name; 13 | questions[i].innerHTML = allVegetables[i].name; 14 | } 15 | } 16 | 17 | 18 | } -------------------------------------------------------------------------------- /Wave_Sort.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | void WaveSort(int arr[], int n){ 5 | for(int i=1; i arr[i-1]) 8 | swap(arr[i], arr[i-1]); 9 | 10 | if((arr[i] > arr[i+1]) && (i <= n-2)) 11 | swap(arr[i], arr[i+1]); 12 | } 13 | } 14 | 15 | int main(){ 16 | int n; 17 | cout<<"Enter N: "; 18 | cin>>n; 19 | 20 | int arr[n]; 21 | cout<<"Enter Elements of Array: "; 22 | for(int i=0; i>arr[i]; 24 | 25 | WaveSort(arr, n); 26 | 27 | cout<<"Sorted Array :: \n"; 28 | for(int i=0; i stack = new ArrayDeque(); 10 | for (int i = 0; i < expr.length(); i++) 11 | { 12 | char x = expr.charAt(i); 13 | 14 | if (x == '(' || x == '[' || x == '{') 15 | { 16 | stack.push(x); 17 | continue; 18 | } 19 | if (stack.isEmpty()) 20 | return false; 21 | char check; 22 | switch (x) { 23 | case ')': 24 | check = stack.pop(); 25 | if (check == '{' || check == '[') 26 | return false; 27 | break; 28 | 29 | case '}': 30 | check = stack.pop(); 31 | if (check == '(' || check == '[') 32 | return false; 33 | break; 34 | 35 | case ']': 36 | check = stack.pop(); 37 | if (check == '(' || check == '{') 38 | return false; 39 | break; 40 | } 41 | } 42 | return (stack.isEmpty()); 43 | } 44 | 45 | public static void main(String[] args) 46 | { 47 | String expr = "([{}])"; 48 | if (areBracketsBalanced(expr)) 49 | System.out.println("Balanced "); 50 | else 51 | System.out.println("Not Balanced "); 52 | } 53 | } 54 | 55 | -------------------------------------------------------------------------------- /binary_Search.dart: -------------------------------------------------------------------------------- 1 | int binary_search(List a, int l, int r, int x) { 2 | if (r >= l) { 3 | int middle = (l + (r - l) / 2).toInt(); 4 | 5 | //If the element is present at middle 6 | if (a[middle] == x) { 7 | return middle; 8 | } 9 | 10 | //If the element is smaller than middle 11 | if (a[middle] > x) { 12 | return binary_search(a, l, middle - 1, x); 13 | } 14 | 15 | return binary_search(a, middle + 1, r, x); 16 | } 17 | return -1; 18 | } 19 | 20 | void main() { 21 | List list = [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]; 22 | int x = 55; 23 | int n = list.length; 24 | int index = binary_search(list, 0, n - 1, x); 25 | print('list:'); 26 | print(list); 27 | if (index != -1) { 28 | print('$x found at positions: $index'); 29 | } else { 30 | print('$x Not found'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /binary_search_recursion.dart: -------------------------------------------------------------------------------- 1 | /* Driver */ 2 | void main() { 3 | List list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; 4 | 5 | int low = 0; 6 | int high = list.length - 1; 7 | 8 | assert(binarySearch(list, low, high, 5) == 5); 9 | assert(binarySearch(list, low, high, 9) == 9); 10 | assert(binarySearch(list, low, high, 66) == -1); 11 | } 12 | 13 | /** 14 | * Return the index of [key] value in [list] 15 | */ 16 | int binarySearch(List list, int low, int high, int key) { 17 | if (low > high) { 18 | return -1; /* not found */ 19 | } 20 | int mid = (low + high) >> 1; 21 | if (key == list[mid]) { 22 | return mid; /* found */ 23 | } else if (key > list[mid]) { 24 | return binarySearch( 25 | list, mid + 1, high, key); /* search in range[mid + 1, high] */ 26 | } else { 27 | return binarySearch( 28 | list, low, mid - 1, key); /* search in range[low, mid - 1] */ 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /check_armstrong.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | int main() 4 | { 5 | int n, r, sum = 0, temp; 6 | cout << "Enter the Number= "; 7 | cin >> n; 8 | temp = n; 9 | while (n > 0) 10 | { 11 | r = n % 10; 12 | sum = sum + (r * r * r); 13 | n = n / 10; 14 | } 15 | if (temp == sum) 16 | cout << "Armstrong Number." << endl; 17 | else 18 | cout << "Not Armstrong Number." << endl; 19 | return 0; 20 | } -------------------------------------------------------------------------------- /combination_sum.cpp: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | vector> ans; 4 | 5 | void allc(vector& cd,vector& cur,int st,int tg){ 6 | if(tg<0)return; 7 | if(tg==0){ans.push_back(cur);return;} 8 | for(int i = st ; i> combinationSum(vector& cd, int tg) { 15 | vector cur; 16 | allc(cd,cur,0,tg); 17 | return ans; 18 | } 19 | }; 20 | -------------------------------------------------------------------------------- /detectLoop.java: -------------------------------------------------------------------------------- 1 | // Java program to detect loop in a linked list 2 | 3 | package DSA; 4 | import java.util.*; 5 | 6 | public class detectLoop { 7 | static class Node 8 | { 9 | int data; 10 | Node next; 11 | int flag; 12 | }; 13 | static Node push(Node head_ref, int new_data) 14 | { 15 | Node new_node = new Node(); 16 | new_node.data = new_data; 17 | new_node.flag = 0; 18 | new_node.next = head_ref; 19 | head_ref = new_node; 20 | return head_ref; 21 | } 22 | 23 | static boolean detectLoop(Node h) 24 | { 25 | while (h != null) 26 | { 27 | if (h.flag == 1) 28 | return true; 29 | h.flag = 1; 30 | h = h.next; 31 | } 32 | return false; 33 | } 34 | public static void main(String[] args) 35 | { 36 | Node head = null; 37 | 38 | head = push(head, 20); 39 | head = push(head, 4); 40 | head = push(head, 15); 41 | head = push(head, 10); 42 | 43 | head.next.next.next.next = head; 44 | 45 | if (detectLoop(head)) 46 | System.out.print("Loop found"); 47 | else 48 | System.out.print("No Loop"); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /digit_frequency.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | int main() { 7 | 8 | 9 | char *s; 10 | s = malloc(1024*sizeof(char)); 11 | scanf("%s",s); 12 | 13 | 14 | int k; 15 | int *a = malloc(sizeof(int)*10); 16 | 17 | 18 | for(int i=0; i<10; i++) 19 | a[i] = 0; 20 | 21 | for(int i=0; i=0 && k<10) 25 | a[k]++; 26 | } 27 | for(int i=0; i<10; i++) 28 | { 29 | printf("%d ",a[i]); 30 | } 31 | return 0; 32 | } 33 | -------------------------------------------------------------------------------- /distance using lat and long.py: -------------------------------------------------------------------------------- 1 | from tkinter import * 2 | from math import * 3 | #----------------------------- 4 | 5 | def EquiRectDist(lat1,long1,lat2,long2): 6 | R=6371*(10**3)#radius of earth 7 | x=(long2-long1)*cos((lat1+lat2)/2) 8 | y=lat2-lat1 9 | d=sqrt((pow(x,2))+pow(y,2))*R 10 | return d 11 | 12 | def EquiRectDistDeg(lat1,long1,lat2,long2): 13 | return (EquiRectDist(radians(lat1),radians(long1),radians(lat2),radians(long2))) 14 | 15 | def calculate(): 16 | lat1=float(e1.get()) 17 | long1=float(e2.get()) 18 | lat2=float(e3.get()) 19 | long2=float(e4.get()) 20 | Z.set(EquiRectDistDeg(lat1,long1,lat2,long2)) 21 | 22 | 23 | 24 | 25 | 26 | #---------------------------- 27 | #Main Page 28 | #---------------------------- 29 | window=Tk() 30 | window.title("distance using latitude and longitutude") 31 | 32 | #30.516077 33 | #76.659649 34 | #48.814668 35 | #2.213897 36 | l1=Label(window,text="lat1:") 37 | l1.grid(row=0,column=0) 38 | 39 | l2=Label(window,text="long1:") 40 | l2.grid(row=1,column=0) 41 | 42 | l3=Label(window,text="lat2:") 43 | l3.grid(row=2,column=0) 44 | 45 | l4=Label(window,text="long2:") 46 | l4.grid(row=3,column=0) 47 | 48 | e1=Entry(window,bg="lightblue") 49 | e1.grid(row=0,column=1) 50 | 51 | e2=Entry(window,bg="lightgreen") 52 | e2.grid(row=1,column=1) 53 | 54 | e3=Entry(window,bg="orange") 55 | e3.grid(row=2,column=1) 56 | 57 | e4=Entry(window,bg="lightpink") 58 | e4.grid(row=3,column=1) 59 | 60 | b1=Button(window,text="Quit",command=quit) #in other terminal we use window.destroy() 61 | b1.grid(row=4,column=0) 62 | 63 | b2=Button(window,text="Calculate",command=calculate) 64 | b2.grid(row=4,column=2) 65 | 66 | Z=StringVar() 67 | l6=Label(window,textvariable=Z) 68 | l6.grid(row=5,column=1) 69 | 70 | -------------------------------------------------------------------------------- /doublylinklist.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | 4 | class Node 5 | { 6 | public: 7 | int data; 8 | Node *next; 9 | Node *prev; 10 | }; 11 | 12 | class DoublyLinkedList 13 | { 14 | public: 15 | 16 | DoublyLinkedList(); 17 | ~DoublyLinkedList(); 18 | 19 | void insertStart(int data); 20 | void insertEnd(int data); 21 | void insertAfter(int data, int position); 22 | void insertBefore(int data, int position); 23 | void remove(int position); 24 | void display(); 25 | 26 | private: 27 | Node *head; 28 | Node *tail; 29 | int size; 30 | }; 31 | 32 | DoublyLinkedList::DoublyLinkedList() 33 | { 34 | head = NULL; 35 | tail = NULL; 36 | size = 0; 37 | } 38 | 39 | DoublyLinkedList::~DoublyLinkedList() -------------------------------------------------------------------------------- /fibonacci_Search.dart: -------------------------------------------------------------------------------- 1 | 2 | int fibMaonaccianSearch(List arr, int x, int n) { 3 | //Initialize fibonacci numbers 4 | //(m - 2)'th Fibonacci No 5 | int fibMMm2 = 0; 6 | //(m - 2)'th Fibonacci No 7 | int fibMMm1 = 1; 8 | //m'th Fibonacci 9 | int fibM = fibMMm2 + fibMMm1; 10 | 11 | //fibM is going to store the smallest Fibonacci 12 | //Number greater than or equal to n 13 | while (fibM < n) { 14 | fibMMm2 = fibMMm1; 15 | fibMMm1 = fibM; 16 | fibM = fibMMm2 + fibMMm1; 17 | } 18 | 19 | // Marks the eliminated range from front 20 | int offset = -1; 21 | 22 | /*While three are elements to be inspected. 23 | * Note that we compare arr[fibMMm2] with x. 24 | * When fibM becomes 1, 25 | * fibMm2 becomes 0 */ 26 | while (fibM > 1) { 27 | //Check if fibMMm2 is a valid location 28 | 29 | //sets i to the min. of (offset + fibMMm2) and (n - 1) 30 | int i = ((offset + fibMMm2) < (n - 1)) ? (offset + fibMMm2) : (n - 1); 31 | 32 | /* If x is greater than the value at index fibMmm2 33 | * cut the subarray array from offset to i 34 | */ 35 | 36 | if (arr[i] < x) { 37 | fibM = fibMMm1; 38 | fibMMm1 = fibMMm2; 39 | fibMMm2 = fibM - fibMMm1; 40 | offset = i; 41 | } 42 | 43 | /* If x is greater than the value at index fibMmm2 44 | * cut the subarray array after i + 1. 45 | */ 46 | else if (arr[i] > x) { 47 | fibM = fibMMm2; 48 | fibMMm1 = fibMMm1 - fibMMm2; 49 | fibMMm2 = fibM - fibMMm1; 50 | } 51 | 52 | //elwment found.Return index 53 | else { 54 | return i; 55 | } 56 | } 57 | 58 | //Comparing the last element with x 59 | if (arr[offset + 1] == x) { 60 | return offset + 1; 61 | } 62 | 63 | //element not found :( 64 | return -1; 65 | } 66 | 67 | void main() { 68 | //Get the array 69 | var arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; 70 | 71 | var result; 72 | 73 | //Print the array 74 | print(arr); 75 | 76 | //The size of the array 77 | var n = arr.length; 78 | 79 | //Key to be searched in the array 80 | var key = 7; 81 | 82 | //Search the key using ternarySearch 83 | result = fibMaonaccianSearch(arr, key, n); 84 | 85 | //Print the result 86 | print("Index of " + key.toString() + " is " + result.toString()); 87 | } 88 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Sample Paint App 8 |

Simple Paint App

9 | 10 | 11 | 12 | 13 |
14 | Canvas is not supported in ur browser:) 15 | 16 |
17 | 20 |
21 |
22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | const express = require("express"); 2 | const mongoose = require("mongoose"); 3 | const blogRouter = require("./routes/blog") 4 | require("dotenv").config(); 5 | 6 | const localURL = "mongodb://localhost:27017/blog" 7 | 8 | mongoose 9 | .connect( 10 | localURL, 11 | { 12 | useNewUrlParser: true, 13 | useUnifiedTopology: true, 14 | } 15 | ) 16 | .then(() => console.log("conn succesful")) 17 | .catch((err) => console.log(err)); 18 | 19 | const app = express(); 20 | const methodOverride = require("method-override"); 21 | const path = require("path"); 22 | 23 | 24 | app.set("view engine", "ejs"); 25 | app.use("/blog",blogRouter) 26 | app.use(express.urlencoded({ extended: true })); 27 | app.use(methodOverride("_method")); 28 | app.use(express.static(path.join(__dirname, "/public"))); 29 | 30 | app.get("/", (req, res) => { 31 | res.send("Here "); 32 | }); 33 | 34 | app.get("/hey", (req, res) => { 35 | res.send("hey"); 36 | }); 37 | 38 | 39 | 40 | app.listen(process.env.PORT || 3000, () => { 41 | console.log("server is running at port 3000"); 42 | console.log("go to localhost:3000/blog"); 43 | }); 44 | -------------------------------------------------------------------------------- /insertion_at_end_singly_linked_list.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace std; 3 | struct node{ 4 | int data; 5 | struct node *ptr; 6 | }; 7 | struct node *head=NULL; 8 | 9 | //10->20->30 10 | void insert(int a){ 11 | node *temp=new node; 12 | temp->data=a; 13 | temp->ptr=NULL; 14 | if(head==NULL) 15 | head=temp; 16 | else{ 17 | node *temp1=head; 18 | while(temp1->ptr!=NULL) 19 | temp1=temp1->ptr; 20 | temp1->ptr=temp; 21 | } 22 | }; 23 | 24 | void display(){ 25 | if(head){ 26 | node *p=head; 27 | while(p!=NULL){ 28 | cout<<"Data is :"<data<ptr; 30 | } 31 | } 32 | else 33 | cout<<"Empty Linked List"; 34 | } 35 | 36 | int main(){ 37 | insert(10); 38 | insert(20); 39 | insert(30); 40 | insert(40); 41 | display(); 42 | return 0; 43 | } 44 | -------------------------------------------------------------------------------- /interpolation_Search.dart: -------------------------------------------------------------------------------- 1 | /* By comparison, binary search always chooses the middle of the remaining 2 | * search space, discarding one half or the other, depending on the comparison 3 | * between the key found at the estimated position and the key sought. The remaining 4 | * search space is reduced to the part before or after the estimated position. 5 | * The linear search uses equality only as it compares elements one-by-one from the start, ignoring any sorting. 6 | * On average the interpolation search makes about log(log(n)) comparisons (if the elements 7 | * are uniformly distributed), where n is the number of elements to be searched. In the worst case 8 | * (for instance where the numerical values of the keys increase exponentially) it can make up to O(n) comparisons. 9 | * In interpolation-sequential search, interpolation is used to find an item near the one being searched for, 10 | * then linear search is used to find the exact item. */ 11 | 12 | int interpolationSearch(List arr, int n, int key) { 13 | int low = 0, high = n - 1; 14 | while (low <= high && key >= arr[low] && key <= arr[high]) { 15 | /* Calculate the nearest possible position of key */ 16 | int pos = low + 17 | (((key - arr[low]) * (high - low)) / (arr[high] - arr[low])).round(); 18 | if (key > arr[pos]) 19 | low = pos + 1; 20 | else if (key < arr[pos]) 21 | high = pos - 1; 22 | else /* Found */ 23 | return pos; 24 | } 25 | /* Not found */ 26 | return -1; 27 | } 28 | 29 | int main() { 30 | //Get the arr 31 | List arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; 32 | //The size of the arr 33 | var n = arr.length; 34 | //The Key 35 | var key = 5; 36 | print("I want to found $key at $arr"); 37 | //Get the index 38 | var index = interpolationSearch(arr, n, key); 39 | //print the result 40 | print("Element found at position: $index"); 41 | return 0; 42 | } 43 | -------------------------------------------------------------------------------- /jump_Search.dart: -------------------------------------------------------------------------------- 1 | import 'dart:math' show sqrt; 2 | 3 | min(X, Y) { 4 | if (X < Y) { 5 | return X; 6 | } else { 7 | return Y; 8 | } 9 | } 10 | 11 | int jump_search(List a, int x) { 12 | int n = a.length; 13 | int step = sqrt(n).floor().toInt(); 14 | int prev = 0; 15 | while (a[min(step, n) - 1] < x) { 16 | prev = step; 17 | step += sqrt(n).floor().toInt(); 18 | if (prev >= n) { 19 | return -1; 20 | } 21 | } 22 | while (a[prev] < x) { 23 | prev = prev + 1; 24 | if (prev == min(step, n)) { 25 | return -1; 26 | } 27 | } 28 | if (a[prev] == x) { 29 | return prev; 30 | } 31 | return -1; 32 | } 33 | 34 | void main() { 35 | var list = [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]; 36 | var x = 55; 37 | var index = jump_search(list, x); 38 | print('list:'); 39 | print(list); 40 | print('Number ' + x.toString() + ' is at index ' + index.toString()); 41 | } 42 | -------------------------------------------------------------------------------- /largestrectangle.java: -------------------------------------------------------------------------------- 1 | import java.util.*; 2 | 3 | public class Main 4 | { 5 | 6 | public static int MaxArea(int arr[], int n) 7 | { 8 | 9 | Stack s = new Stack<>(); 10 | s.push(-1); 11 | int max = arr[0]; 12 | int left[] = new int[n]; 13 | int right[] = new int[n]; 14 | for (int i = 0; i < n; i++){ 15 | left[i] = -1; 16 | right[i] = n; 17 | } 18 | 19 | int i = 0; 20 | while (i < n) 21 | { 22 | while(!s.empty()&&s.peek()!=-1&&arr[i]0&&arr[i]==arr[(i-1)]){ 27 | left[i] = left[(int)(i-1)]; 28 | }else{ 29 | left[i] = s.peek(); 30 | } 31 | s.push(i); 32 | i++; 33 | } -------------------------------------------------------------------------------- /linear_Search.dart: -------------------------------------------------------------------------------- 1 | int linear_search(List a, number) { 2 | for (int i = 0; i < a.length; i++) { 3 | if (a[i] == number) { 4 | return i; 5 | } 6 | } 7 | return -1; 8 | } 9 | 10 | void main() { 11 | List list = [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89]; 12 | int x = 15; 13 | int index = linear_search(list, x); 14 | print('list:'); 15 | print(list); 16 | if (index != -1) { 17 | print('$x found at positions: $index'); 18 | } else { 19 | print('$x Not found'); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /models/blogData.js: -------------------------------------------------------------------------------- 1 | const mongoose = require("mongoose"); 2 | 3 | const blogSchema = new mongoose.Schema({ 4 | 5 | title:String, 6 | image: String, 7 | author: String, 8 | content: String, 9 | comments: [ 10 | { 11 | type:mongoose.Schema.Types.ObjectId, 12 | ref:'Comments' 13 | } 14 | ] 15 | 16 | }); 17 | 18 | module.exports = mongoose.model('Blog',blogSchema) -------------------------------------------------------------------------------- /models/commentData.js: -------------------------------------------------------------------------------- 1 | const mongoose = require("mongoose") 2 | 3 | const commentSchema = new mongoose.Schema ({ 4 | title:String, 5 | comment:String, 6 | date:{ 7 | type: Date, 8 | default: Date.now 9 | }, 10 | 11 | }) 12 | 13 | const Comments = mongoose.model('Comments',commentSchema) 14 | 15 | module.exports = Comments; -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "rest-blog", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "start": "nodemon ./index.js" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "dotenv": "^9.0.0", 14 | "ejs": "^3.1.6", 15 | "express": "^4.17.1", 16 | "method-override": "^3.0.0", 17 | "mongoose": "^5.12.7", 18 | "nodemon": "^2.0.7" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /peak_element.dart: -------------------------------------------------------------------------------- 1 | import 'package:test/test.dart'; 2 | 3 | int findPeakUtil(List arr, int low, int high, int n) { 4 | var x = (low + high) / 2; 5 | int mid = x.toInt(); 6 | if ((mid == 0 || arr[mid - 1] <= arr[mid]) && 7 | (mid == n - 1 || arr[mid + 1] <= arr[mid])) 8 | return mid; 9 | else if (mid > 0 && arr[mid - 1] > arr[mid]) 10 | return findPeakUtil(arr, low, (mid - 1), n); 11 | else 12 | return findPeakUtil(arr, (mid + 1), high, n); 13 | } 14 | 15 | int findPeak(List arr, int n) { 16 | return findPeakUtil(arr, 0, n - 1, n); 17 | } 18 | 19 | void main() { 20 | test("findPeak returns 2 for [1, 3, 20, 6, 1, 2]", () { 21 | List lst = [1, 3, 20, 6, 1, 2]; 22 | expect(findPeak(lst, lst.length), equals(2)); 23 | }); 24 | 25 | test("findPeak returns 3 for [1, 3, 20, 32, 1, 2]", () { 26 | List lst = [1, 3, 20, 32, 1, 2]; 27 | expect(findPeak(lst, lst.length), equals(3)); 28 | }); 29 | 30 | test("findPeak returns 2 for [321, 4353, 22320, 232, 23, 223]", () { 31 | List lst = [321, 4353, 22320, 232, 23, 223]; 32 | expect(findPeak(lst, lst.length), equals(2)); 33 | }); 34 | 35 | test("findPeak returns 2 for [121, 54, 2100, 36, 155, 90]", () { 36 | List lst = [121, 54, 2100, 36, 155, 90]; 37 | expect(findPeak(lst, lst.length), equals(2)); 38 | }); 39 | 40 | test("findPeak returns 2 for [5, 10, 20, 15]", () { 41 | List lst = [5, 10, 20, 15]; 42 | expect(findPeak(lst, lst.length), equals(2)); 43 | }); 44 | 45 | test("findPeak returns 1 for [10, 20, 15, 2, 23, 90, 67]", () { 46 | List lst = [10, 20, 15, 2, 23, 90, 67]; 47 | expect(findPeak(lst, lst.length), equals(1)); 48 | }); 49 | } 50 | -------------------------------------------------------------------------------- /primeornot.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | main() { 4 | int n, i, c = 0; 5 | printf("Enter any number n:"); 6 | scanf("%d", &n); 7 | 8 | //logic 9 | for (i = 1; i <= n; i++) { 10 | if (n % i == 0) { 11 | c++; 12 | } 13 | } 14 | 15 | if (c == 2) { 16 | printf("n is a Prime number"); 17 | } 18 | else { 19 | printf("n is not a Prime number"); 20 | } 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /public/css/edit.css: -------------------------------------------------------------------------------- 1 | a:link{ 2 | text-decoration: none; 3 | } 4 | body{ 5 | background-color:rgba(0, 0, 0, 0.575); 6 | } 7 | 8 | #form-cont { 9 | width: 80vw; 10 | margin: 2vh auto; 11 | border: 2px solid black; 12 | padding: 5%; 13 | background-color: rgba(190, 190, 190, 0.904); 14 | } 15 | div { 16 | color: black; 17 | } 18 | .form-control{ 19 | background-color: rgba(109, 109, 106, 0.459); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /public/css/index.css: -------------------------------------------------------------------------------- 1 | body{ 2 | background-color:rgba(0, 0, 0, 0.575); 3 | } 4 | 5 | #blog { 6 | width: 80vw; 7 | 8 | margin: 10px auto; 9 | padding: 20px; 10 | background-color: rgba(190, 190, 190, 0.904); 11 | } 12 | 13 | #img-cont { 14 | margin: 2vh; 15 | display: flex; 16 | justify-content: center; 17 | } 18 | h1 { 19 | width: fit-content; 20 | background-color: rgb(48, 48, 48); 21 | padding: 0px 20px; 22 | padding-bottom: 5px; 23 | font-size: 40px; 24 | border-radius: 20px; 25 | color: white; 26 | } 27 | 28 | img { 29 | padding: 10px; 30 | width: 50vw; 31 | margin: 0 auto; 32 | } 33 | 34 | a { 35 | text-decoration: none; 36 | color: white; 37 | } 38 | a:hover { 39 | color: orange; 40 | } 41 | button { 42 | margin-top: 10px; 43 | } 44 | 45 | #author { 46 | font-size: 25px; 47 | } 48 | #content { 49 | white-space: pre-wrap; 50 | font-size: 15px; 51 | } 52 | 53 | @media screen and (max-width: 600px) { 54 | #blog { 55 | width: 100%; 56 | } 57 | img { 58 | width: 100vw; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /public/css/new.css: -------------------------------------------------------------------------------- 1 | a:link{ 2 | text-decoration: none; 3 | } 4 | body{ 5 | background-color:rgba(0, 0, 0, 0.575); 6 | } 7 | 8 | #form-cont { 9 | width: 80vw; 10 | margin: 2vh auto; 11 | border: 2px solid black; 12 | padding: 5%; 13 | background-color: rgba(190, 190, 190, 0.904); 14 | } 15 | div { 16 | color: black; 17 | } 18 | .form-control{ 19 | background-color: rgba(109, 109, 106, 0.459); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /public/css/show.css: -------------------------------------------------------------------------------- 1 | body{ 2 | background-color:rgba(0, 0, 0, 0.575); 3 | } 4 | 5 | #blog { 6 | width: 80vw; 7 | margin: 10px auto; 8 | padding: 20px; 9 | background-color: rgba(190, 190, 190, 0.904); 10 | } 11 | 12 | h1 { 13 | width: fit-content; 14 | background-color: rgb(40, 41, 40); 15 | padding: 0px 20px; 16 | padding-bottom: 5px; 17 | border-radius: 20px; 18 | color: white; 19 | } 20 | 21 | #img-cont { 22 | margin: 3vh; 23 | display: flex; 24 | justify-content: center; 25 | } 26 | img { 27 | padding: 10px; 28 | width: 50vw; 29 | 30 | margin: 0 auto; 31 | } 32 | a { 33 | text-decoration: none; 34 | color: white; 35 | } 36 | a:hover { 37 | 38 | color: #fff; 39 | } 40 | form { 41 | display: inline; 42 | } 43 | 44 | #content { 45 | white-space: pre-wrap; 46 | font-size: 15px; 47 | } 48 | #comment-section{ 49 | height:20vh; 50 | width:55vw; 51 | 52 | overflow-y:hidden; 53 | } 54 | 55 | #comment-create-cont{ 56 | display:flex; 57 | margin-top:4vh; 58 | } 59 | #input-cont{ 60 | margin-top:2vh; 61 | width:40vw; 62 | } 63 | 64 | h2{ 65 | margin-top: 30px; 66 | } 67 | 68 | h5{ 69 | margin:0; 70 | display:inline; 71 | } 72 | 73 | #comm-display-cont{ 74 | display:flex; 75 | } 76 | 77 | @media screen and (max-width: 600px) { 78 | #blog { 79 | width: 100%; 80 | } 81 | img { 82 | width: 100vw; 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /public/css/show_bak.css: -------------------------------------------------------------------------------- 1 | #blog { 2 | width: 80vw; 3 | margin: 10px auto; 4 | padding: 20px; 5 | } 6 | 7 | h1 { 8 | width: fit-content; 9 | background-color: rgb(40, 41, 40); 10 | padding: 10px; 11 | color: white; 12 | } 13 | 14 | #img-cont { 15 | margin: 3vh; 16 | display: flex; 17 | justify-content: center; 18 | } 19 | img { 20 | padding: 10px; 21 | width: 50vw; 22 | 23 | margin: 0 auto; 24 | } 25 | a { 26 | text-decoration: none; 27 | color: white; 28 | } 29 | 30 | form { 31 | display: inline; 32 | } 33 | 34 | #content { 35 | white-space: pre-wrap; 36 | font-size: 1.45rem; 37 | } 38 | 39 | @media screen and (max-width: 600px) { 40 | #blog { 41 | width: 100%; 42 | } 43 | img { 44 | width: 100vw; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /public/css/style.css: -------------------------------------------------------------------------------- 1 | * { 2 | margin: 0; 3 | } 4 | 5 | .navbar{ 6 | width: 100%; 7 | height: 65px; 8 | display: flex; 9 | 10 | background-color: #000; 11 | } 12 | 13 | 14 | .logo a{ 15 | font-size: 32px; 16 | color: #aca4a7; 17 | margin-left: 50px; 18 | } 19 | 20 | .navbar_items ul{ 21 | display: flex; 22 | right: 20px; 23 | } 24 | 25 | .navbar_items ul li{ 26 | margin: 0 10px; 27 | list-style: none; 28 | margin-right: 40px; 29 | } 30 | 31 | .navbar_items ul li a{ 32 | text-transform: uppercase; 33 | color: #fff; 34 | } 35 | 36 | .navbar_items ul li a:hover{ 37 | 38 | color: orange; 39 | text-decoration: underline; 40 | } 41 | 42 | -------------------------------------------------------------------------------- /pythongoogle.py: -------------------------------------------------------------------------------- 1 | # google search using python steps to install 2 | # pip indtall beautifulsoup then pip install google 3 | try: 4 | from googlesearch import search 5 | except ImportError: 6 | print("No module named 'google' found") 7 | 8 | # to search 9 | query = "Geeksforgeeks" 10 | 11 | for j in search(query, tld="co.in", num=10, stop=10, pause=2): 12 | print(j) 13 | -------------------------------------------------------------------------------- /rajtirole_linearsearch.c: -------------------------------------------------------------------------------- 1 | // C code to linearly search x in arr[]. If x 2 | // is present then return its location, otherwise 3 | // return -1 4 | 5 | #include 6 | 7 | int search(int arr[], int n, int x) 8 | { 9 | int i; 10 | for (i = 0; i < n; i++) 11 | if (arr[i] == x) 12 | return i; 13 | return -1; 14 | } 15 | 16 | // Driver code 17 | int main(void) 18 | { 19 | int arr[] = { 2, 3, 4, 10, 40 }; 20 | int x = 10; 21 | int n = sizeof(arr) / sizeof(arr[0]); 22 | 23 | // Function call 24 | int result = search(arr, n, x); 25 | (result == -1) 26 | ? printf("Element is not present in array") 27 | : printf("Element is present at index %d", result); 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /remove_duplicates.py: -------------------------------------------------------------------------------- 1 | 2 | # Question Link : https://leetcode.com/problems/remove-duplicates-from-sorted-list/ 3 | class Solution: 4 | def deleteDuplicates(self, head: Optional[ListNode]) -> Optional[ListNode]: 5 | prev = head 6 | current = head 7 | 8 | if head: 9 | val = head.val 10 | head = head.next 11 | 12 | while (head != None): 13 | if head.val == val: 14 | prev.next = head.next 15 | head = head.next 16 | else: 17 | val = head.val 18 | prev = head 19 | head = head.next 20 | 21 | return current 22 | 23 | 24 | -------------------------------------------------------------------------------- /road_cross by Tamanna-S/README.md: -------------------------------------------------------------------------------- 1 | # The ROAD_CROSSING GAME... 2 | 3 | ## What is it? 4 | -> There is a road in which cars are moving randomly and your job is to cross the road. 5 | 6 | ### Functionalities 7 | - turtle can only move forwards. 8 | - you can control the turtle via your up-arrow key. 9 | 10 | ### Made with 11 | - Basic knowledge python. 12 | - the turtle module in python. 13 | 14 | ### Look at it 15 | > ![Image](game_ss.png) 16 | -------------------------------------------------------------------------------- /road_cross by Tamanna-S/car.py: -------------------------------------------------------------------------------- 1 | from turtle import Turtle 2 | import random 3 | 4 | COLORS = ["red", "blue", "chartreuse", "aqua", "yellow", "purple", "deeppink", "fuchsia"] 5 | 6 | class Car(Turtle): 7 | def __init__(self): 8 | super().__init__() 9 | self.all_cars = [] 10 | 11 | def create_cars(self): 12 | random_choice= random.randint(1,6) 13 | if random_choice == 1: 14 | 15 | car = Turtle() 16 | car.shape("square") 17 | car.penup() 18 | car.shapesize(stretch_len=4, stretch_wid=1.5) 19 | y_pos = random.randint(-240, 250) 20 | car.goto(300, y_pos) 21 | car.color(random.choice(COLORS)) 22 | self.all_cars.append(car) 23 | 24 | def move(self): 25 | for car in self.all_cars: 26 | car.backward(20) 27 | 28 | def make_road(self): 29 | road = Turtle() 30 | road.hideturtle() 31 | road.color("white") 32 | road.penup() 33 | road.goto(-280, -250) 34 | road.setheading(0) 35 | while road.xcor() < 280: 36 | road.pendown() 37 | road.forward(20) 38 | road.penup() 39 | road.forward(10) 40 | road.penup() 41 | road.goto(-280, 270) 42 | while road.xcor() < 280: 43 | road.pendown() 44 | road.forward(20) 45 | road.penup() 46 | road.forward(10) 47 | 48 | def reset(self) -> None: 49 | return super().reset() 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /road_cross by Tamanna-S/game_ss.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/road_cross by Tamanna-S/game_ss.png -------------------------------------------------------------------------------- /road_cross by Tamanna-S/main.py: -------------------------------------------------------------------------------- 1 | from score import Score 2 | from car import Car 3 | from player import Player 4 | from turtle import Screen, textinput 5 | import time 6 | screen = Screen() 7 | def play(): 8 | screen.clearscreen() 9 | screen.setup(width=600, height=600) 10 | screen.title("CROSS_THE_ROAD...") 11 | screen.bgcolor("black") 12 | screen.tracer(0) 13 | 14 | 15 | player = Player() 16 | car = Car() 17 | car.make_road() 18 | score = Score() 19 | 20 | screen.listen() 21 | screen.onkey(player.move, "Up") 22 | playing = True 23 | 24 | while playing: 25 | screen.update() 26 | time.sleep(0.1) 27 | 28 | car.create_cars() 29 | 30 | car.move() 31 | 32 | for cars in car.all_cars: 33 | if cars.distance(player) < 23: 34 | score.loose() 35 | playing = False 36 | ask() 37 | 38 | if player.ycor() >= 270: 39 | score.win() 40 | playing = False 41 | ask() 42 | 43 | screen.exitonclick() 44 | def ask(): 45 | user = textinput(title="let's play!!", prompt="you wanna play 'y' or 'n' : ").lower() 46 | if user == "y": 47 | play() 48 | elif user == "n": 49 | print("alright! see you soon.") 50 | screen.bye() 51 | 52 | else: 53 | print("please enter a valid input.") 54 | screen.bye() 55 | 56 | ask() 57 | -------------------------------------------------------------------------------- /road_cross by Tamanna-S/player.py: -------------------------------------------------------------------------------- 1 | from turtle import Turtle 2 | 3 | class Player(Turtle): 4 | 5 | def __init__(self): 6 | super().__init__() 7 | self.penup() 8 | self.goto(0,-280) 9 | self.color("white") 10 | self.shape("turtle") 11 | self.setheading(90) 12 | 13 | def move(self): 14 | self.forward(10) 15 | def reset(self) -> None: 16 | return super().reset() -------------------------------------------------------------------------------- /road_cross by Tamanna-S/score.py: -------------------------------------------------------------------------------- 1 | from turtle import Turtle 2 | 3 | class Score(Turtle): 4 | def __init__(self): 5 | super().__init__() 6 | self.hideturtle() 7 | self.penup() 8 | self.color("white") 9 | self.goto(0,270) 10 | self.write("..FINISH LINE..", align="center", font=("Arial", 15, "normal")) 11 | 12 | 13 | def loose(self): 14 | self.goto(0,0) 15 | self.write("YOU LOOSE..!!", align="center", font=("Arial black", 15, "bold") ) 16 | 17 | def win(self): 18 | self.goto(0,0) 19 | self.write("YOU WIN..!!", align="center", font=("Arial black", 15, "bold") ) 20 | 21 | def reset(self) -> None: 22 | return super().reset() 23 | -------------------------------------------------------------------------------- /rock-paper-scissors/bg-mobile.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/rock-paper-scissors/bg-mobile.jpg -------------------------------------------------------------------------------- /rock-paper-scissors/bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/rock-paper-scissors/bg.jpg -------------------------------------------------------------------------------- /rock-paper-scissors/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sauravgpt2/hacktoberfest36_2021/5267048c887d0fc06d2db3fcdc04504deddf249b/rock-paper-scissors/favicon.png -------------------------------------------------------------------------------- /sieve_eratosthenes.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #define ll long long int 9 | using namespace std; 10 | 11 | const int N = 100000; 12 | int isPrime[N]; 13 | void sieve_eratosthenes(int n){ 14 | for (int i = 2; i <= n; i++){ 15 | if(isPrime[i]==0){ 16 | for (int j = i*i; j <= n; j+=i){ 17 | isPrime[j] = 1; 18 | } 19 | } 20 | } 21 | for (int i = 2; i <=n; i++){ 22 | if(isPrime[i]==0){ 23 | cout << i << " "; 24 | } 25 | } 26 | cout << endl; 27 | } 28 | 29 | int main() 30 | { 31 | std::ios::sync_with_stdio(false); 32 | cin.tie(NULL); 33 | cout.tie(NULL); 34 | int T; 35 | cin>>T; 36 | // cin.ignore(); must be there when using getline(cin, s) 37 | while(T--){ 38 | int n; 39 | cin>>n; 40 | sieve_eratosthenes(n); 41 | } 42 | return 0; 43 | } -------------------------------------------------------------------------------- /style.css: -------------------------------------------------------------------------------- 1 | .defaultText { 2 | user-select: none; 3 | font-family: Courier, serif; 4 | text-align: center; 5 | } 6 | 7 | button { 8 | user-select: none; 9 | background-color: rgb(231, 231, 231); 10 | color: black; 11 | size: 70px; 12 | font-size: 20px; 13 | border-radius: 10px; 14 | border-color: black; 15 | outline: none; 16 | position: absolute; 17 | float: right; 18 | } 19 | 20 | button:hover { 21 | background-color: #b8bfba 22 | } 23 | 24 | button:active { 25 | background-color: #727278; 26 | box-shadow: 0 1px #666; 27 | transform: translateY(4px); 28 | } 29 | 30 | canvas { 31 | background-color: whitesmoke; 32 | border: 1px solid #000000; 33 | border-radius: 10px; 34 | cursor: pointer; 35 | } 36 | 37 | canvas:hover { 38 | background-color: #f0f0f0 39 | } -------------------------------------------------------------------------------- /ternary_Search.dart: -------------------------------------------------------------------------------- 1 | 2 | int ternarySearch(var l, var r, var key, var arr) { 3 | if (r >= 1) { 4 | //Find the mid1 and mid2 5 | var mid1 = (l + (r - l) / 3).toInt(); 6 | var mid2 = (r - (r - 1) / 3).toInt(); 7 | 8 | //Check if key is present at any mid 9 | if (arr[mid1] == key) return mid1; 10 | 11 | if (arr[mid2] == key) return mid2; 12 | 13 | /*Since Key is not present at mid 14 | * check in which region it is present 15 | * then repeat the Search operation 16 | * in that region 17 | */ 18 | 19 | if (key < arr[mid1]) { 20 | //The Key lies in between 1 and mid1 21 | return ternarySearch(l, mid1 - 1, key, arr); 22 | } else if (key > arr[mid2]) { 23 | //The key lies in between mid2 and r 24 | return ternarySearch(mid2 + 1, r, key, arr); 25 | } else { 26 | //The key lies in between mid1 and mid2 27 | return ternarySearch(mid1 + 1, mid2 - 1, key, arr); 28 | } 29 | } 30 | 31 | //Key not found 32 | return -1; 33 | } 34 | 35 | //Driver code 36 | void main() { 37 | var l, r, p, key; 38 | 39 | //Get the array 40 | var arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; 41 | 42 | //Print the array 43 | print(arr); 44 | 45 | //Starting index 46 | l = 0; 47 | 48 | // length of array 49 | r = arr.length; 50 | 51 | //Checking for 5 52 | //Key to be searched in the array 53 | key = 5; 54 | 55 | //Search the key using ternarySearch 56 | p = ternarySearch(l, r, key, arr); 57 | 58 | //Print the result 59 | print("Index of " + key.toString() + " is " + p.toString()); 60 | } 61 | -------------------------------------------------------------------------------- /text_to_emoji.py: -------------------------------------------------------------------------------- 1 | import text2emotion as te 2 | 3 | word = "I was asked to sign a third party contract a week out from stay. If it wasn't an 8 person group that took a lot of wrangling I would have cancelled the booking straight away. Bathrooms - there are no stand alone bathrooms. Please consider this - you have to clear out the main bedroom to use that bathroom. Other option is you walk through a different bedroom to get to its en-suite. Signs all over the apartment - there are signs everywhere - some helpful - some telling you rules." 4 | emoji = te.get_emotion(word) 5 | print(emoji) 6 | 7 | word2 = "I can't understand what to do now." 8 | emoji2 = te.get_emotion(word2) 9 | print(emoji2) 10 | -------------------------------------------------------------------------------- /todo app/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | To Do List 8 | 9 | 10 | 11 |
12 |

To Do List

13 | Add 14 |
15 |
    16 | 17 |
18 | 19 | 20 | -------------------------------------------------------------------------------- /todo app/todo.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | min-width: 250px; 4 | background-color:rgb(225, 245, 195); 5 | } 6 | 7 | h1{ 8 | margin:3vh; 9 | font-size: 7vh; 10 | } 11 | 12 | ul { 13 | margin: 0; 14 | padding: 0; 15 | } 16 | 17 | ul li { 18 | position: relative; 19 | padding: 12px 8px 12px 40px; 20 | background: #eee; 21 | font-size: 4vh; 22 | transition: 0.2s; 23 | } 24 | 25 | ul li:nth-child(odd) { 26 | background: #f9f9f9; 27 | } 28 | 29 | ul li:hover { 30 | background: #ddd; 31 | } 32 | 33 | 34 | 35 | 36 | .close { 37 | position: absolute; 38 | right: 0; 39 | top: 0; 40 | padding: 12px 16px 12px 16px 41 | } 42 | 43 | .close:hover { 44 | background-color: #f44336; 45 | color: white; 46 | } 47 | 48 | .header { 49 | background-image:linear-gradient(to right, rgb(240, 68, 68),orange,yellow); 50 | padding: 30px 40px; 51 | color: white; 52 | text-align: center; 53 | } 54 | 55 | .header:after { 56 | content: ""; 57 | display: table; 58 | clear: both; 59 | } 60 | 61 | input { 62 | border: none; 63 | width: 75%; 64 | padding: 10px; 65 | float: left; 66 | font-size: 5vh; 67 | box-sizing: border-box; 68 | } 69 | 70 | .addBtn { 71 | padding: 10px; 72 | box-sizing: border-box; 73 | width: 25%; 74 | background: #d9d9d9; 75 | color: #555; 76 | float: left; 77 | text-align: center; 78 | font-size: 5vh; 79 | cursor: pointer; 80 | transition: 0.3s; 81 | font-family: 'Times New Roman', Times, serif; 82 | } 83 | 84 | .addBtn:hover { 85 | background-color: #bbb; 86 | } -------------------------------------------------------------------------------- /todo app/todoj.js: -------------------------------------------------------------------------------- 1 | var myNodelist = document 2 | .getElementsByTagName("LI"); 3 | var i; 4 | for(i=0; i < myNodelist.length;i++){ 5 | var span=document.createElement ("SPAN"); 6 | var txt=document.createTextNode ("\u00D7"); span.className = "close"; 7 | span.appendChild(txt); myNodelist[i].appendChild(span); 8 | } 9 | var close = document 10 | .getElementsByClassName("close"); 11 | var i; 12 | for(i=0; i < close.length;i++){ 13 | close[i].onclick = function() { 14 | var div = this.parentElement; div.style.display = "none"; 15 | } 16 | } 17 | var list=document.querySelector('ul'); list.addEventListener('click', function(ev) { 18 | if (ev.target.tagName === 'LI') { 19 | ev.target.classList.toggle('checked'); 20 | } 21 | }, false); function newElement() { 22 | var li=document.createElement("li"); 23 | var inputValue=document 24 | .getElementById("myInput").value; 25 | var t = document.createTextNode (inputValue); li.appendChild(t); 26 | if (inputValue === '') { 27 | alert("You must write something!"); 28 | } 29 | else { 30 | document.getElementById("myUL") .appendChild(li); 31 | } 32 | document.getElementById("myInput") .value = ""; 33 | var span=document.createElement ("SPAN"); 34 | var txt=document.createTextNode ("\u00D7"); span.className = "close"; 35 | span.appendChild(txt); 36 | li.appendChild(span); 37 | for (i = 0; i < close.length; i++) { 38 | close[i].onclick = function() { 39 | var div = this.parentElement; 40 | div.style.display = "none"; 41 | } 42 | } 43 | } -------------------------------------------------------------------------------- /vectorcommand.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #define fst ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); 4 | #define ll long long int 5 | #include 6 | 7 | using namespace std; 8 | 9 | template 10 | 11 | void display(vector &v){ 12 | for (int i = 0; i < v.size(); i++) 13 | { 14 | cout< vec1; 22 | vector vec2(7,'e'); 23 | int size,element; 24 | cout<<"enetr size"; 25 | cin>>size; 26 | 27 | for (int i = 0; i < size; i++) 28 | { 29 | cin>>element; 30 | vec1.push_back(element); 31 | } 32 | //write iterator line and repla 33 | //vector ::iterator iter = vec1.begin(); 34 | vec1.insert(vec1.begin()+2,32); 35 | display(vec1); 36 | cout< 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Blog app 10 | 11 | 12 |
13 |
14 |
15 | 16 | 22 |
23 |
24 | 25 | 31 |
32 | 33 |
34 | 35 | 42 |
43 | 44 |
45 | 46 | 49 |
50 | 51 |
52 |
53 | 54 | 55 | -------------------------------------------------------------------------------- /views/blog/index.ejs: -------------------------------------------------------------------------------- 1 | <%- include('partials/p1.ejs') %> 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | Blog app 12 | 13 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | <%for(let c of blog){%> 25 |
26 | 27 | 28 |
29 |
30 | image 31 | 32 |
33 |
34 |

<%= c.title %>

35 |

Author: <%= c.author %>

36 | 37 |

<%= c.content %>

38 | 39 | 40 | 41 | 42 | 43 |
44 | 45 | <%}%> 46 |
47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /views/blog/new.ejs: -------------------------------------------------------------------------------- 1 | <%- include('partials/p1.ejs') %> 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Document 10 | 11 | 12 |
13 |
14 |
15 | 16 | 17 |
18 |
19 | 20 | 21 |
22 | 23 |
24 | 25 | 26 |
27 | 28 |
29 | 30 | 31 |
32 | 33 |
34 |
35 | 36 | 37 | -------------------------------------------------------------------------------- /views/blog/partials/p1.ejs: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 14 | 15 | 16 | 20 | 21 | My Blog 22 | 23 | 24 | 33 | 34 |
35 | 36 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /weather-website/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "project", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "Jawed Ahmed", 10 | "license": "ISC", 11 | "dependencies": { 12 | "express": "^4.17.1", 13 | "hbs": "^4.1.2" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /weather-website/src/app.js: -------------------------------------------------------------------------------- 1 | const express=require('express'); 2 | const path=require('path') 3 | const app=express(); 4 | const hbs=require('hbs'); 5 | const port=process.env.PORT || 3000; 6 | 7 | //finding path 8 | // console.log(path.join(__dirname)); 9 | 10 | const staticpath=path.join(__dirname,"../public") 11 | const views_path=path.join(__dirname,"../templates/views") 12 | const partials_path=path.join(__dirname,"../templates/partials") 13 | 14 | app.set('view engine', 'hbs'); 15 | app.set('views', views_path); 16 | hbs.registerPartials(partials_path); 17 | 18 | 19 | app.use(express.static(staticpath)); 20 | 21 | 22 | 23 | app.get("/",(req,res)=>{ 24 | res.render('index') 25 | }) 26 | app.get("/about",(req,res)=>{ 27 | res.render('about'); 28 | }) 29 | app.get("/weather",(req,res)=>{ 30 | res.render("weather"); 31 | }) 32 | app.get("*",(req,res)=>{ 33 | res.render("404error") 34 | }) 35 | 36 | app.listen(port,()=>{ 37 | console.log(`server running at ${port}`); 38 | }) -------------------------------------------------------------------------------- /weather-website/templates/partials/footer.hbs: -------------------------------------------------------------------------------- 1 |
2 |

Created with ❤ by Jawed

3 |
-------------------------------------------------------------------------------- /z_function.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | vector z_function(string &p,string &t) 7 | { 8 | string s=p+'#'+t; 9 | int n=s.size(),l=0,r=0; 10 | vector z(n,0); 11 | for(int i=1;ir) 19 | l=i,r=i+z[i]-1; 20 | } 21 | return z; 22 | } 23 | 24 | int main() 25 | { 26 | string p,t; 27 | cout<<"\nEnter a pattern : "; 28 | cin>>p; 29 | cout<<"\nEnter a text to be searched for the pattern : "; 30 | cin>>t; 31 | vector z=z_function(p,t); 32 | vector ans; 33 | for(int i=0;i