├── .vscode
├── c_cpp_properties.json
├── launch.json
└── settings.json
├── AI_ML
├── IRIS_classifier.ipynb
└── diabeties-prediction-eda-svm.ipynb
├── BillSplitter
├── .gitignore
├── .idea
│ ├── .gitignore
│ ├── .name
│ ├── compiler.xml
│ ├── deploymentTargetDropDown.xml
│ ├── gradle.xml
│ ├── inspectionProfiles
│ │ └── Project_Default.xml
│ ├── kotlinc.xml
│ ├── migrations.xml
│ └── misc.xml
├── app
│ ├── .gitignore
│ ├── build.gradle.kts
│ ├── proguard-rules.pro
│ └── src
│ │ ├── androidTest
│ │ └── java
│ │ │ └── com
│ │ │ └── example
│ │ │ └── billsplitter
│ │ │ └── ExampleInstrumentedTest.kt
│ │ ├── main
│ │ ├── AndroidManifest.xml
│ │ ├── java
│ │ │ └── com
│ │ │ │ └── example
│ │ │ │ └── billsplitter
│ │ │ │ ├── BillSplitterLogic.kt
│ │ │ │ ├── BillSplitterUi.kt
│ │ │ │ ├── MainActivity.kt
│ │ │ │ └── ui
│ │ │ │ └── theme
│ │ │ │ ├── Color.kt
│ │ │ │ ├── Theme.kt
│ │ │ │ └── Type.kt
│ │ └── res
│ │ │ ├── drawable
│ │ │ ├── ic_launcher_background.xml
│ │ │ └── ic_launcher_foreground.xml
│ │ │ ├── mipmap-anydpi-v26
│ │ │ ├── ic_launcher.xml
│ │ │ └── ic_launcher_round.xml
│ │ │ ├── mipmap-hdpi
│ │ │ ├── ic_launcher.webp
│ │ │ └── ic_launcher_round.webp
│ │ │ ├── mipmap-mdpi
│ │ │ ├── ic_launcher.webp
│ │ │ └── ic_launcher_round.webp
│ │ │ ├── mipmap-xhdpi
│ │ │ ├── ic_launcher.webp
│ │ │ └── ic_launcher_round.webp
│ │ │ ├── mipmap-xxhdpi
│ │ │ ├── ic_launcher.webp
│ │ │ └── ic_launcher_round.webp
│ │ │ ├── mipmap-xxxhdpi
│ │ │ ├── ic_launcher.webp
│ │ │ └── ic_launcher_round.webp
│ │ │ ├── values
│ │ │ ├── colors.xml
│ │ │ ├── strings.xml
│ │ │ └── themes.xml
│ │ │ └── xml
│ │ │ ├── backup_rules.xml
│ │ │ └── data_extraction_rules.xml
│ │ └── test
│ │ └── java
│ │ └── com
│ │ └── example
│ │ └── billsplitter
│ │ └── ExampleUnitTest.kt
├── build.gradle.kts
├── gradle.properties
├── gradle
│ ├── libs.versions.toml
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
└── settings.gradle.kts
├── C
├── Knapsack.c
├── abcprint.c
├── abcprint.exe
├── array.c
├── array.exe
├── binary.c
├── binary.exe
├── binary_tree.c
├── binary_tree.exe
├── break.c
├── break.exe
├── cp.c
├── delete_third.c
├── delete_third.exe
├── do_while_loop.c
├── do_while_loop.exe
├── doublylinklist.c
├── doublylinklist.exe
├── dsa.c
├── dsa.exe
├── dym.c
├── dym.js
├── exam.c
├── exam.exe
├── exam2.c
├── exam3.exe
├── factfunction.c
├── factfunction.exe
├── factorial_function.c
├── factorial_function.exe
├── faran_function.c
├── faran_function.exe
├── flag.py
├── function.c
├── function.exe
├── hello.c
├── hello.exe
├── lefttringlestsrprint.c
├── lefttringlestsrprint.exe
├── library.c
├── linkedlist.c
├── linkedlist.exe
├── linklist.c
├── linklist.exe
├── loop.exe
├── ls.c
├── ls.exe
├── mirror_image.c
├── mirror_image.exe
├── prime.c
├── prime.exe
├── primef.c
├── primef.exe
├── printingstars.c
├── printingstars.exe
├── queue.exe
├── queue_.c
└── queue_.exe
├── CONTRIBUTING.md
├── Cpp
├── Algorithms
│ └── sort
│ │ ├── bubble_sort.cpp
│ │ ├── insertion_sort.cpp
│ │ └── selection_sort.cpp
├── Reverse_Array.cpp
└── output
│ ├── Reverse_Array
│ └── Reverse_Array.dSYM
│ └── Contents
│ ├── Info.plist
│ └── Resources
│ ├── DWARF
│ └── Reverse_Array
│ └── Relocations
│ └── aarch64
│ └── Reverse_Array.yml
├── Food_Delivery_Time_Prediction
├── main.py
├── model.ipynb
├── model.pkl
├── readme.md
├── scaler.pkl
└── train.csv
├── Go
└── Algorithms
│ └── sort
│ ├── binaryinsertionsort.go
│ ├── bogosort.go
│ ├── bubblesort.go
│ ├── bucketsort.go
│ ├── circlesort.go
│ ├── cocktailsort.go
│ ├── combSort.go
│ ├── constraints.go
│ ├── countingsort.go
│ ├── cyclesort.go
│ ├── exchangesort.go
│ ├── heapsort.go
│ ├── insertionsort.go
│ ├── pancakesort.go
│ ├── patiencesort.go
│ ├── quicksort.go
│ ├── selectionsort.go
│ ├── shellsort.go
│ ├── simplesort.go
│ └── timsort.go
├── Java
├── Count
│ ├── .gitignore
│ ├── .idea
│ │ ├── .gitignore
│ │ ├── .name
│ │ ├── misc.xml
│ │ └── modules.xml
│ ├── Count.iml
│ └── src
│ │ └── Main.java
├── Inputs.java
├── Main.java
├── PizzaOrdering
│ ├── .gitignore
│ ├── cart.java
│ ├── main.java
│ ├── menuLoader.java
│ └── menuParser.java
├── Primitives.java
├── ReverseArray.java
├── ReverseLinkedList.java
├── TwoSumProblem
│ ├── .gitignore
│ ├── .idea
│ │ ├── .gitignore
│ │ ├── misc.xml
│ │ └── modules.xml
│ ├── ReverseArray.java
│ ├── TwoSumProblem.iml
│ └── src
│ │ └── Main.java
├── TypeCasting.java
├── sum.java
└── temperature.java
├── Landing page
├── a.png
└── index.html
├── Python
├── Arithemetic Operations.ipynb
├── DataTypes.ipynb
├── Factoriel.ipynb
├── FizzBuzz.py
├── Functions.ipynb
├── If-Else.ipynb
├── List.ipynb
├── Loops.ipynb
├── Simple_Tkinter_UI.ipynb
├── Untitled.ipynb
├── Untitled1.ipynb
├── UserInput.ipynb
├── Variables.ipynb
├── first.ipynb
└── reverse_array.py
├── README.md
├── bmi_calculator
├── .gitignore
├── .metadata
├── README.md
├── analysis_options.yaml
├── android
│ ├── .gitignore
│ ├── app
│ │ ├── build.gradle
│ │ └── src
│ │ │ ├── debug
│ │ │ └── AndroidManifest.xml
│ │ │ ├── main
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── kotlin
│ │ │ │ └── com
│ │ │ │ │ └── example
│ │ │ │ │ └── bmi_calculator
│ │ │ │ │ └── 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
├── 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
│ └── RunnerTests
│ │ └── RunnerTests.swift
├── lib
│ └── main.dart
├── linux
│ ├── .gitignore
│ ├── CMakeLists.txt
│ ├── flutter
│ │ ├── CMakeLists.txt
│ │ ├── generated_plugin_registrant.cc
│ │ ├── generated_plugin_registrant.h
│ │ └── generated_plugins.cmake
│ ├── main.cc
│ ├── my_application.cc
│ └── my_application.h
├── macos
│ ├── .gitignore
│ ├── Flutter
│ │ ├── Flutter-Debug.xcconfig
│ │ ├── Flutter-Release.xcconfig
│ │ └── GeneratedPluginRegistrant.swift
│ ├── Runner.xcodeproj
│ │ ├── project.pbxproj
│ │ ├── project.xcworkspace
│ │ │ └── xcshareddata
│ │ │ │ └── IDEWorkspaceChecks.plist
│ │ └── xcshareddata
│ │ │ └── xcschemes
│ │ │ └── Runner.xcscheme
│ ├── Runner.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ └── IDEWorkspaceChecks.plist
│ ├── Runner
│ │ ├── AppDelegate.swift
│ │ ├── Assets.xcassets
│ │ │ └── AppIcon.appiconset
│ │ │ │ ├── Contents.json
│ │ │ │ ├── app_icon_1024.png
│ │ │ │ ├── app_icon_128.png
│ │ │ │ ├── app_icon_16.png
│ │ │ │ ├── app_icon_256.png
│ │ │ │ ├── app_icon_32.png
│ │ │ │ ├── app_icon_512.png
│ │ │ │ └── app_icon_64.png
│ │ ├── Base.lproj
│ │ │ └── MainMenu.xib
│ │ ├── Configs
│ │ │ ├── AppInfo.xcconfig
│ │ │ ├── Debug.xcconfig
│ │ │ ├── Release.xcconfig
│ │ │ └── Warnings.xcconfig
│ │ ├── DebugProfile.entitlements
│ │ ├── Info.plist
│ │ ├── MainFlutterWindow.swift
│ │ └── Release.entitlements
│ └── RunnerTests
│ │ └── RunnerTests.swift
├── pubspec.lock
├── pubspec.yaml
├── test
│ └── widget_test.dart
├── web
│ ├── favicon.png
│ ├── icons
│ │ ├── Icon-192.png
│ │ ├── Icon-512.png
│ │ ├── Icon-maskable-192.png
│ │ └── Icon-maskable-512.png
│ ├── index.html
│ └── manifest.json
└── windows
│ ├── .gitignore
│ ├── CMakeLists.txt
│ ├── flutter
│ ├── CMakeLists.txt
│ ├── generated_plugin_registrant.cc
│ ├── generated_plugin_registrant.h
│ └── generated_plugins.cmake
│ └── runner
│ ├── CMakeLists.txt
│ ├── Runner.rc
│ ├── flutter_window.cpp
│ ├── flutter_window.h
│ ├── main.cpp
│ ├── resource.h
│ ├── resources
│ └── app_icon.ico
│ ├── runner.exe.manifest
│ ├── utils.cpp
│ ├── utils.h
│ ├── win32_window.cpp
│ └── win32_window.h
├── calculator.ipynb
├── quicksort.c
├── radix sort
└── socket
├── .gitignore
├── package-lock.json
├── package.json
├── public
├── index.html
└── style.css
└── server.js
/.vscode/c_cpp_properties.json:
--------------------------------------------------------------------------------
1 | {
2 | "configurations": [
3 | {
4 | "name": "macos-clang-arm64",
5 | "includePath": [
6 | "${workspaceFolder}/**"
7 | ],
8 | "compilerPath": "/usr/bin/clang",
9 | "cStandard": "${default}",
10 | "cppStandard": "${default}",
11 | "intelliSenseMode": "macos-clang-arm64",
12 | "compilerArgs": [
13 | ""
14 | ]
15 | }
16 | ],
17 | "version": 4
18 | }
--------------------------------------------------------------------------------
/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | "version": "0.2.0",
3 | "configurations": [
4 | {
5 | "name": "C/C++ Runner: Debug Session",
6 | "type": "lldb",
7 | "request": "launch",
8 | "args": [],
9 | "cwd": "/Users/chetanmeshram/Reverse/Cpp",
10 | "program": "/Users/chetanmeshram/Reverse/Cpp/build/Debug/outDebug"
11 | }
12 | ]
13 | }
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "C_Cpp_Runner.cCompilerPath": "clang",
3 | "C_Cpp_Runner.cppCompilerPath": "clang++",
4 | "C_Cpp_Runner.debuggerPath": "lldb",
5 | "C_Cpp_Runner.cStandard": "",
6 | "C_Cpp_Runner.cppStandard": "",
7 | "C_Cpp_Runner.msvcBatchPath": "",
8 | "C_Cpp_Runner.useMsvc": false,
9 | "C_Cpp_Runner.warnings": [
10 | "-Wall",
11 | "-Wextra",
12 | "-Wpedantic",
13 | "-Wshadow",
14 | "-Wformat=2",
15 | "-Wcast-align",
16 | "-Wconversion",
17 | "-Wsign-conversion",
18 | "-Wnull-dereference"
19 | ],
20 | "C_Cpp_Runner.msvcWarnings": [
21 | "/W4",
22 | "/permissive-",
23 | "/w14242",
24 | "/w14287",
25 | "/w14296",
26 | "/w14311",
27 | "/w14826",
28 | "/w44062",
29 | "/w44242",
30 | "/w14905",
31 | "/w14906",
32 | "/w14263",
33 | "/w44265",
34 | "/w14928"
35 | ],
36 | "C_Cpp_Runner.enableWarnings": true,
37 | "C_Cpp_Runner.warningsAsError": false,
38 | "C_Cpp_Runner.compilerArgs": [],
39 | "C_Cpp_Runner.linkerArgs": [],
40 | "C_Cpp_Runner.includePaths": [],
41 | "C_Cpp_Runner.includeSearch": [
42 | "*",
43 | "**/*"
44 | ],
45 | "C_Cpp_Runner.excludeSearch": [
46 | "**/build",
47 | "**/build/**",
48 | "**/.*",
49 | "**/.*/**",
50 | "**/.vscode",
51 | "**/.vscode/**"
52 | ],
53 | "C_Cpp_Runner.useAddressSanitizer": false,
54 | "C_Cpp_Runner.useUndefinedSanitizer": false,
55 | "C_Cpp_Runner.useLeakSanitizer": false,
56 | "C_Cpp_Runner.showCompilationTime": false,
57 | "C_Cpp_Runner.useLinkTimeOptimization": false,
58 | "C_Cpp_Runner.msvcSecureNoWarnings": false
59 | }
--------------------------------------------------------------------------------
/BillSplitter/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/caches
5 | /.idea/libraries
6 | /.idea/modules.xml
7 | /.idea/workspace.xml
8 | /.idea/navEditor.xml
9 | /.idea/assetWizardSettings.xml
10 | .DS_Store
11 | /build
12 | /captures
13 | .externalNativeBuild
14 | .cxx
15 | local.properties
16 |
--------------------------------------------------------------------------------
/BillSplitter/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/BillSplitter/.idea/.name:
--------------------------------------------------------------------------------
1 | Bill Splitter
--------------------------------------------------------------------------------
/BillSplitter/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/BillSplitter/.idea/deploymentTargetDropDown.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/BillSplitter/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
18 |
19 |
--------------------------------------------------------------------------------
/BillSplitter/.idea/inspectionProfiles/Project_Default.xml:
--------------------------------------------------------------------------------
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 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/BillSplitter/.idea/kotlinc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/BillSplitter/.idea/migrations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/BillSplitter/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/BillSplitter/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/BillSplitter/app/build.gradle.kts:
--------------------------------------------------------------------------------
1 | plugins {
2 | alias(libs.plugins.androidApplication)
3 | alias(libs.plugins.jetbrainsKotlinAndroid)
4 | }
5 |
6 | android {
7 | namespace = "com.example.billsplitter"
8 | compileSdk = 34
9 |
10 | defaultConfig {
11 | applicationId = "com.example.billsplitter"
12 | minSdk = 24
13 | targetSdk = 34
14 | versionCode = 1
15 | versionName = "1.0"
16 |
17 | testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
18 | vectorDrawables {
19 | useSupportLibrary = true
20 | }
21 | }
22 |
23 | buildTypes {
24 | release {
25 | isMinifyEnabled = false
26 | proguardFiles(
27 | getDefaultProguardFile("proguard-android-optimize.txt"),
28 | "proguard-rules.pro"
29 | )
30 | }
31 | }
32 | compileOptions {
33 | sourceCompatibility = JavaVersion.VERSION_1_8
34 | targetCompatibility = JavaVersion.VERSION_1_8
35 | }
36 | kotlinOptions {
37 | jvmTarget = "1.8"
38 | }
39 | buildFeatures {
40 | compose = true
41 | }
42 | composeOptions {
43 | kotlinCompilerExtensionVersion = "1.5.1"
44 | }
45 | packaging {
46 | resources {
47 | excludes += "/META-INF/{AL2.0,LGPL2.1}"
48 | }
49 | }
50 | }
51 |
52 | dependencies {
53 |
54 | implementation(libs.androidx.core.ktx)
55 | implementation(libs.androidx.lifecycle.runtime.ktx)
56 | implementation(libs.androidx.activity.compose)
57 | implementation(platform(libs.androidx.compose.bom))
58 | implementation(libs.androidx.ui)
59 | implementation(libs.androidx.ui.graphics)
60 | implementation(libs.androidx.ui.tooling.preview)
61 | implementation(libs.androidx.material3)
62 | testImplementation(libs.junit)
63 | androidTestImplementation(libs.androidx.junit)
64 | androidTestImplementation(libs.androidx.espresso.core)
65 | androidTestImplementation(platform(libs.androidx.compose.bom))
66 | androidTestImplementation(libs.androidx.ui.test.junit4)
67 | debugImplementation(libs.androidx.ui.tooling)
68 | debugImplementation(libs.androidx.ui.test.manifest)
69 | }
--------------------------------------------------------------------------------
/BillSplitter/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/BillSplitter/app/src/androidTest/java/com/example/billsplitter/ExampleInstrumentedTest.kt:
--------------------------------------------------------------------------------
1 | package com.example.billsplitter
2 |
3 | import androidx.test.platform.app.InstrumentationRegistry
4 | import androidx.test.ext.junit.runners.AndroidJUnit4
5 |
6 | import org.junit.Test
7 | import org.junit.runner.RunWith
8 |
9 | import org.junit.Assert.*
10 |
11 | /**
12 | * Instrumented test, which will execute on an Android device.
13 | *
14 | * See [testing documentation](http://d.android.com/tools/testing).
15 | */
16 | @RunWith(AndroidJUnit4::class)
17 | class ExampleInstrumentedTest {
18 | @Test
19 | fun useAppContext() {
20 | // Context of the app under test.
21 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext
22 | assertEquals("com.example.billsplitter", appContext.packageName)
23 | }
24 | }
--------------------------------------------------------------------------------
/BillSplitter/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
15 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/BillSplitter/app/src/main/java/com/example/billsplitter/BillSplitterLogic.kt:
--------------------------------------------------------------------------------
1 | package com.example.billsplitter
2 |
3 | import android.health.connect.datatypes.units.Percentage
4 | import java.text.DecimalFormat
5 |
6 | fun getTotalPerPersonAmount(
7 | inputAmount: String,
8 | tipPercentage: Float,
9 | personCount: Int
10 | ):String{
11 | return when {
12 | inputAmount.isEmpty() -> {
13 | "0"
14 | }
15 | else -> {
16 | val userAmount = inputAmount.toFloat()
17 | val tipAmount = userAmount * tipPercentage.div(100)
18 | val perHeadAmount = (userAmount + tipAmount).div(personCount)
19 | perHeadAmount.toString()
20 | }
21 | }
22 | }
23 |
24 | fun formatTwoDecimalPoints(str: String): String {
25 |
26 | return if (str.isEmpty()) {
27 | ""
28 | } else {
29 | val format = DecimalFormat("######################.##")
30 | format.format(str.toFloat())
31 | }
32 |
33 | }
34 |
35 | fun getTipAmount(inputAmount: String, tipPercentage: Float): String {
36 | return when {
37 | inputAmount.isEmpty() -> {
38 | "0"
39 | }
40 | else -> {
41 | val amount = inputAmount.toFloat()
42 | (amount * tipPercentage.div(100)).toString()
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/BillSplitter/app/src/main/java/com/example/billsplitter/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.example.billsplitter
2 |
3 | import android.os.Bundle
4 | import androidx.activity.ComponentActivity
5 | import androidx.activity.compose.setContent
6 | import androidx.compose.foundation.layout.fillMaxSize
7 | import androidx.compose.material3.MaterialTheme
8 | import androidx.compose.material3.Surface
9 | import androidx.compose.material3.Text
10 | import androidx.compose.runtime.Composable
11 | import androidx.compose.ui.Modifier
12 | import androidx.compose.ui.tooling.preview.Preview
13 | import com.example.billsplitter.ui.theme.BillSplitterTheme
14 |
15 | class MainActivity : ComponentActivity() {
16 | override fun onCreate(savedInstanceState: Bundle?) {
17 | super.onCreate(savedInstanceState)
18 | setContent {
19 | BillSplitterTheme {
20 | // A surface container using the 'background' color from the theme
21 | MainUI("Android")
22 | }
23 | }
24 | }
25 | }
26 |
27 | @Composable
28 | fun MainUI(name: String, modifier: Modifier = Modifier) {
29 | Surface(
30 | modifier = Modifier.fillMaxSize(),
31 | color = MaterialTheme.colorScheme.background
32 | ){
33 | CompleteUI()
34 | }
35 | }
36 |
37 | @Preview(showBackground = true)
38 | @Composable
39 | fun GreetingPreview() {
40 | BillSplitterTheme {
41 | MainUI("Android")
42 | }
43 | }
--------------------------------------------------------------------------------
/BillSplitter/app/src/main/java/com/example/billsplitter/ui/theme/Color.kt:
--------------------------------------------------------------------------------
1 | package com.example.billsplitter.ui.theme
2 |
3 | import androidx.compose.ui.graphics.Color
4 |
5 | val Purple80 = Color(0xFFD0BCFF)
6 | val PurpleGrey80 = Color(0xFFCCC2DC)
7 | val Pink80 = Color(0xFFEFB8C8)
8 |
9 | val Purple40 = Color(0xFF6650a4)
10 | val PurpleGrey40 = Color(0xFF625b71)
11 | val Pink40 = Color(0xFF7D5260)
--------------------------------------------------------------------------------
/BillSplitter/app/src/main/java/com/example/billsplitter/ui/theme/Theme.kt:
--------------------------------------------------------------------------------
1 | package com.example.billsplitter.ui.theme
2 |
3 | import android.app.Activity
4 | import android.os.Build
5 | import androidx.compose.foundation.isSystemInDarkTheme
6 | import androidx.compose.material3.MaterialTheme
7 | import androidx.compose.material3.darkColorScheme
8 | import androidx.compose.material3.dynamicDarkColorScheme
9 | import androidx.compose.material3.dynamicLightColorScheme
10 | import androidx.compose.material3.lightColorScheme
11 | import androidx.compose.runtime.Composable
12 | import androidx.compose.runtime.SideEffect
13 | import androidx.compose.ui.graphics.toArgb
14 | import androidx.compose.ui.platform.LocalContext
15 | import androidx.compose.ui.platform.LocalView
16 | import androidx.core.view.WindowCompat
17 |
18 | private val DarkColorScheme = darkColorScheme(
19 | primary = Purple80,
20 | secondary = PurpleGrey80,
21 | tertiary = Pink80
22 | )
23 |
24 | private val LightColorScheme = lightColorScheme(
25 | primary = Purple40,
26 | secondary = PurpleGrey40,
27 | tertiary = Pink40
28 |
29 | /* Other default colors to override
30 | background = Color(0xFFFFFBFE),
31 | surface = Color(0xFFFFFBFE),
32 | onPrimary = Color.White,
33 | onSecondary = Color.White,
34 | onTertiary = Color.White,
35 | onBackground = Color(0xFF1C1B1F),
36 | onSurface = Color(0xFF1C1B1F),
37 | */
38 | )
39 |
40 | @Composable
41 | fun BillSplitterTheme(
42 | darkTheme: Boolean = isSystemInDarkTheme(),
43 | // Dynamic color is available on Android 12+
44 | dynamicColor: Boolean = true,
45 | content: @Composable () -> Unit
46 | ) {
47 | val colorScheme = when {
48 | dynamicColor && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S -> {
49 | val context = LocalContext.current
50 | if (darkTheme) dynamicDarkColorScheme(context) else dynamicLightColorScheme(context)
51 | }
52 |
53 | darkTheme -> DarkColorScheme
54 | else -> LightColorScheme
55 | }
56 | val view = LocalView.current
57 | if (!view.isInEditMode) {
58 | SideEffect {
59 | val window = (view.context as Activity).window
60 | window.statusBarColor = colorScheme.primary.toArgb()
61 | WindowCompat.getInsetsController(window, view).isAppearanceLightStatusBars = darkTheme
62 | }
63 | }
64 |
65 | MaterialTheme(
66 | colorScheme = colorScheme,
67 | typography = Typography,
68 | content = content
69 | )
70 | }
--------------------------------------------------------------------------------
/BillSplitter/app/src/main/java/com/example/billsplitter/ui/theme/Type.kt:
--------------------------------------------------------------------------------
1 | package com.example.billsplitter.ui.theme
2 |
3 | import androidx.compose.material3.Typography
4 | import androidx.compose.ui.text.TextStyle
5 | import androidx.compose.ui.text.font.FontFamily
6 | import androidx.compose.ui.text.font.FontWeight
7 | import androidx.compose.ui.unit.sp
8 |
9 | // Set of Material typography styles to start with
10 | val Typography = Typography(
11 | bodyLarge = TextStyle(
12 | fontFamily = FontFamily.Default,
13 | fontWeight = FontWeight.Normal,
14 | fontSize = 16.sp,
15 | lineHeight = 24.sp,
16 | letterSpacing = 0.5.sp
17 | )
18 | /* Other default text styles to override
19 | titleLarge = TextStyle(
20 | fontFamily = FontFamily.Default,
21 | fontWeight = FontWeight.Normal,
22 | fontSize = 22.sp,
23 | lineHeight = 28.sp,
24 | letterSpacing = 0.sp
25 | ),
26 | labelSmall = TextStyle(
27 | fontFamily = FontFamily.Default,
28 | fontWeight = FontWeight.Medium,
29 | fontSize = 11.sp,
30 | lineHeight = 16.sp,
31 | letterSpacing = 0.5.sp
32 | )
33 | */
34 | )
--------------------------------------------------------------------------------
/BillSplitter/app/src/main/res/drawable/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
15 |
18 |
21 |
22 |
23 |
24 |
30 |
--------------------------------------------------------------------------------
/BillSplitter/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/BillSplitter/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/BillSplitter/app/src/main/res/mipmap-hdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/BillSplitter/app/src/main/res/mipmap-hdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/BillSplitter/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/BillSplitter/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/BillSplitter/app/src/main/res/mipmap-mdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/BillSplitter/app/src/main/res/mipmap-mdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/BillSplitter/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/BillSplitter/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/BillSplitter/app/src/main/res/mipmap-xhdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/BillSplitter/app/src/main/res/mipmap-xhdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/BillSplitter/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/BillSplitter/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/BillSplitter/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/BillSplitter/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/BillSplitter/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/BillSplitter/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/BillSplitter/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/BillSplitter/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
--------------------------------------------------------------------------------
/BillSplitter/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/BillSplitter/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp
--------------------------------------------------------------------------------
/BillSplitter/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FFBB86FC
4 | #FF6200EE
5 | #FF3700B3
6 | #FF03DAC5
7 | #FF018786
8 | #FF000000
9 | #FFFFFFFF
10 |
--------------------------------------------------------------------------------
/BillSplitter/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Bill Splitter
3 |
--------------------------------------------------------------------------------
/BillSplitter/app/src/main/res/values/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/BillSplitter/app/src/main/res/xml/backup_rules.xml:
--------------------------------------------------------------------------------
1 |
8 |
9 |
13 |
--------------------------------------------------------------------------------
/BillSplitter/app/src/main/res/xml/data_extraction_rules.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
12 |
13 |
19 |
--------------------------------------------------------------------------------
/BillSplitter/app/src/test/java/com/example/billsplitter/ExampleUnitTest.kt:
--------------------------------------------------------------------------------
1 | package com.example.billsplitter
2 |
3 | import org.junit.Test
4 |
5 | import org.junit.Assert.*
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * See [testing documentation](http://d.android.com/tools/testing).
11 | */
12 | class ExampleUnitTest {
13 | @Test
14 | fun addition_isCorrect() {
15 | assertEquals(4, 2 + 2)
16 | }
17 | }
--------------------------------------------------------------------------------
/BillSplitter/build.gradle.kts:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 | plugins {
3 | alias(libs.plugins.androidApplication) apply false
4 | alias(libs.plugins.jetbrainsKotlinAndroid) apply false
5 | }
--------------------------------------------------------------------------------
/BillSplitter/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. For more details, visit
12 | # https://developer.android.com/r/tools/gradle-multi-project-decoupled-projects
13 | # org.gradle.parallel=true
14 | # AndroidX package structure to make it clearer which packages are bundled with the
15 | # Android operating system, and which are packaged with your app's APK
16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
17 | android.useAndroidX=true
18 | # Kotlin code style for this project: "official" or "obsolete":
19 | kotlin.code.style=official
20 | # Enables namespacing of each library's R class so that its R class includes only the
21 | # resources declared in the library itself and none from the library's dependencies,
22 | # thereby reducing the size of the R class for that library
23 | android.nonTransitiveRClass=true
--------------------------------------------------------------------------------
/BillSplitter/gradle/libs.versions.toml:
--------------------------------------------------------------------------------
1 | [versions]
2 | agp = "8.3.2"
3 | kotlin = "1.9.0"
4 | coreKtx = "1.13.1"
5 | junit = "4.13.2"
6 | junitVersion = "1.1.5"
7 | espressoCore = "3.5.1"
8 | lifecycleRuntimeKtx = "2.8.1"
9 | activityCompose = "1.9.0"
10 | composeBom = "2023.08.00"
11 |
12 | [libraries]
13 | androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
14 | junit = { group = "junit", name = "junit", version.ref = "junit" }
15 | androidx-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitVersion" }
16 | androidx-espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" }
17 | androidx-lifecycle-runtime-ktx = { group = "androidx.lifecycle", name = "lifecycle-runtime-ktx", version.ref = "lifecycleRuntimeKtx" }
18 | androidx-activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "activityCompose" }
19 | androidx-compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "composeBom" }
20 | androidx-ui = { group = "androidx.compose.ui", name = "ui" }
21 | androidx-ui-graphics = { group = "androidx.compose.ui", name = "ui-graphics" }
22 | androidx-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling" }
23 | androidx-ui-tooling-preview = { group = "androidx.compose.ui", name = "ui-tooling-preview" }
24 | androidx-ui-test-manifest = { group = "androidx.compose.ui", name = "ui-test-manifest" }
25 | androidx-ui-test-junit4 = { group = "androidx.compose.ui", name = "ui-test-junit4" }
26 | androidx-material3 = { group = "androidx.compose.material3", name = "material3" }
27 |
28 | [plugins]
29 | androidApplication = { id = "com.android.application", version.ref = "agp" }
30 | jetbrainsKotlinAndroid = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
31 |
32 |
--------------------------------------------------------------------------------
/BillSplitter/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/BillSplitter/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/BillSplitter/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Thu Jun 06 11:26:40 IST 2024
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
5 | zipStoreBase=GRADLE_USER_HOME
6 | zipStorePath=wrapper/dists
7 |
--------------------------------------------------------------------------------
/BillSplitter/settings.gradle.kts:
--------------------------------------------------------------------------------
1 | pluginManagement {
2 | repositories {
3 | google {
4 | content {
5 | includeGroupByRegex("com\\.android.*")
6 | includeGroupByRegex("com\\.google.*")
7 | includeGroupByRegex("androidx.*")
8 | }
9 | }
10 | mavenCentral()
11 | gradlePluginPortal()
12 | }
13 | }
14 | dependencyResolutionManagement {
15 | repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
16 | repositories {
17 | google()
18 | mavenCentral()
19 | }
20 | }
21 |
22 | rootProject.name = "Bill Splitter"
23 | include(":app")
24 |
--------------------------------------------------------------------------------
/C/Knapsack.c:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | struct item{
4 | int s_no,profit,weight,taken;
5 | float ratio;
6 | };
7 | int main(){
8 | time_t t1;
9 | time(&t1);
10 | int W,n,i=0;
11 | printf("Enter the size of the knapsack: ");
12 | scanf("%d",&W);
13 | printf("Enter the number of objects: ");
14 | scanf("%d",&n);
15 | struct item obj[n];
16 | float P=0;
17 | for(int i=0;iobj[j+1].ratio){
50 | struct item temp=obj[j];
51 | obj[j]=obj[j+1];
52 | obj[j+1]=temp;
53 | }
54 | }
55 | }
56 | printf("The item to be taken are:\n(0-Not Taken,1-Taken)\n");
57 | for(int i=0;i
2 |
3 | int main(){
4 | int i , j ,num ,a=65;
5 | printf("enter the number of rows");
6 | scanf("%d" , &num);
7 | for(i=1; i<=num ; i++)
8 | {
9 | for(j=1 ; j<=i ; j++)
10 | {
11 | printf("%c " ,a);
12 |
13 | }
14 | a=a+1;
15 | printf("\n");
16 | }
17 | return 0;
18 | }
--------------------------------------------------------------------------------
/C/abcprint.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/C/abcprint.exe
--------------------------------------------------------------------------------
/C/array.c:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | int main()
4 | {
5 | int arry[10];
6 | int i = 0;
7 | int max = 0;
8 | for (i = 0; i < 10; i++)
9 | {
10 | printf("enter element no %d: ", i + 1);
11 | scanf("%d", &arry[i]);
12 | // if(max max)
25 | {
26 | max = arry[i];
27 | }
28 | }
29 | printf("the maximum element in the array is : %d", max);
30 |
31 | return 0;
32 | }
--------------------------------------------------------------------------------
/C/array.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/C/array.exe
--------------------------------------------------------------------------------
/C/binary.c:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | int binarySearch(int array[], int x, int low, int high) {
4 | if (high= low) {
10 | int mid = low + high / 2;
11 |
12 | if (array[mid] == x)
13 | return mid;
14 |
15 | if (array[mid] > x)
16 | return binarySearch(array, x, low, mid - 1);
17 |
18 | else
19 | return binarySearch(array, x, mid + 1, high);
20 | }
21 |
22 | return 0;
23 | }
24 |
25 | int main() {
26 | int array[] = {3, 4, 5, 6, 7, 8, 9};
27 | int n = sizeof(array) / sizeof(array[0]);
28 | int x = 5;
29 | int result = binarySearch(array, x, 0, n + 1);
30 | if (result == 0)
31 | printf("Not found");
32 | else
33 | printf("Element is found at index %d", result);
34 | return 0;
35 | }
36 |
--------------------------------------------------------------------------------
/C/binary.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/C/binary.exe
--------------------------------------------------------------------------------
/C/binary_tree.c:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | struct node
4 | {
5 | int data;
6 | struct node* leftchild;
7 | struct node* rightchild;
8 | };
9 |
10 | void insertLeft(struct node* leftroot)
11 | {
12 | struct node* newnode;
13 | newnode = (struct node*)malloc(sizeof(struct node));
14 | printf("Enter an element: ");
15 | scanf("%d",&newnode->data);
16 | newnode->leftchild = NULL;
17 | newnode->rightchild = NULL;
18 | leftroot->leftchild = newnode;
19 | }
20 |
21 | void insertRight(struct node* rightroot)
22 | {
23 | struct node* newnode;
24 | newnode = (struct node*)malloc(sizeof(struct node));
25 | printf("Enter an element: ");
26 | scanf("%d",&newnode->data);
27 | newnode->leftchild = NULL;
28 | newnode->rightchild = NULL;
29 | rightroot->rightchild = newnode;
30 | }
31 |
32 | void Inorder(struct node* printRoot)
33 | {
34 | if(printRoot==NULL)
35 | {
36 | return;
37 | }
38 | Inorder(printRoot->leftchild);
39 | printf("%d ",printRoot->data);
40 | Inorder(printRoot->rightchild);
41 | }
42 |
43 | int Height(struct node *heightroot)
44 | {
45 | int x = 0, y = 0;
46 | if(heightroot==NULL)
47 | {
48 | return 0;
49 | }
50 | x = Height(heightroot->leftchild);
51 | y = Height(heightroot->rightchild);
52 | if(x>y)
53 | {
54 | return x+1;
55 | }
56 | else
57 | {
58 | return y+1;
59 | }
60 | }
61 |
62 |
63 | int main(){
64 | struct node* root;
65 | int height;
66 | root = (struct node*)malloc(sizeof(struct node));
67 | root->leftchild = NULL;
68 | root->rightchild = NULL;
69 | root->data = 10;
70 | insertLeft(root);
71 | insertRight(root);
72 | insertLeft(root->leftchild);
73 | insertRight(root->leftchild);
74 | insertLeft(root->rightchild);
75 | insertRight(root->rightchild);
76 | Inorder(root);
77 | height = Height(root);
78 | printf("Height of Tree is: %d",height);
79 | return 0;
80 | }
--------------------------------------------------------------------------------
/C/binary_tree.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/C/binary_tree.exe
--------------------------------------------------------------------------------
/C/break.c:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | int main(){
4 | int i = 2 , num ;
5 | printf("enter theb num");
6 | scanf("%d" ,&num);
7 | while (i<=(num-1)/2)
8 | {
9 | if (num%i==0)
10 | {
11 | printf("not prime\n");
12 | break ;
13 | }
14 |
15 |
16 | else if (i == (num-1)/2){
17 | printf("number is prime");}
18 | i++;
19 |
20 |
21 | }
22 |
23 | return 0;
24 | }
--------------------------------------------------------------------------------
/C/break.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/C/break.exe
--------------------------------------------------------------------------------
/C/cp.c:
--------------------------------------------------------------------------------
1 | #include
2 | int linearSearch(int arr[], int size, int element)
3 | {
4 | for (int i = 0; i < size; i++)
5 | {
6 | if (arr[i] == element)
7 | {
8 | return i;
9 | }
10 | }
11 | return -1;
12 | }
13 |
14 | int main()
15 | {
16 | int arr[] = {1,3,5,56,4,3,23,5,4,54634,56,34};
17 | int size = sizeof(arr)/sizeof(int);
18 | int element = 56;
19 | int searchIndex = binarySearch(arr, size, element);
20 | printf("The element %d was found at index %d \n", element, searchIndex);
21 | return 0;
22 | }
--------------------------------------------------------------------------------
/C/delete_third.c:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | struct node
4 | {
5 | int data;
6 | struct node *prev;
7 | struct node *next;
8 | } * head;
9 | void Display()
10 | {
11 | struct node *n;
12 | n = head;
13 | while (n != NULL)
14 | {
15 | printf("%d ", n->data);
16 | n = n->next;
17 | }
18 | printf("\n");
19 | }
20 | int main()
21 | {
22 | struct node *first, *second, *third, *fourth, *n, *p;
23 | int i = 1;
24 | head = (struct node *)malloc(sizeof(struct node));
25 | first = (struct node *)malloc(sizeof(struct node));
26 | second = (struct node *)malloc(sizeof(struct node));
27 | third = (struct node *)malloc(sizeof(struct node));
28 | fourth = (struct node *)malloc(sizeof(struct node));
29 | n = head;
30 | head->prev = NULL;
31 | first->prev = head;
32 | second->prev = first;
33 | third->prev = second;
34 | fourth->prev = third;
35 | head->next = first;
36 | first->next = second;
37 | second->next = third;
38 | third->next = fourth;
39 | fourth->next = NULL;
40 | head->data = 5;
41 | first->data = 10;
42 | second->data = 15;
43 | third->data = 20;
44 | fourth->data = 25;
45 |
46 | printf("Before Deletion: ");
47 | Display();
48 | while (i != 3)
49 | {
50 | p = n;
51 | n = n->next;
52 | i++;
53 | }
54 | p->next = n->next;
55 | n->next->prev = p;
56 | free(n);
57 | n = NULL;
58 | printf("After Deletion: ");
59 | Display();
60 | return 0;
61 | }
62 |
--------------------------------------------------------------------------------
/C/delete_third.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/C/delete_third.exe
--------------------------------------------------------------------------------
/C/do_while_loop.c:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | int main(){
4 |
5 | int i = 0;
6 | do{
7 | i=i+2;
8 | printf("%d\n" , i);
9 |
10 | }while(i<=9);
11 |
12 | return 0;
13 | }
--------------------------------------------------------------------------------
/C/do_while_loop.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/C/do_while_loop.exe
--------------------------------------------------------------------------------
/C/doublylinklist.c:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | struct node
4 | {
5 | int data;
6 | struct node *pre;
7 | struct node *next;
8 | };
9 | struct node *head;
10 |
11 | void insert_at_begning()
12 | {
13 | struct node *new;
14 | new = (struct node *)malloc(sizeof(struct node));
15 | printf("enter the data for new node ");
16 | scanf("%d", &new->data);
17 | new->pre = NULL;
18 | new->next = head;
19 | head = new;
20 | }
21 |
22 | int main()
23 | {
24 |
25 | struct node *first;
26 | struct node *second;
27 | struct node *third;
28 | struct node *p;
29 | head = (struct node *)malloc(sizeof(struct node));
30 | first = (struct node *)malloc(sizeof(struct node));
31 | second = (struct node *)malloc(sizeof(struct node));
32 | third = (struct node *)malloc(sizeof(struct node));
33 |
34 | head->data = 30;
35 | first->data = 40;
36 | second->data = 45;
37 | third->data = 75;
38 | head->pre = NULL;
39 | head->next = first;
40 | first->pre = head;
41 | first->next = second;
42 | second->pre = first;
43 | second->next = third;
44 | third->pre = second;
45 | third->next = NULL;
46 | insert_at_begning();
47 |
48 | p = head;
49 |
50 | while (p != NULL)
51 | {
52 | printf("%d ", p->data);
53 | p = p->next;
54 | }
55 |
56 |
57 | return 0;
58 | }
--------------------------------------------------------------------------------
/C/doublylinklist.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/C/doublylinklist.exe
--------------------------------------------------------------------------------
/C/dsa.c:
--------------------------------------------------------------------------------
1 | // stack push / pop
2 | #include
3 |
4 | void PUSH(int S[], int top)
5 | {
6 | int x;
7 | printf("Enter an element: ");
8 | scanf("%d", &x);
9 | S[top] = x;
10 | }
11 | void pop(int s[], int top)
12 | {
13 | int x;
14 | x = s[top];
15 | printf("deleted element is %d", x);
16 | }
17 | void Display(int s[], int top)
18 | {
19 | int i;
20 | for (i = top; i >= 0; i--)
21 | {
22 | printf("%d\n", s[i]);
23 | }
24 | }
25 |
26 | int main()
27 | {
28 | int top = -1, n, x, choice, i;
29 | printf("enter the size of stack");
30 | scanf("%d", &n);
31 | int s[n];
32 | for (i = 1; i = 1; i = 1)
33 | {
34 | printf("\n menu for stack\n1.push\n2.pop\n3.Display\n4.Exit\nenter what you wnat to do ");
35 | scanf("%d", &choice);
36 | if (choice == 1)
37 | {
38 | if (top == n - 1)
39 | {
40 | printf("stack overflow");
41 | }
42 | else
43 | {
44 | top++;
45 | PUSH(s, top);
46 | }
47 | }
48 | else if (choice == 2)
49 | {
50 | if (top == -1)
51 | {
52 | printf("stack underflow");
53 | }
54 | else
55 | {
56 | pop(s, top);
57 | top--;
58 | }
59 | }
60 | else if (choice == 3)
61 | {
62 | if (top == -1)
63 | {
64 | printf("nothing to display");
65 | }
66 | else
67 | {
68 | Display(s, top);
69 | }
70 | }
71 | else if (choice == 4)
72 | {
73 | printf("thanks for choosing me ");
74 | break;
75 | }
76 | else if (choice > 4 || choice < 1)
77 | printf("the no is invalid");
78 | }
79 |
80 | return 0;
81 | }
--------------------------------------------------------------------------------
/C/dsa.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/C/dsa.exe
--------------------------------------------------------------------------------
/C/dym.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/C/dym.c
--------------------------------------------------------------------------------
/C/dym.js:
--------------------------------------------------------------------------------
1 |
2 | importReact, { useEffect } from'react';
3 | importtwitterLogo from'./assets/twitter-logo.svg';
4 | import'./App.css';
5 | // ConstantsconstTWITTER_HANDLE= '_buildspace';
6 | constTWITTER_LINK= `https://twitter.com/${TWITTER_HANDLE}`;
7 | constApp= () => {
8 | // ActionsconstcheckIfWalletIsConnected= async() => {
9 | try{
10 | const{ solana } = window;
11 | if(solana) {
12 | if(solana.isPhantom) {
13 | console.log('Phantom wallet found!');
14 | constresponse = awaitsolana.connect({ onlyIfTrusted: true});
15 | console.log(
16 | 'Connected with Public Key:',
17 | response.publicKey.toString()
18 | );
19 | }
20 | } else{
21 | alert('Solana object not found! Get a Phantom Wallet :ghost:');
22 | }
23 | } catch(error) {
24 | console.error(error);
25 | }
26 | };
27 | /*
28 | * Let's define this method so our code doesn't break.
29 | * We will write the logic for this next!
30 | */constconnectWallet= async() => {};
31 | /*
32 | * We want to render this UI when the user hasn't connected
33 | * their wallet to our app yet.
34 | */constrenderNotConnectedContainer= () => (
35 | Connect to Wallet
36 | );
37 | // UseEffectsuseEffect(() =>{
38 | constonLoad= async() => {
39 | awaitcheckIfWalletIsConnected();
40 | };
41 | window.addEventListener('load', onLoad);
42 | return() =>window.removeEventListener('load', onLoad);
43 | }, []);
44 | return(
45 | 🖼 GIF Portal
View your GIF collection in the metaverse :sparkles:
46 | {/* Render your connect to wallet button right here */}
47 | {renderNotConnectedContainer()}
48 | {`built on @${TWITTER_HANDLE}`});
49 | };
50 | exportdefaultApp;
--------------------------------------------------------------------------------
/C/exam.c:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | int main(){
4 | // int i , n , fact = 1;
5 | // printf("enter the number ");
6 | // scanf("%d" ,&n);
7 | // for(i=1; i<=n ; i++)
8 | // {
9 | // fact = fact * i;
10 | // }
11 | // printf("%d" , fact );
12 |
13 |
14 | //prime no.
15 | int i , n ;
16 | printf("enter the number");
17 | scanf("%d" , &n);
18 | for(i=2 ; i
2 |
3 | int main(){
4 | printf("enter the number");
5 |
6 | return 0;
7 | }
--------------------------------------------------------------------------------
/C/exam3.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/C/exam3.exe
--------------------------------------------------------------------------------
/C/factfunction.c:
--------------------------------------------------------------------------------
1 | #include
2 | int factorial(int n)
3 | {
4 | int i, fact = 1;
5 | for (i= 1 ; i<=n ; i++ )
6 | {
7 | fact = fact *i;}
8 |
9 | return fact;
10 | }
11 |
12 |
13 | int main(){
14 | int n , f ;
15 | printf("enter the number");
16 | scanf("%d" , &n);
17 | f = factorial(n);
18 | printf("%d" , f);
19 |
20 | return 0;
21 | }
--------------------------------------------------------------------------------
/C/factfunction.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/C/factfunction.exe
--------------------------------------------------------------------------------
/C/factorial_function.c:
--------------------------------------------------------------------------------
1 | #include
2 | int natural(int a)
3 | {
4 | int sum = 0 ;
5 | if(a>0){
6 |
7 |
8 | sum = sum + a + natural(a-1) ;
9 | return sum;}
10 | }
11 | int main ()
12 | {
13 | int n = 25 , f;
14 |
15 | f = natural(n);
16 | printf("the sum of natural no is %d " , f);
17 | return 0;
18 | }
--------------------------------------------------------------------------------
/C/factorial_function.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/C/factorial_function.exe
--------------------------------------------------------------------------------
/C/faran_function.c:
--------------------------------------------------------------------------------
1 | #include
2 | void add(int a , int b , int c)
3 | {
4 | int d ;
5 | d = a + b + c ;
6 | printf ("%d\n" , d);
7 |
8 |
9 |
10 | }
11 |
12 |
13 | int main(){
14 | int a = 10 , b = 20 , c = 40, f;
15 | add(a , b , c);
16 |
17 |
18 |
19 |
20 | return 0;
21 | }
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/C/faran_function.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/C/faran_function.exe
--------------------------------------------------------------------------------
/C/flag.py:
--------------------------------------------------------------------------------
1 | import turtle
2 | from turtle import*
3 |
4 | #screen for output
5 | screen = turtle.Screen()
6 |
7 | # Defining a turtle Instance
8 | t = turtle.Turtle()
9 | speed(0)
10 |
11 | # initially penup()
12 | t.penup()
13 | t.goto(-400, 250)
14 | t.pendown()
15 |
16 | # Orange Rectangle
17 | #white rectangle
18 | t.color("orange")
19 | t.begin_fill()
20 | t.forward(800)
21 | t.right(90)
22 | t.forward(167)
23 | t.right(90)
24 | t.forward(800)
25 | t.end_fill()
26 | t.left(90)
27 | t.forward(167)
28 |
29 | # Green Rectangle
30 | t.color("green")
31 | t.begin_fill()
32 | t.forward(167)
33 | t.left(90)
34 | t.forward(800)
35 | t.left(90)
36 | t.forward(167)
37 | t.end_fill()
38 |
39 | # Big Blue Circle
40 | t.penup()
41 | t.goto(70, 0)
42 | t.pendown()
43 | t.color("navy")
44 | t.begin_fill()
45 | t.circle(70)
46 | t.end_fill()
47 |
48 | # Big White Circle
49 | t.penup()
50 | t.goto(60, 0)
51 | t.pendown()
52 | t.color("white")
53 | t.begin_fill()
54 | t.circle(60)
55 | t.end_fill()
56 |
57 | # Mini Blue Circles
58 | t.penup()
59 | t.goto(-57, -8)
60 | t.pendown()
61 | t.color("navy")
62 | for i in range(24):
63 | t.begin_fill()
64 | t.circle(3)
65 | t.end_fill()
66 | t.penup()
67 | t.forward(15)
68 | t.right(15)
69 | t.pendown()
70 |
71 | # Small Blue Circle
72 | t.penup()
73 | t.goto(20, 0)
74 | t.pendown()
75 | t.begin_fill()
76 | t.circle(20)
77 | t.end_fill()
78 | # Spokes
79 | t.penup()
80 | t.goto(0, 0)
81 | t.pendown()
82 | t.pensize(2)
83 | for i in range(24):
84 | t.forward(60)
85 | t.backward(60)
86 | t.left(15)
87 |
88 | #to hold the
89 | #output window
90 | turtle.done()
91 |
--------------------------------------------------------------------------------
/C/function.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/C/function.exe
--------------------------------------------------------------------------------
/C/hello.c:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | int main(){
4 | printf("hello world ");
5 | return 0;
6 | }
--------------------------------------------------------------------------------
/C/hello.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/C/hello.exe
--------------------------------------------------------------------------------
/C/lefttringlestsrprint.c:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | int main(){
4 | int i , j ,num , k ,m;
5 | printf("enter the number of rows");
6 | scanf("%d" , &num);
7 | for(i=0 ; ii ; j--)
9 | {
10 | printf(" ");
11 | }
12 |
13 |
14 | for (k=0 ; k<=i ;k++)
15 | {
16 | printf("*" );
17 | }
18 | for(m=0; m
2 | #include
3 |
4 | struct node
5 | {
6 | int data;
7 | struct node* next;
8 | };
9 |
10 | struct node* insert_at_beginning(struct node* head)
11 | {
12 | struct node *p;
13 | p=(struct node *)malloc(sizeof(struct node));
14 |
15 | printf("Enter an element: ");
16 | scanf("%d",&p->data);
17 |
18 | if(head==NULL)
19 | {
20 | head=p;
21 | }
22 | else
23 | {
24 | p->next=head;
25 | head=p;
26 | }
27 |
28 | return head;
29 | }
30 |
31 | int main()
32 | {
33 | struct node* head;
34 | struct node* first;
35 | struct node* second;
36 | struct node* n;
37 |
38 | head=(struct node *)malloc(sizeof(struct node));
39 | first=(struct node *)malloc(sizeof(struct node));
40 | second=(struct node *)malloc(sizeof(struct node));
41 |
42 | n=head;
43 |
44 | head->data=10;
45 | first->data=20;
46 | second->data=30;
47 |
48 | head->next=first;
49 | first->next=second;
50 | second->next=NULL;
51 |
52 | printf("Before inserting:\n");
53 | while(n!=NULL)
54 | {
55 | printf("%d ",n->data);
56 | n=n->next;
57 | }
58 | printf("\n");
59 |
60 | n = insert_at_beginning(head);
61 |
62 | printf("After inserting:\n");
63 | while(n!=NULL)
64 | {
65 | printf("%d ",n->data);
66 | n=n->next;
67 | }
68 |
69 |
70 | return 0;
71 | }
--------------------------------------------------------------------------------
/C/linkedlist.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/C/linkedlist.exe
--------------------------------------------------------------------------------
/C/linklist.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/C/linklist.exe
--------------------------------------------------------------------------------
/C/loop.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/C/loop.exe
--------------------------------------------------------------------------------
/C/ls.c:
--------------------------------------------------------------------------------
1 | #include
2 | int linear_searching(int arr[], int x, int N)
3 | {
4 | for (int i = 1; i <= N; i++)
5 | {
6 | if (arr[i] == x)
7 | {
8 | return i;
9 | }
10 | return -1;
11 | }
12 | }
13 | int main()
14 | {
15 | int arr[] = {6, 9, 4, 7, 5, 1};
16 | int x = 5;
17 | int N = sizeof(arr) / sizeof(int);
18 | int searchIndex = linear_searching(arr, x, N);
19 | printf("The element %d was found at index %d \n", x, searchIndex);
20 | return 0;
21 | }
22 |
--------------------------------------------------------------------------------
/C/ls.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/C/ls.exe
--------------------------------------------------------------------------------
/C/mirror_image.c:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | struct node{
4 | int data;
5 | struct node *left;
6 | struct node *right;
7 | };
8 | void insertionLeft(struct node* insertLeft)
9 | {
10 | struct node* new;
11 | new = (struct node*)malloc(sizeof(struct node));
12 | new->left=NULL;
13 | new->right=NULL;
14 | printf("Enter an element: ");
15 | scanf("%d",&new->data);
16 | insertLeft->left = new;
17 | return;
18 | }
19 | void insertionRight(struct node* insertRight)
20 | {
21 | struct node* new;
22 | new = (struct node*)malloc(sizeof(struct node));
23 | new->left=NULL;
24 | new->right=NULL;
25 | printf("Enter an element: ");
26 | scanf("%d",&new->data);
27 | insertRight->right = new;
28 | return;
29 | }
30 | void Inorder(struct node* print)
31 | {
32 | if(print!=NULL)
33 | {
34 | Inorder(print->left);
35 | printf("%d ",print->data);
36 | Inorder(print->right);
37 | }
38 | }
39 | void mirrorImage(struct node* twist)
40 | {
41 | if(twist==NULL)
42 | {
43 | return;
44 | }
45 | struct node* temp;
46 | mirrorImage(twist->left);
47 | mirrorImage(twist->right);
48 | temp=twist->left;
49 | twist->left=twist->right;
50 | twist->right=temp;
51 | }
52 | int main(){
53 | struct node* root;
54 | root = (struct node*)malloc(sizeof(struct node));
55 | printf("Enter an element: ");
56 | scanf("%d",&root->data);
57 | insertionLeft(root);
58 | insertionRight(root);
59 | insertionLeft(root->left);
60 | insertionRight(root->left);
61 | insertionLeft(root->right);
62 | insertionRight(root->right);
63 | insertionLeft(root->left->left);
64 | insertionRight(root->left->left);
65 | insertionLeft(root->left->right);
66 | insertionRight(root->left->right);
67 | insertionLeft(root->right->left);
68 | insertionRight(root->right->left);
69 | insertionLeft(root->right->right);
70 | insertionRight(root->right->right);
71 | printf("Real Image: ");
72 | Inorder(root);
73 | mirrorImage(root);
74 | printf("\nMirror Image: ");
75 | Inorder(root);
76 | return 0 ;
77 | }
--------------------------------------------------------------------------------
/C/mirror_image.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/C/mirror_image.exe
--------------------------------------------------------------------------------
/C/prime.c:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | int main(){
4 | int i =2 , num ;
5 | printf("enter the number");
6 | scanf("%d" , &num);
7 | for (i = 2 ; i<=num-1 ;i++)
8 | {
9 | if (num%i==0)
10 | {
11 | printf("no is not prime");
12 | break;}
13 | else if (i==num-1){
14 | printf("no is prime");}
15 | }
16 |
17 | return 0;
18 | }
--------------------------------------------------------------------------------
/C/prime.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/C/prime.exe
--------------------------------------------------------------------------------
/C/primef.c:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | int main(){
4 | int i , j , flag =0;
5 | for(i=20 ; i<=50 ; i++)
6 | {
7 | flag = 0 ;
8 | for(j=2 ; j
2 |
3 | int main(){
4 | int i , j ,num;
5 | printf("enter the number of rows");
6 | scanf("%d" , &num);
7 | for (i=1 ; i<=num ; i++)
8 | {
9 | for(j=1 ; j<=i ; j++){
10 | printf("*");}
11 | printf("\n");
12 |
13 | }
14 |
15 | return 0;
16 | }
--------------------------------------------------------------------------------
/C/printingstars.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/C/printingstars.exe
--------------------------------------------------------------------------------
/C/queue.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/C/queue.exe
--------------------------------------------------------------------------------
/C/queue_.c:
--------------------------------------------------------------------------------
1 | #include
2 | void enqueue(int q[], int rear)
3 | {
4 | printf("enter the element: ");
5 | scanf("%d", &q[rear]);
6 | }
7 | void dequeue(int q[], int front)
8 | {
9 | int x = q[front];
10 | printf("Deleted element is: %d\n", x);
11 | }
12 | void display(int q[], int front, int rear)
13 | {
14 | int i;
15 | for (i = front; i <= rear; i++)
16 | {
17 | printf("%d ", q[i]);
18 | }
19 | printf("\n");
20 | }
21 | int main()
22 | {
23 | int front = -1, rear = -1, n, i = 1, choice;
24 | printf("enter the size of queue: ");
25 | scanf("%d", &n);
26 | int q[n];
27 | for (; i = 1;)
28 | {
29 | printf("Menu for queue:\n1.enqueue\n2.dequeue\n3.Display\n4.Exit\nenter what you wnat to do: ");
30 | scanf("%d", &choice);
31 | if (choice == 1)
32 | {
33 | if (rear == n - 1)
34 | {
35 | printf("overflow\n");
36 | }
37 | else if (front == -1 && rear == -1)
38 | {
39 | front = 0;
40 | rear = 0;
41 | enqueue(q, rear);
42 | }
43 | else
44 | {
45 | rear++;
46 | enqueue(q, rear);
47 | }
48 | }
49 | else if (choice == 2)
50 | {
51 | if (front == -1)
52 | {
53 | printf("underflow\n");
54 | }
55 | else if (front == rear && rear != -1)
56 | {
57 | dequeue(q, front);
58 | front = -1;
59 | rear = -1;
60 | }
61 | else
62 | {
63 | dequeue(q, front);
64 | front++;
65 | }
66 | }
67 | else if (choice == 3)
68 | {
69 | if (front == -1 && rear == -1)
70 | {
71 | printf("nothing to display\n");
72 | }
73 | else
74 | {
75 | display(q, front, rear);
76 | }
77 | }
78 | else if (choice == 4)
79 | {
80 | break;
81 | }
82 | else
83 | {
84 | printf("please choose a valid option\n");
85 |
86 | }
87 | }
88 | printf("exit sucessfully");
89 | return 0;
90 | }
--------------------------------------------------------------------------------
/C/queue_.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/C/queue_.exe
--------------------------------------------------------------------------------
/Cpp/Algorithms/sort/bubble_sort.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 |
5 | using namespace std;
6 |
7 | // Bubble sort >>
8 | /*
9 |
10 | Time Complexity = O(n^2);
11 | Adaptive = True;
12 | Recursive = False(here); // can be recursive in some approach.
13 |
14 | */
15 |
16 | void show(vector arr){
17 | for (int i=0;i& arr){
23 |
24 | for (vector::iterator iter = arr.end();iter!=arr.begin();iter--){
25 | int isSorted = 1;
26 | // cout << "iteration!" << endl;
27 | vector:: iterator a = arr.begin();
28 | vector:: iterator b = arr.begin()+1;
29 | while (b != iter){
30 | if (*b < *a){
31 | // cout << "swap!" << endl;
32 | int temp = *a;
33 | *a = *b;
34 | *b = temp;
35 | isSorted = 0;
36 | }
37 | b+=1;
38 | a+=1;
39 | }
40 | if (isSorted){
41 | break;
42 | }
43 | }
44 | }
45 |
46 | int main(){
47 | int size;
48 | cin >> size;
49 | vector arr(size);
50 | for (int i=0;i> arr[i];
52 | }
53 |
54 | cout << "SORTED ARRAY: " << endl;
55 | bubbleSort(arr);
56 | show(arr);
57 |
58 |
59 |
60 | return 0;
61 | }
--------------------------------------------------------------------------------
/Cpp/Algorithms/sort/insertion_sort.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | using namespace std;
5 |
6 | // Insertion sort.
7 | /*
8 | Time Complexity: O(n^2);
9 | Stability: True; // as we implemented it when we used arr[j] <= temp for not shifting the first number.
10 | Adaptive = True; // as when array is sorted its time complexity is O(n) i.e less than actual time complexity, means it is making use of the fact that array is sorted if it is sorted.
11 |
12 | >> comparison with Bubble sort:
13 | Bubble sort is better as if in bubble sort in one iteration we found that we do not swapped any element,
14 | then this implies that the array is "now"(after that iteration) is sorted and we stop there, but there is no such convinience in insersion sort.
15 |
16 | */
17 |
18 | void show(vector arr){
19 | for (int i=0;i& arr){
25 | for (int i=1;i=0;j--){
27 | int temp = arr[j+1];
28 | if (arr[j] > temp){
29 | arr[j+1] = arr[j];
30 | arr[j] = temp;
31 | }else if (arr[j] <= temp){
32 | arr[j+1] = temp;
33 | }
34 | }
35 | }
36 | }
37 |
38 | int main(){
39 |
40 | int size;
41 | cin >> size;
42 |
43 | vector arr(size);
44 | for (int i=0;i> arr[i];
46 | }
47 |
48 | insertionSort(arr);
49 | cout << "SHOWING SORTED ARRAY (BY INSERSION SORT): " << endl;
50 | show(arr);
51 |
52 |
53 |
54 |
55 | return 0;
56 | }
--------------------------------------------------------------------------------
/Cpp/Algorithms/sort/selection_sort.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 |
4 | using namespace std;
5 |
6 | // Selection Sort:
7 | /*
8 | Time Complexity = O(n^2);
9 | Stablity = False;
10 | Adaptive = False;
11 | Sorting in min. no. of sorts.
12 | */
13 |
14 | void show(vector arr){
15 | for (int i=0;i& arr){
21 | vector::iterator a = arr.begin();
22 |
23 | while (a != arr.end()-1){
24 | vector::iterator b = a + 1;
25 | vector::iterator smallest = a;
26 | while (b != arr.end()){
27 | if (*b < *smallest){
28 | smallest = b;
29 | }
30 | b+=1;
31 | }
32 | int temp = *a;
33 | *a = *smallest;
34 | *smallest = temp;
35 | a += 1;
36 | }
37 | }
38 |
39 | int main(){
40 | int size;
41 | cin >> size;
42 |
43 | vector arr(size);
44 | for (int i=0;i> arr[i];
46 | }
47 |
48 | selectionSort(arr);
49 | cout << "SORTED ARRAY (BY SELECTION SORT): " << endl;
50 | show(arr);
51 |
52 | return 0;
53 | }
--------------------------------------------------------------------------------
/Cpp/Reverse_Array.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | using namespace std;
3 |
4 | class Solution {
5 | public:
6 | void reverseArray(int arr[], int n) {
7 | int start = 0, end = n - 1;
8 | while (start < end) {
9 | swap(arr[start], arr[end]);
10 | start++;
11 | end--;
12 | }
13 | }
14 | };
15 |
16 | int main() {
17 | Solution sol;
18 | int arr[] = {1, 2, 3, 4, 5};
19 | int n = sizeof(arr) / sizeof(arr[0]);
20 |
21 | sol.reverseArray(arr, n);
22 |
23 | for (int i = 0; i < n; i++) {
24 | cout << arr[i] << " ";
25 | }
26 |
27 | return 0;
28 | }
--------------------------------------------------------------------------------
/Cpp/output/Reverse_Array:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/Cpp/output/Reverse_Array
--------------------------------------------------------------------------------
/Cpp/output/Reverse_Array.dSYM/Contents/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | English
7 | CFBundleIdentifier
8 | com.apple.xcode.dsym.Reverse_Array
9 | CFBundleInfoDictionaryVersion
10 | 6.0
11 | CFBundlePackageType
12 | dSYM
13 | CFBundleSignature
14 | ????
15 | CFBundleShortVersionString
16 | 1.0
17 | CFBundleVersion
18 | 1
19 |
20 |
21 |
--------------------------------------------------------------------------------
/Cpp/output/Reverse_Array.dSYM/Contents/Resources/DWARF/Reverse_Array:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/Cpp/output/Reverse_Array.dSYM/Contents/Resources/DWARF/Reverse_Array
--------------------------------------------------------------------------------
/Food_Delivery_Time_Prediction/model.pkl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/Food_Delivery_Time_Prediction/model.pkl
--------------------------------------------------------------------------------
/Food_Delivery_Time_Prediction/readme.md:
--------------------------------------------------------------------------------
1 | # Food Delivery Time Prediction Model
2 |
3 | This project is a machine learning model that predicts food delivery time based on various input factors. The model is built using XGBoost and deployed with Streamlit for a simple and interactive user interface.
4 |
5 | ## Features
6 |
7 | - **Machine Learning Model**: XGBoost-based regression model for predicting delivery times.
8 | - **User Interface**: Streamlit is used to create an interactive web application where users can input features and get predictions in real time.
9 |
10 | ## Project Structure
11 |
12 | ```bash
13 | ├── model.pkl # trained model
14 | ├── train.csv # dataset
15 | ├── main.py # Streamlit app code
16 | └── README.md # Project documentation
17 | ```
18 |
--------------------------------------------------------------------------------
/Food_Delivery_Time_Prediction/scaler.pkl:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/Food_Delivery_Time_Prediction/scaler.pkl
--------------------------------------------------------------------------------
/Go/Algorithms/sort/binaryinsertionsort.go:
--------------------------------------------------------------------------------
1 | // Binary Insertion Sort
2 | // description: Implementation of binary insertion sort in Go
3 | // details: Binary Insertion Sort is a variation of
4 | // Insertion sort in which proper location to
5 | // insert the selected element is found using the
6 | // Binary search algorithm.
7 | // ref: https://www.geeksforgeeks.org/binary-insertion-sort
8 |
9 | package sort
10 |
11 | func BinaryInsertion[T Ordered](arr []T) []T {
12 | for currentIndex := 1; currentIndex < len(arr); currentIndex++ {
13 | temporary := arr[currentIndex]
14 | low := 0
15 | high := currentIndex - 1
16 |
17 | for low <= high {
18 | mid := low + (high-low)/2
19 | if arr[mid] > temporary {
20 | high = mid - 1
21 | } else {
22 | low = mid + 1
23 | }
24 | }
25 |
26 | for itr := currentIndex; itr > low; itr-- {
27 | arr[itr] = arr[itr-1]
28 | }
29 |
30 | arr[low] = temporary
31 | }
32 | return arr
33 | }
34 |
--------------------------------------------------------------------------------
/Go/Algorithms/sort/bogosort.go:
--------------------------------------------------------------------------------
1 | // This is a pure Go implementation of the bogosort algorithm,
2 | // also known as permutation sort, stupid sort, slowsort, shotgun sort, or monkey sort.
3 | // Bogosort generates random permutations until it guesses the correct one.
4 |
5 | // More info on: https://en.wikipedia.org/wiki/Bogosort
6 |
7 | package sort
8 |
9 | import (
10 | "math/rand"
11 | )
12 |
13 | func isSorted[T Number](arr []T) bool {
14 | for i := 0; i < len(arr)-1; i++ {
15 | if arr[i] > arr[i+1] {
16 | return false
17 | }
18 | }
19 |
20 | return true
21 | }
22 |
23 | func shuffle[T Number](arr []T) {
24 | for i := range arr {
25 | j := rand.Intn(i + 1)
26 | arr[i], arr[j] = arr[j], arr[i]
27 | }
28 | }
29 |
30 | func Bogo[T Number](arr []T) []T {
31 | for !isSorted(arr) {
32 | shuffle(arr)
33 | }
34 |
35 | return arr
36 | }
37 |
--------------------------------------------------------------------------------
/Go/Algorithms/sort/bubblesort.go:
--------------------------------------------------------------------------------
1 | // Implementation of basic bubble sort algorithm
2 | // Reference: https://en.wikipedia.org/wiki/Bubble_sort
3 |
4 | package sort
5 |
6 | // Bubble is a simple generic definition of Bubble sort algorithm.
7 | func Bubble[T Ordered](arr []T) []T {
8 | swapped := true
9 | for swapped {
10 | swapped = false
11 | for i := 0; i < len(arr)-1; i++ {
12 | if arr[i+1] < arr[i] {
13 | arr[i+1], arr[i] = arr[i], arr[i+1]
14 | swapped = true
15 | }
16 | }
17 | }
18 | return arr
19 | }
20 |
--------------------------------------------------------------------------------
/Go/Algorithms/sort/bucketsort.go:
--------------------------------------------------------------------------------
1 | package sort
2 |
3 | // Bucket sorts a slice. It is mainly useful
4 | // when input is uniformly distributed over a range.
5 | func Bucket[T Number](arr []T) []T {
6 | // early return if the array too small
7 | if len(arr) <= 1 {
8 | return arr
9 | }
10 |
11 | // find the maximum and minimum elements in arr
12 | max := arr[0]
13 | min := arr[0]
14 | for _, v := range arr {
15 | if v > max {
16 | max = v
17 | }
18 | if v < min {
19 | min = v
20 | }
21 | }
22 |
23 | // create an empty bucket for each element in arr
24 | bucket := make([][]T, len(arr))
25 |
26 | // put each element in the appropriate bucket
27 | for _, v := range arr {
28 | bucketIndex := int((v - min) / (max - min) * T(len(arr)-1))
29 | bucket[bucketIndex] = append(bucket[bucketIndex], v)
30 | }
31 |
32 | // use insertion sort to sort each bucket
33 | for i := range bucket {
34 | bucket[i] = Insertion(bucket[i])
35 | }
36 |
37 | // concatenate the sorted buckets
38 | sorted := make([]T, 0, len(arr))
39 | for _, v := range bucket {
40 | sorted = append(sorted, v...)
41 | }
42 |
43 | return sorted
44 | }
45 |
--------------------------------------------------------------------------------
/Go/Algorithms/sort/circlesort.go:
--------------------------------------------------------------------------------
1 | // Package sort implements various sorting algorithms.
2 | package sort
3 |
4 | // Circle sorts an array using the circle sort algorithm.
5 | func Circle[T Ordered](arr []T) []T {
6 | if len(arr) == 0 {
7 | return arr
8 | }
9 | for doSort(arr, 0, len(arr)-1) {
10 | }
11 | return arr
12 | }
13 |
14 | // doSort is the recursive function that implements the circle sort algorithm.
15 | func doSort[T Ordered](arr []T, left, right int) bool {
16 | if left == right {
17 | return false
18 | }
19 | swapped := false
20 | low := left
21 | high := right
22 |
23 | for low < high {
24 | if arr[low] > arr[high] {
25 | arr[low], arr[high] = arr[high], arr[low]
26 | swapped = true
27 | }
28 | low++
29 | high--
30 | }
31 |
32 | if low == high && arr[low] > arr[high+1] {
33 | arr[low], arr[high+1] = arr[high+1], arr[low]
34 | swapped = true
35 | }
36 |
37 | mid := left + (right-left)/2
38 | leftHalf := doSort(arr, left, mid)
39 | rightHalf := doSort(arr, mid+1, right)
40 |
41 | return swapped || leftHalf || rightHalf
42 | }
43 |
--------------------------------------------------------------------------------
/Go/Algorithms/sort/cocktailsort.go:
--------------------------------------------------------------------------------
1 | // Implementation of Cocktail sorting
2 | // reference: https://en.wikipedia.org/wiki/Cocktail_shaker_sort
3 |
4 | package sort
5 |
6 | // Cocktail sort is a variation of bubble sort, operating in two directions (beginning to end, end to beginning)
7 | func Cocktail[T Ordered](arr []T) []T {
8 | if len(arr) == 0 { // ignore 0 length arrays
9 | return arr
10 | }
11 |
12 | swapped := true // true if swapped two or more elements in the last loop
13 | // if it loops through the array without swapping, the array is sorted
14 |
15 | // start and end indexes, this will be updated excluding already sorted elements
16 | start := 0
17 | end := len(arr) - 1
18 |
19 | for swapped {
20 | swapped = false
21 | var new_start int
22 | var new_end int
23 |
24 | for i := start; i < end; i++ { // first loop, from start to end
25 | if arr[i] > arr[i+1] { // if current and next elements are unordered
26 | arr[i], arr[i+1] = arr[i+1], arr[i] // swap two elements
27 | new_end = i
28 | swapped = true
29 | }
30 | }
31 |
32 | end = new_end
33 |
34 | if !swapped { // early exit, skipping the second loop
35 | break
36 | }
37 |
38 | swapped = false
39 |
40 | for i := end; i > start; i-- { // second loop, from end to start
41 | if arr[i] < arr[i-1] { // same process of the first loop, now going 'backwards'
42 | arr[i], arr[i-1] = arr[i-1], arr[i]
43 | new_start = i
44 | swapped = true
45 | }
46 | }
47 |
48 | start = new_start
49 | }
50 |
51 | return arr
52 | }
53 |
--------------------------------------------------------------------------------
/Go/Algorithms/sort/combSort.go:
--------------------------------------------------------------------------------
1 | // Implementation of comb sort algorithm, an improvement of bubble sort
2 | // Reference: https://www.geeksforgeeks.org/comb-sort/
3 |
4 | package sort
5 |
6 | func getNextGap(gap int) int {
7 | gap = (gap * 10) / 13
8 | if gap < 1 {
9 | return 1
10 | }
11 | return gap
12 | }
13 |
14 | // Comb is a simple sorting algorithm which is an improvement of the bubble sorting algorithm.
15 | func Comb[T Ordered](data []T) []T {
16 | n := len(data)
17 | gap := n
18 | swapped := true
19 |
20 | for gap != 1 || swapped {
21 | gap = getNextGap(gap)
22 | swapped = false
23 | for i := 0; i < n-gap; i++ {
24 | if data[i] > data[i+gap] {
25 | data[i], data[i+gap] = data[i+gap], data[i]
26 | swapped = true
27 | }
28 | }
29 | }
30 | return data
31 | }
32 |
--------------------------------------------------------------------------------
/Go/Algorithms/sort/constraints.go:
--------------------------------------------------------------------------------
1 | // Package constraints has some useful generic type constraints defined which is very similar to
2 | // [golang.org/x/exp/constraints](https://pkg.go.dev/golang.org/x/exp/constraints) package.
3 | // We refrained from using that until it gets placed into the standard library - currently
4 | // there are some questions regarding this package [ref](https://github.com/golang/go/issues/50792).
5 | package sort
6 |
7 | // Signed is a generic type constraint for all signed integers.
8 | type Signed interface {
9 | ~int | ~int8 | ~int16 | ~int32 | ~int64
10 | }
11 |
12 | // Unsigned is a generic type constraint for all unsigned integers.
13 | type Unsigned interface {
14 | ~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64
15 | }
16 |
17 | // Integer is a generic type constraint for all integers (signed and unsigned.)
18 | type Integer interface {
19 | Signed | Unsigned
20 | }
21 |
22 | // Float is a generic type constraint for all floating point types.
23 | type Float interface {
24 | ~float32 | ~float64
25 | }
26 |
27 | // Number is a generic type constraint for all numeric types in Go except Complex types.
28 | type Number interface {
29 | Integer | Float
30 | }
31 |
32 | // Ordered is a generic type constraint for all ordered data types in Go.
33 | // Loosely speaking, in mathematics a field is an ordered field if there is a "total
34 | // order" (a binary relation - in this case `<` symbol) such that we will always have
35 | // if a < b then a + c < b + c and if 0 < a, 0 < b then 0 < a.b
36 | // The idea in Go is quite similar, though only limited to Go standard types
37 | // not user defined types.
38 | type Ordered interface {
39 | Integer | ~string | Float
40 | }
41 |
--------------------------------------------------------------------------------
/Go/Algorithms/sort/countingsort.go:
--------------------------------------------------------------------------------
1 | // countingsort.go
2 | // description: Implementation of counting sort algorithm
3 | // details: A simple counting sort algorithm implementation
4 | // author [Phil](https://github.com/pschik)
5 | // see sort_test.go for a test implementation, test function TestQuickSort
6 |
7 | package sort
8 |
9 | func Count[T Integer](data []T) []T {
10 | if len(data) == 0 {
11 | return data
12 | }
13 | var aMin, aMax = data[0], data[0]
14 | for _, x := range data {
15 | if x < aMin {
16 | aMin = x
17 | }
18 | if x > aMax {
19 | aMax = x
20 | }
21 | }
22 | count := make([]int, aMax-aMin+1)
23 | for _, x := range data {
24 | count[x-aMin]++ // this is the reason for having only Integer constraint instead of Ordered.
25 | }
26 | z := 0
27 | for i, c := range count {
28 | for c > 0 {
29 | data[z] = T(i) + aMin
30 | z++
31 | c--
32 | }
33 | }
34 | return data
35 | }
36 |
--------------------------------------------------------------------------------
/Go/Algorithms/sort/cyclesort.go:
--------------------------------------------------------------------------------
1 | package sort
2 |
3 | // Cycle sort is an in-place, unstable sorting algorithm that is particularly useful
4 | // when sorting arrays containing elements with a small range of values. It is theoretically
5 | // optimal in terms of the total number of writes to the original array.
6 | func Cycle[T Number](arr []T) []T {
7 | counter, cycle, len := 0, 0, len(arr)
8 | // Early return if the array too small
9 | if len <= 1 {
10 | return arr
11 | }
12 |
13 | for cycle = 0; cycle < len-1; cycle++ {
14 | elem := arr[cycle]
15 | // Find total smaller elements to right
16 | pos := cycle
17 | for counter = cycle + 1; counter < len; counter++ {
18 | if arr[counter] < elem {
19 | pos++
20 | }
21 | }
22 | // In case this element is already in correct position, let's skip processing
23 | if pos == cycle {
24 | continue
25 | }
26 | // In case we have same elements, we want to skip to the end of that list as well, ignoring order
27 | // This makes the algorithm unstable for composite elements
28 | for elem == arr[pos] {
29 | pos++
30 | }
31 | // Now let us put the item to it's right position
32 | arr[pos], elem = elem, arr[pos]
33 |
34 | //We need to rotate the array till we have reached the start of the cycle again
35 | for pos != cycle {
36 | pos = cycle
37 | // Find smaller elements to right again
38 | for counter = cycle + 1; counter < len; counter++ {
39 | if arr[counter] < elem {
40 | pos++
41 | }
42 | }
43 | for elem == arr[pos] {
44 | pos++
45 | }
46 | //We can do this unconditionally, but the check helps prevent redundant writes to the array
47 | if elem != arr[pos] {
48 | arr[pos], elem = elem, arr[pos]
49 | }
50 | }
51 | }
52 |
53 | return arr
54 | }
55 |
--------------------------------------------------------------------------------
/Go/Algorithms/sort/exchangesort.go:
--------------------------------------------------------------------------------
1 | // Implementation of exchange sort algorithm, a variant of bubble sort
2 | // Reference: https://en.wikipedia.org/wiki/Sorting_algorithm#Exchange_sort
3 |
4 | package sort
5 |
6 | func Exchange[T Ordered](arr []T) []T {
7 | for i := 0; i < len(arr)-1; i++ {
8 | for j := i + 1; j < len(arr); j++ {
9 | if arr[i] > arr[j] {
10 | arr[i], arr[j] = arr[j], arr[i]
11 | }
12 | }
13 | }
14 |
15 | return arr
16 | }
17 |
--------------------------------------------------------------------------------
/Go/Algorithms/sort/insertionsort.go:
--------------------------------------------------------------------------------
1 | package sort
2 |
3 | func Insertion[T Ordered](arr []T) []T {
4 | for currentIndex := 1; currentIndex < len(arr); currentIndex++ {
5 | temporary := arr[currentIndex]
6 | iterator := currentIndex
7 | for ; iterator > 0 && arr[iterator-1] > temporary; iterator-- {
8 | arr[iterator] = arr[iterator-1]
9 | }
10 | arr[iterator] = temporary
11 | }
12 | return arr
13 | }
14 |
--------------------------------------------------------------------------------
/Go/Algorithms/sort/pancakesort.go:
--------------------------------------------------------------------------------
1 | package sort
2 |
3 | // Pancake sorts a slice using flip operations,
4 | // where flip refers to the idea of reversing the
5 | // slice from index `0` to `i`.
6 | func Pancake[T Ordered](arr []T) []T {
7 | // early return if the array too small
8 | if len(arr) <= 1 {
9 | return arr
10 | }
11 |
12 | // start from the end of the array
13 | for i := len(arr) - 1; i > 0; i-- {
14 | // find the index of the maximum element in arr
15 | max := 0
16 | for j := 1; j <= i; j++ {
17 | if arr[j] > arr[max] {
18 | max = j
19 | }
20 | }
21 |
22 | // if the maximum element is not at the end of the array
23 | if max != i {
24 | // flip the maximum element to the beginning of the array
25 | arr = flip(arr, max)
26 |
27 | // flip the maximum element to the end of the array by flipping the whole array
28 | arr = flip(arr, i)
29 | }
30 | }
31 |
32 | return arr
33 | }
34 |
35 | // flip reverses the input slice from `0` to `i`.
36 | func flip[T Ordered](arr []T, i int) []T {
37 | for j := 0; j < i; j++ {
38 | arr[j], arr[i] = arr[i], arr[j]
39 | i--
40 | }
41 | return arr
42 | }
43 |
--------------------------------------------------------------------------------
/Go/Algorithms/sort/patiencesort.go:
--------------------------------------------------------------------------------
1 | // Patience sorting is a sorting algorithm inspired by the card game patience.
2 | //
3 | // For more details check out those links below here:
4 | // GeeksForGeeks article : https://www.geeksforgeeks.org/patience-sorting/
5 | // Wikipedia article: https://en.wikipedia.org/wiki/Patience_sorting
6 | // authors [guuzaa](https://github.com/guuzaa)
7 | // see patiencesort.go
8 |
9 | package sort
10 |
11 | func Patience[T Ordered](arr []T) []T {
12 | if len(arr) <= 1 {
13 | return arr
14 | }
15 |
16 | var piles [][]T
17 |
18 | for _, card := range arr {
19 | left, right := 0, len(piles)
20 | for left < right {
21 | mid := left + (right-left)/2
22 | if piles[mid][len(piles[mid])-1] >= card {
23 | right = mid
24 | } else {
25 | left = mid + 1
26 | }
27 | }
28 |
29 | if left == len(piles) {
30 | piles = append(piles, []T{card})
31 | } else {
32 | piles[left] = append(piles[left], card)
33 | }
34 | }
35 |
36 | return mergePiles(piles)
37 | }
38 |
39 | func mergePiles[T Ordered](piles [][]T) []T {
40 | var ret []T
41 |
42 | for len(piles) > 0 {
43 | minID := 0
44 | minValue := piles[minID][len(piles[minID])-1]
45 |
46 | for i := 1; i < len(piles); i++ {
47 | if minValue <= piles[i][len(piles[i])-1] {
48 | continue
49 | }
50 |
51 | minValue = piles[i][len(piles[i])-1]
52 | minID = i
53 | }
54 |
55 | ret = append(ret, minValue)
56 |
57 | piles[minID] = piles[minID][:len(piles[minID])-1]
58 |
59 | if len(piles[minID]) == 0 {
60 | piles = append(piles[:minID], piles[minID+1:]...)
61 | }
62 | }
63 |
64 | return ret
65 | }
66 |
--------------------------------------------------------------------------------
/Go/Algorithms/sort/quicksort.go:
--------------------------------------------------------------------------------
1 | // quicksort.go
2 | // description: Implementation of in-place quicksort algorithm
3 | // details:
4 | // A simple in-place quicksort algorithm implementation. [Wikipedia](https://en.wikipedia.org/wiki/Quicksort)
5 | // author(s) [Taj](https://github.com/tjgurwara99)
6 | // see sort_test.go for a test implementation, test function TestQuickSort.
7 |
8 | package sort
9 |
10 | func Partition[T Ordered](arr []T, low, high int) int {
11 | index := low - 1
12 | pivotElement := arr[high]
13 | for i := low; i < high; i++ {
14 | if arr[i] <= pivotElement {
15 | index += 1
16 | arr[index], arr[i] = arr[i], arr[index]
17 | }
18 | }
19 | arr[index+1], arr[high] = arr[high], arr[index+1]
20 | return index + 1
21 | }
22 |
23 | // QuicksortRange Sorts the specified range within the array
24 | func QuicksortRange[T Ordered](arr []T, low, high int) {
25 | if len(arr) <= 1 {
26 | return
27 | }
28 |
29 | if low < high {
30 | pivot := Partition(arr, low, high)
31 | QuicksortRange(arr, low, pivot-1)
32 | QuicksortRange(arr, pivot+1, high)
33 | }
34 | }
35 |
36 | // Quicksort Sorts the entire array
37 | func Quicksort[T Ordered](arr []T) []T {
38 | QuicksortRange(arr, 0, len(arr)-1)
39 | return arr
40 | }
41 |
--------------------------------------------------------------------------------
/Go/Algorithms/sort/selectionsort.go:
--------------------------------------------------------------------------------
1 | package sort
2 |
3 | func Selection[T Ordered](arr []T) []T {
4 | for i := 0; i < len(arr); i++ {
5 | min := i
6 | for j := i + 1; j < len(arr); j++ {
7 | if arr[j] < arr[min] {
8 | min = j
9 | }
10 | }
11 |
12 | arr[i], arr[min] = arr[min], arr[i]
13 | }
14 | return arr
15 | }
16 |
--------------------------------------------------------------------------------
/Go/Algorithms/sort/shellsort.go:
--------------------------------------------------------------------------------
1 | package sort
2 |
3 | func Shell[T Ordered](arr []T) []T {
4 | for d := int(len(arr) / 2); d > 0; d /= 2 {
5 | for i := d; i < len(arr); i++ {
6 | for j := i; j >= d && arr[j-d] > arr[j]; j -= d {
7 | arr[j], arr[j-d] = arr[j-d], arr[j]
8 | }
9 | }
10 | }
11 | return arr
12 | }
13 |
--------------------------------------------------------------------------------
/Go/Algorithms/sort/simplesort.go:
--------------------------------------------------------------------------------
1 | // simplesort.go
2 | // description: Implementation of a simple sorting algorithm
3 | // details:
4 | // A simple sorting algorithm that look counter intuitive at first glance and very similar to Exchange Sort
5 | // An improved version is included with slight changes to make the sort slightly more efficient
6 | // reference: https://arxiv.org/abs/2110.01111v1
7 | // see sort_test.go for a test implementation, test function TestSimple and TestImprovedSimple
8 |
9 | package sort
10 |
11 | func Simple[T Ordered](arr []T) []T {
12 | for i := 0; i < len(arr); i++ {
13 | for j := 0; j < len(arr); j++ {
14 | if arr[i] < arr[j] {
15 | // swap arr[i] and arr[j]
16 | arr[i], arr[j] = arr[j], arr[i]
17 | }
18 | }
19 | }
20 | return arr
21 | }
22 |
23 | // ImprovedSimple is a improve SimpleSort by skipping an unnecessary comparison of the first and last.
24 | // This improved version is more similar to implementation of insertion sort
25 | func ImprovedSimple[T Ordered](arr []T) []T {
26 | for i := 1; i < len(arr); i++ {
27 | for j := 0; j < len(arr)-1; j++ {
28 | if arr[i] < arr[j] {
29 | // swap arr[i] and arr[j]
30 | arr[i], arr[j] = arr[j], arr[i]
31 | }
32 | }
33 | }
34 | return arr
35 | }
36 |
--------------------------------------------------------------------------------
/Go/Algorithms/sort/timsort.go:
--------------------------------------------------------------------------------
1 | // Implementation of Timsort algorithm
2 | // Reference: https://en.wikipedia.org/wiki/Timsort
3 |
4 | package sort
5 |
6 | const runSizeThreshold = 8
7 |
8 | // Timsort is a simple generic implementation of Timsort algorithm.
9 | func Timsort[T Ordered](data []T) []T {
10 | runSize := calculateRunSize(len(data))
11 | insertionSortRuns(data, runSize)
12 | mergeRuns(data, runSize)
13 | return data
14 | }
15 |
16 | // calculateRunSize returns a run size parameter that is further used
17 | // to slice the data slice.
18 | func calculateRunSize(dataLength int) int {
19 | remainder := 0
20 | for dataLength >= runSizeThreshold {
21 | if dataLength%2 == 1 {
22 | remainder = 1
23 | }
24 |
25 | dataLength = dataLength / 2
26 | }
27 |
28 | return dataLength + remainder
29 | }
30 |
31 | // insertionSortRuns runs insertion sort on all the data runs one by one.
32 | func insertionSortRuns[T Ordered](data []T, runSize int) {
33 | for lower := 0; lower < len(data); lower += runSize {
34 | upper := lower + runSize
35 | if upper >= len(data) {
36 | upper = len(data)
37 | }
38 |
39 | Insertion(data[lower:upper])
40 | }
41 | }
42 |
43 | // mergeRuns merge sorts all the data runs into a single sorted data slice.
44 | func mergeRuns[T Ordered](data []T, runSize int) {
45 | for size := runSize; size < len(data); size *= 2 {
46 | for lowerBound := 0; lowerBound < len(data); lowerBound += size * 2 {
47 | middleBound := lowerBound + size - 1
48 | upperBound := lowerBound + 2*size - 1
49 | if len(data)-1 < upperBound {
50 | upperBound = len(data) - 1
51 | }
52 |
53 | mergeRun(data, lowerBound, middleBound, upperBound)
54 | }
55 | }
56 | }
57 |
58 | // mergeRun uses merge sort to sort adjacent data runs.
59 | func mergeRun[T Ordered](data []T, lower, mid, upper int) {
60 | left := data[lower : mid+1]
61 | right := data[mid+1 : upper+1]
62 | merged := merge(left, right)
63 | // rewrite original data slice values with sorted values from merged slice
64 | for i, value := range merged {
65 | data[lower+i] = value
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/Java/Count/.gitignore:
--------------------------------------------------------------------------------
1 | ### IntelliJ IDEA ###
2 | out/
3 | !**/src/main/**/out/
4 | !**/src/test/**/out/
5 |
6 | ### Eclipse ###
7 | .apt_generated
8 | .classpath
9 | .factorypath
10 | .project
11 | .settings
12 | .springBeans
13 | .sts4-cache
14 | bin/
15 | !**/src/main/**/bin/
16 | !**/src/test/**/bin/
17 |
18 | ### NetBeans ###
19 | /nbproject/private/
20 | /nbbuild/
21 | /dist/
22 | /nbdist/
23 | /.nb-gradle/
24 |
25 | ### VS Code ###
26 | .vscode/
27 |
28 | ### Mac OS ###
29 | .DS_Store
--------------------------------------------------------------------------------
/Java/Count/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/Java/Count/.idea/.name:
--------------------------------------------------------------------------------
1 | Main.java
--------------------------------------------------------------------------------
/Java/Count/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Java/Count/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Java/Count/Count.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Java/Count/src/Main.java:
--------------------------------------------------------------------------------
1 | import java.text.DecimalFormat;
2 |
3 | public class Main {
4 | public static void main(String[] args) {
5 | DecimalFormat df = new DecimalFormat("#.######");
6 | int[] arr = {-4, 3, -9, 0, 4, 1};
7 | float[] results = Count.plusMinus(arr);
8 |
9 | // Print the results with formatting
10 | System.out.println("Negative ratio: " + df.format(results[0]));
11 | System.out.println("Positive ratio: " + df.format(results[1]));
12 | System.out.println("Zero ratio: " + df.format(results[2]));
13 |
14 | }
15 | }
16 | class Count {
17 | public static float[] plusMinus(int[] arr){
18 | int counterMin = 0;
19 | int counterPlus = 0;
20 | int counter = 0;
21 | int n = arr.length;
22 | for(int i = 0; i< arr.length; i++){
23 | if (arr[i]<0) counterMin += 1;
24 | else if (arr[i]>0) counterPlus += 1;
25 | else counter += 1;
26 | }
27 | return new float[]{(float) counterMin/n, (float) counterPlus/n,(float) counter/n};
28 | }
29 | }
30 |
31 |
--------------------------------------------------------------------------------
/Java/Inputs.java:
--------------------------------------------------------------------------------
1 | package basics;
2 |
3 | import java.util.Scanner;
4 |
5 | public class Inputs {
6 | public static void main(String[] args) {
7 | Scanner input = new Scanner(System.in) ;
8 | System.out.println("enter your rollno");
9 | int roll_no = input.nextInt();
10 | System.out.println("Your rollno is " + roll_no);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/Java/Main.java:
--------------------------------------------------------------------------------
1 | package basics;
2 |
3 | import java.util.Scanner;
4 |
5 | public class Main {
6 | public static void main(String[] args) {
7 | System.out.println("Enter your thoughts");
8 | Scanner input = new Scanner(System.in);
9 | System.out.println(input.nextLine());
10 | }
11 | }
--------------------------------------------------------------------------------
/Java/PizzaOrdering/.gitignore:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/Java/PizzaOrdering/cart.java:
--------------------------------------------------------------------------------
1 | import java.util.ArrayList;
2 | import java.util.Scanner;
3 |
4 | public class cart {
5 | private static ArrayList name = new ArrayList<>();
6 | private static ArrayList price = new ArrayList<>();
7 | public static void add(String[][] list, int choice) {
8 | String nameArray = list[choice][0];
9 | String priceArray = list[choice][1];
10 | name.add(nameArray);
11 | price.add(priceArray);
12 | }
13 | public static void display() {
14 | while (true) {
15 | double sum = 0;
16 | System.out.println();
17 | System.out.println("--------------------- User's Cart ---------------------");
18 | for (int i = 0; i < name.size(); i++) {
19 | char rs = '₹';
20 | System.out.printf(i + 1 + ". " + "%50s", name.get(i) + " " + rs + Double.parseDouble(price.get(i)));
21 | System.out.println();
22 | sum += Double.parseDouble(price.get(i));
23 | }
24 |
25 | System.out.println("----------------------- Summary ----------------------");
26 | System.out.println("Total Items Added: " + name.size());
27 | System.out.println("Grand Total (incl. TAX): ₹" + sum);
28 |
29 |
30 | System.out.println("Enter 0 for going back");
31 | Scanner scanner = new Scanner(System.in);
32 | int choice = Integer.parseInt(scanner.nextLine());
33 | if (choice == 0) {
34 | System.out.println("Going back...");
35 | break;
36 |
37 | } else {
38 | System.out.println("Absurd value entered, please try again");
39 |
40 | }
41 | }
42 | main.mainMenuLoader();
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/Java/PizzaOrdering/main.java:
--------------------------------------------------------------------------------
1 | import java.util.Scanner;
2 |
3 | public class main {
4 | public static final String[] optionList = {"Steal Deals", "Pizzas", "Sides", "Desserts and Drinks"};
5 |
6 | public static void main(String[] args) {
7 | String welcome = "************ Welcome to Pizza Jhopri! ************";
8 | System.out.println(welcome);
9 | System.out.println("");
10 |
11 | String menuWelcome = "********** What would you like to have! **********";
12 | System.out.println(menuWelcome);
13 | System.out.println("");
14 |
15 | mainMenuLoader();
16 |
17 | }
18 |
19 | public static void mainMenuLoader() {
20 | Scanner scanner = new Scanner(System.in);
21 | int choice =0;
22 | while (true) {
23 | int i = 0;
24 | for (String option : optionList) {
25 | i++;
26 | System.out.println(i + ". " + option);
27 | }
28 |
29 | System.out.println("Please enter the your choice, 0 to view cart");
30 | choice = Integer.parseInt(scanner.nextLine());
31 |
32 | if (choice <= 4) {
33 | break;
34 | }
35 | System.out.println("Absurd value entered, please try again");
36 | }
37 |
38 | menuParser.optionList(choice);
39 |
40 | }
41 | }
--------------------------------------------------------------------------------
/Java/PizzaOrdering/menuLoader.java:
--------------------------------------------------------------------------------
1 | import java.util.Scanner;
2 |
3 | public class menuLoader {
4 |
5 | public static void stealDeal(){
6 | //String identifer = "deal"
7 | String[][] dealList = {{"Momo Mia Meal (Veg)", "299", "Enjoy a combo of 1 Veg Momo Mia! personal pizza with 1 Pepsi PET bottle."},
8 | {"Momo Mia Meal (Non Veg)","339","Enjoy a combo of 1 Non Veg Momo Mia! personal pizza with 1 Pepsi PET bottle."},
9 | {"2 Personal Pizzas Starting @", "249","Choose any 2 of your favorite personal pizza"},
10 | {"Flavour Fun - Box of 4", "399", "Savour 4 assorted Flavour Fun Pizzas with exciting sauces: Chatpata, Cheesy, Schezwan & Classic"}};
11 | listItemsPrice(dealList);
12 |
13 | }
14 |
15 | public static void pizza() {
16 | System.out.println("pizza");
17 | }
18 |
19 | public static void sides() {
20 | System.out.println("sides");
21 | }
22 |
23 | public static void dd() {
24 | System.out.println("dessert");
25 | }
26 | public static void listItemsPrice(String[][] list) {
27 | for (int i = 0; i < list.length; i++) {
28 | String name = list[i][0];
29 | int price = Integer.parseInt(list[i][1]);
30 | char rs = '₹';
31 | System.out.printf(i+1 + ". " + "%50s", name + " " +rs+ price );
32 | System.out.println();
33 | }
34 |
35 | System.out.println("Please enter your choice to view description and configuration. 0 for going back");
36 | Scanner scanner = new Scanner(System.in);
37 | int choice = Integer.parseInt(scanner.nextLine());
38 | listItemsDescription(choice, list);
39 | }
40 | public static void listItemsDescription(int choice, String[][] list) {
41 | if (choice > list.length || choice <0) {
42 | System.out.println("Absurd value entered, please try again");
43 | listItemsPrice(list);
44 | }
45 | if (choice ==0){
46 | System.out.println("Going back...");
47 | main.mainMenuLoader();
48 | }
49 | String name = list[choice-1][0];
50 | double price = Double.parseDouble(list[choice-1][1]);
51 | String description = list[choice-1][2];
52 |
53 | System.out.println(name);
54 | System.out.println();
55 | System.out.println(description);
56 | System.out.println();
57 | System.out.println("₹" + price);
58 |
59 | System.out.println("Enter 1 for adding to cart, 0 for going back");
60 | Scanner scanner = new Scanner(System.in);
61 | int cartChoice = Integer.parseInt(scanner.nextLine());
62 | if (cartChoice == 1) {
63 | cart.add(list, choice);
64 | cart.display();
65 | }
66 | if (cartChoice == 0) {
67 | listItemsPrice(list);
68 | }
69 | else{
70 | listItemsDescription(choice, list);
71 | }
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/Java/PizzaOrdering/menuParser.java:
--------------------------------------------------------------------------------
1 | public class menuParser {
2 | public menuParser() {
3 |
4 | }
5 | public static void optionList(int j){
6 | if (j == 0){
7 | cart.display();
8 | }
9 | //System.out.println(j);
10 | int i = j-1;
11 | if (i == 0){
12 | menuLoader.stealDeal();
13 | }
14 | if (i == 1){
15 | menuLoader.pizza();
16 | }
17 | if (i == 2){
18 | menuLoader.sides();
19 | }
20 | if (i == 3){
21 | menuLoader.dd();
22 | }
23 |
24 |
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Java/Primitives.java:
--------------------------------------------------------------------------------
1 | package basics;
2 |
3 | public class Primitives {
4 | public static void main(String[] args) {
5 | // Primitive data type
6 | int roll_no = 64;
7 | char letter = 'r';
8 | float marks = 98.67f;
9 | double largeDecimal = 475674.7682;
10 | long largeInteger = 7657834657843659L;
11 | Boolean check = false;
12 |
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/Java/ReverseArray.java:
--------------------------------------------------------------------------------
1 | public class RevArr {
2 | public static void main(String[] args) {
3 | // Creating an array
4 | int [] arr = new int [] {11, 12, 13, 14, 15};
5 |
6 | // Printing the array
7 | System.out.println("Original Array:");
8 |
9 | for (int i = 0; i < arr.length; i++) {
10 | System.out.print(arr[i] + " ");
11 | }
12 |
13 | System.out.println();
14 | System.out.println();
15 |
16 | System.out.println("Reversed Array:");
17 |
18 | // Reversing and printing the array
19 | for (int i = arr.length - 1; i >= 0; i--) {
20 | System.out.print(arr[i] + " ");
21 | }
22 | }
23 | }
--------------------------------------------------------------------------------
/Java/ReverseLinkedList.java:
--------------------------------------------------------------------------------
1 | public class ReverseLinkedList {
2 | Node head;
3 |
4 | static class Node {
5 | int data;
6 | Node next;
7 |
8 | Node(int d) {
9 | data = d;
10 | next = null;
11 | }
12 | }
13 |
14 | public void append(int new_data) {
15 | Node new_node = new Node(new_data);
16 |
17 | if (head == null) {
18 | head = new_node;
19 | return;
20 | }
21 |
22 | Node last = head;
23 | while (last.next != null) {
24 | last = last.next;
25 | }
26 | last.next = new_node;
27 | }
28 |
29 | public void printList() {
30 | Node n = head;
31 | while (n != null) {
32 | System.out.print(n.data + " ");
33 | n = n.next;
34 | }
35 | System.out.println();
36 | }
37 |
38 | public void reverse() {
39 | Node prev = null;
40 | Node current = head;
41 | Node next = null;
42 |
43 | while (current != null) {
44 | next = current.next;
45 | current.next = prev;
46 | prev = current;
47 | current = next;
48 | }
49 | head = prev;
50 | }
51 |
52 | public static void main(String[] args) {
53 | ReverseLinkedList list = new ReverseLinkedList();
54 |
55 | list.append(1);
56 | list.append(2);
57 | list.append(3);
58 | list.append(4);
59 | list.append(5);
60 |
61 | System.out.println("Original linked list:");
62 | list.printList();
63 |
64 | list.reverse();
65 |
66 | System.out.println("Reversed linked list:");
67 | list.printList();
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/Java/TwoSumProblem/.gitignore:
--------------------------------------------------------------------------------
1 | ### IntelliJ IDEA ###
2 | out/
3 | !**/src/main/**/out/
4 | !**/src/test/**/out/
5 |
6 | ### Eclipse ###
7 | .apt_generated
8 | .classpath
9 | .factorypath
10 | .project
11 | .settings
12 | .springBeans
13 | .sts4-cache
14 | bin/
15 | !**/src/main/**/bin/
16 | !**/src/test/**/bin/
17 |
18 | ### NetBeans ###
19 | /nbproject/private/
20 | /nbbuild/
21 | /dist/
22 | /nbdist/
23 | /.nb-gradle/
24 |
25 | ### VS Code ###
26 | .vscode/
27 |
28 | ### Mac OS ###
29 | .DS_Store
--------------------------------------------------------------------------------
/Java/TwoSumProblem/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/Java/TwoSumProblem/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Java/TwoSumProblem/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Java/TwoSumProblem/ReverseArray.java:
--------------------------------------------------------------------------------
1 | import java.io.BufferedReader;
2 | import java.io.IOException;
3 | import java.io.InputStreamReader;
4 | import java.util.Arrays;
5 |
6 | public class ReverseArray {
7 | public static void main(String[] args) throws IOException {
8 | BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
9 |
10 | System.out.print("Enter the size of the array: ");
11 | int size = Integer.parseInt(reader.readLine());
12 | int[] array = new int[size];
13 |
14 | System.out.println("Enter " + size + " elements (separated by spaces):");
15 | String[] input = reader.readLine().split(" ");
16 |
17 | for (int i = 0; i < size; i++) {
18 | array[i] = Integer.parseInt(input[i]);
19 | }
20 |
21 | System.out.println("Original array: " + Arrays.toString(array));
22 | reverseArray(array);
23 | System.out.println("Reversed array: " + Arrays.toString(array));
24 | }
25 |
26 | // Method to reverse the array
27 | public static void reverseArray(int[] arr) {
28 | for (int left = 0, right = arr.length - 1; left < right; left++, right--) {
29 | int temp = arr[left];
30 | arr[left] = arr[right];
31 | arr[right] = temp;
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/Java/TwoSumProblem/TwoSumProblem.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Java/TwoSumProblem/src/Main.java:
--------------------------------------------------------------------------------
1 | import java.util.Arrays;
2 | import java.util.HashMap;
3 | import java.util.Map;
4 |
5 | public class Main {
6 | public static void main(String[] args) {
7 | Solution solution = new Solution();
8 | int[] nums = {3, 2, 4};
9 | int target = 7;
10 | int[] result = solution.twoSum(nums,target);
11 | if (result.length == 0)
12 | System.out.println("no Solution found");
13 | else
14 | System.out.println(Arrays.toString(result));
15 | }
16 | }
17 |
18 | class Solution{
19 | public int[] twoSum(int[] nums, int target){
20 | Map map = new HashMap<>();
21 | int[] results = new int[]{};
22 | for (int i = 0; i=5):\n",
27 | " print(\"correct\")\n",
28 | "else :\n",
29 | " print(\"lol\")"
30 | ]
31 | },
32 | {
33 | "cell_type": "code",
34 | "execution_count": null,
35 | "id": "469da5e8-6b52-43e8-bfa8-dd49f629d2da",
36 | "metadata": {},
37 | "outputs": [],
38 | "source": []
39 | }
40 | ],
41 | "metadata": {
42 | "kernelspec": {
43 | "display_name": "Python 3 (ipykernel)",
44 | "language": "python",
45 | "name": "python3"
46 | },
47 | "language_info": {
48 | "codemirror_mode": {
49 | "name": "ipython",
50 | "version": 3
51 | },
52 | "file_extension": ".py",
53 | "mimetype": "text/x-python",
54 | "name": "python",
55 | "nbconvert_exporter": "python",
56 | "pygments_lexer": "ipython3",
57 | "version": "3.11.7"
58 | }
59 | },
60 | "nbformat": 4,
61 | "nbformat_minor": 5
62 | }
63 |
--------------------------------------------------------------------------------
/Python/Loops.ipynb:
--------------------------------------------------------------------------------
1 | {
2 | "cells": [
3 | {
4 | "cell_type": "code",
5 | "execution_count": 2,
6 | "id": "a3dbd9f3-f80b-4b28-af06-2228a696d429",
7 | "metadata": {},
8 | "outputs": [
9 | {
10 | "name": "stdout",
11 | "output_type": "stream",
12 | "text": [
13 | "*\n",
14 | "**\n",
15 | "***\n",
16 | "****\n",
17 | "*****\n"
18 | ]
19 | }
20 | ],
21 | "source": [
22 | "i = 1\n",
23 | "while i <=5:\n",
24 | " print(i * \"*\")\n",
25 | " i=i+1"
26 | ]
27 | },
28 | {
29 | "cell_type": "code",
30 | "execution_count": 4,
31 | "id": "b839ad3b-00a3-43ae-bd72-bd6f9e5ddee3",
32 | "metadata": {},
33 | "outputs": [
34 | {
35 | "name": "stdout",
36 | "output_type": "stream",
37 | "text": [
38 | "*****\n",
39 | "****\n",
40 | "***\n",
41 | "**\n",
42 | "*\n"
43 | ]
44 | }
45 | ],
46 | "source": [
47 | "i = 5\n",
48 | "while i>=1:\n",
49 | " print(i * \"*\")\n",
50 | " i=i-1"
51 | ]
52 | },
53 | {
54 | "cell_type": "code",
55 | "execution_count": 7,
56 | "id": "447a5317-7a2d-4fde-a5d0-ce6be489d363",
57 | "metadata": {},
58 | "outputs": [
59 | {
60 | "name": "stdout",
61 | "output_type": "stream",
62 | "text": [
63 | "0\n",
64 | "1\n",
65 | "2\n",
66 | "3\n",
67 | "4\n"
68 | ]
69 | }
70 | ],
71 | "source": [
72 | "for i in range(5):\n",
73 | " print(i)"
74 | ]
75 | },
76 | {
77 | "cell_type": "code",
78 | "execution_count": 8,
79 | "id": "ce7180ae-e42d-4154-9748-7d884cf7b65d",
80 | "metadata": {},
81 | "outputs": [
82 | {
83 | "name": "stdout",
84 | "output_type": "stream",
85 | "text": [
86 | "1\n",
87 | "2\n",
88 | "3\n",
89 | "4\n",
90 | "5\n"
91 | ]
92 | }
93 | ],
94 | "source": [
95 | "for item in range(5):\n",
96 | " print(item + 1)"
97 | ]
98 | },
99 | {
100 | "cell_type": "code",
101 | "execution_count": null,
102 | "id": "afe131ac-985d-4404-88a6-0e53fc489959",
103 | "metadata": {},
104 | "outputs": [],
105 | "source": []
106 | }
107 | ],
108 | "metadata": {
109 | "kernelspec": {
110 | "display_name": "Python 3 (ipykernel)",
111 | "language": "python",
112 | "name": "python3"
113 | },
114 | "language_info": {
115 | "codemirror_mode": {
116 | "name": "ipython",
117 | "version": 3
118 | },
119 | "file_extension": ".py",
120 | "mimetype": "text/x-python",
121 | "name": "python",
122 | "nbconvert_exporter": "python",
123 | "pygments_lexer": "ipython3",
124 | "version": "3.11.7"
125 | }
126 | },
127 | "nbformat": 4,
128 | "nbformat_minor": 5
129 | }
130 |
--------------------------------------------------------------------------------
/Python/Simple_Tkinter_UI.ipynb:
--------------------------------------------------------------------------------
1 | {
2 | "cells": [
3 | {
4 | "cell_type": "code",
5 | "execution_count": 1,
6 | "id": "7c737733-fd71-4677-a26c-f8bc7988f877",
7 | "metadata": {},
8 | "outputs": [],
9 | "source": [
10 | "import tkinter as tk"
11 | ]
12 | },
13 | {
14 | "cell_type": "code",
15 | "execution_count": 2,
16 | "id": "21e2f7f2-d8ca-4937-a600-232bff8ee1cb",
17 | "metadata": {},
18 | "outputs": [],
19 | "source": [
20 | "def get_name():\n",
21 | " name = entry.get()\n",
22 | " print(f\"Hello, {name}!\")"
23 | ]
24 | },
25 | {
26 | "cell_type": "code",
27 | "execution_count": 3,
28 | "id": "c92c8109-ad8c-4b30-bd9c-c4dca1be0f50",
29 | "metadata": {},
30 | "outputs": [],
31 | "source": [
32 | "window = tk.Tk()\n",
33 | "tkText = tk.Label(\n",
34 | " text =\"Hello, Please enter your name:\",\n",
35 | " fg =\"white\",\n",
36 | " width=25)\n",
37 | "tkText.pack()\n",
38 | "entry = tk.Entry(fg=\"black\", bg=\"white\", width=25)\n",
39 | "entry.pack()\n",
40 | "name = entry.get()\n",
41 | "tkButton = tk.Button(\n",
42 | " text=\"Click me!\",\n",
43 | " width=20,\n",
44 | " height=1,\n",
45 | " fg =\"pink\",\n",
46 | " command=get_name)\n",
47 | "tkButton.pack()\n",
48 | "window.mainloop()"
49 | ]
50 | }
51 | ],
52 | "metadata": {
53 | "kernelspec": {
54 | "display_name": "Python 3 (ipykernel)",
55 | "language": "python",
56 | "name": "python3"
57 | },
58 | "language_info": {
59 | "codemirror_mode": {
60 | "name": "ipython",
61 | "version": 3
62 | },
63 | "file_extension": ".py",
64 | "mimetype": "text/x-python",
65 | "name": "python",
66 | "nbconvert_exporter": "python",
67 | "pygments_lexer": "ipython3",
68 | "version": "3.11.7"
69 | }
70 | },
71 | "nbformat": 4,
72 | "nbformat_minor": 5
73 | }
74 |
--------------------------------------------------------------------------------
/Python/first.ipynb:
--------------------------------------------------------------------------------
1 | {
2 | "cells": [
3 | {
4 | "cell_type": "code",
5 | "execution_count": 1,
6 | "id": "512716d6-830b-439d-8e0e-c20f7c08f5ff",
7 | "metadata": {},
8 | "outputs": [
9 | {
10 | "name": "stdout",
11 | "output_type": "stream",
12 | "text": [
13 | "dayam\n"
14 | ]
15 | }
16 | ],
17 | "source": [
18 | "print(\"dayam\")"
19 | ]
20 | },
21 | {
22 | "cell_type": "code",
23 | "execution_count": 3,
24 | "id": "6a17e981-948c-4375-8372-7d92673e9761",
25 | "metadata": {},
26 | "outputs": [
27 | {
28 | "name": "stdout",
29 | "output_type": "stream",
30 | "text": [
31 | "now i will run python\n"
32 | ]
33 | }
34 | ],
35 | "source": [
36 | "print(\"now i will run python\")"
37 | ]
38 | },
39 | {
40 | "cell_type": "code",
41 | "execution_count": 3,
42 | "id": "0817cbe9-36a5-4a7c-933b-47ffc205d68c",
43 | "metadata": {},
44 | "outputs": [
45 | {
46 | "name": "stdout",
47 | "output_type": "stream",
48 | "text": [
49 | "now i will run python\n"
50 | ]
51 | }
52 | ],
53 | "source": [
54 | "print(\"now i will learn python\")"
55 | ]
56 | },
57 | {
58 | "cell_type": "code",
59 | "execution_count": null,
60 | "id": "6a5222a8-cb66-485d-be66-dadccfded0a2",
61 | "metadata": {},
62 | "outputs": [],
63 | "source": []
64 | }
65 | ],
66 | "metadata": {
67 | "kernelspec": {
68 | "display_name": "Python 3 (ipykernel)",
69 | "language": "python",
70 | "name": "python3"
71 | },
72 | "language_info": {
73 | "codemirror_mode": {
74 | "name": "ipython",
75 | "version": 3
76 | },
77 | "file_extension": ".py",
78 | "mimetype": "text/x-python",
79 | "name": "python",
80 | "nbconvert_exporter": "python",
81 | "pygments_lexer": "ipython3",
82 | "version": "3.11.7"
83 | }
84 | },
85 | "nbformat": 4,
86 | "nbformat_minor": 5
87 | }
88 |
--------------------------------------------------------------------------------
/Python/reverse_array.py:
--------------------------------------------------------------------------------
1 | n = int(input("Enter the length of array you wanna input "))
2 | a = []
3 | for i in range(n):
4 | m = int(input(f"enter the element at {i} of the array "))
5 | a.append(m)
6 | print("The original array: ", a)
7 |
8 | print("Reversed array: ",a[::-1])
--------------------------------------------------------------------------------
/bmi_calculator/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 | migrate_working_dir/
12 |
13 | # IntelliJ related
14 | *.iml
15 | *.ipr
16 | *.iws
17 | .idea/
18 |
19 | # The .vscode folder contains launch configuration and tasks you configure in
20 | # VS Code which you may wish to be included in version control, so this line
21 | # is commented out by default.
22 | #.vscode/
23 |
24 | # Flutter/Dart/Pub related
25 | **/doc/api/
26 | **/ios/Flutter/.last_build_id
27 | .dart_tool/
28 | .flutter-plugins
29 | .flutter-plugins-dependencies
30 | .pub-cache/
31 | .pub/
32 | /build/
33 |
34 | # Symbolication related
35 | app.*.symbols
36 |
37 | # Obfuscation related
38 | app.*.map.json
39 |
40 | # Android Studio will place build artifacts here
41 | /android/app/debug
42 | /android/app/profile
43 | /android/app/release
44 |
--------------------------------------------------------------------------------
/bmi_calculator/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled and should not be manually edited.
5 |
6 | version:
7 | revision: "41456452f29d64e8deb623a3c927524bcf9f111b"
8 | channel: "stable"
9 |
10 | project_type: app
11 |
12 | # Tracks metadata for the flutter migrate command
13 | migration:
14 | platforms:
15 | - platform: root
16 | create_revision: 41456452f29d64e8deb623a3c927524bcf9f111b
17 | base_revision: 41456452f29d64e8deb623a3c927524bcf9f111b
18 | - platform: android
19 | create_revision: 41456452f29d64e8deb623a3c927524bcf9f111b
20 | base_revision: 41456452f29d64e8deb623a3c927524bcf9f111b
21 | - platform: ios
22 | create_revision: 41456452f29d64e8deb623a3c927524bcf9f111b
23 | base_revision: 41456452f29d64e8deb623a3c927524bcf9f111b
24 | - platform: linux
25 | create_revision: 41456452f29d64e8deb623a3c927524bcf9f111b
26 | base_revision: 41456452f29d64e8deb623a3c927524bcf9f111b
27 | - platform: macos
28 | create_revision: 41456452f29d64e8deb623a3c927524bcf9f111b
29 | base_revision: 41456452f29d64e8deb623a3c927524bcf9f111b
30 | - platform: web
31 | create_revision: 41456452f29d64e8deb623a3c927524bcf9f111b
32 | base_revision: 41456452f29d64e8deb623a3c927524bcf9f111b
33 | - platform: windows
34 | create_revision: 41456452f29d64e8deb623a3c927524bcf9f111b
35 | base_revision: 41456452f29d64e8deb623a3c927524bcf9f111b
36 |
37 | # User provided section
38 |
39 | # List of Local paths (relative to this file) that should be
40 | # ignored by the migrate tool.
41 | #
42 | # Files that are not part of the templates will be ignored by default.
43 | unmanaged_files:
44 | - 'lib/main.dart'
45 | - 'ios/Runner.xcodeproj/project.pbxproj'
46 |
--------------------------------------------------------------------------------
/bmi_calculator/README.md:
--------------------------------------------------------------------------------
1 | # bmi_calculator
2 |
3 | A new Flutter project.
4 |
5 | ## Getting Started
6 |
7 | This project is a starting point for a Flutter application.
8 |
9 | A few resources to get you started if this is your first Flutter project:
10 |
11 | - [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
12 | - [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)
13 |
14 | For help getting started with Flutter development, view the
15 | [online documentation](https://docs.flutter.dev/), which offers tutorials,
16 | samples, guidance on mobile development, and a full API reference.
17 |
--------------------------------------------------------------------------------
/bmi_calculator/analysis_options.yaml:
--------------------------------------------------------------------------------
1 | # This file configures the analyzer, which statically analyzes Dart code to
2 | # check for errors, warnings, and lints.
3 | #
4 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled
5 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
6 | # invoked from the command line by running `flutter analyze`.
7 |
8 | # The following line activates a set of recommended lints for Flutter apps,
9 | # packages, and plugins designed to encourage good coding practices.
10 | include: package:flutter_lints/flutter.yaml
11 |
12 | linter:
13 | # The lint rules applied to this project can be customized in the
14 | # section below to disable rules from the `package:flutter_lints/flutter.yaml`
15 | # included above or to enable additional rules. A list of all available lints
16 | # and their documentation is published at https://dart.dev/lints.
17 | #
18 | # Instead of disabling a lint rule for the entire project in the
19 | # section below, it can also be suppressed for a single line of code
20 | # or a specific dart file by using the `// ignore: name_of_lint` and
21 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file
22 | # producing the lint.
23 | rules:
24 | # avoid_print: false # Uncomment to disable the `avoid_print` rule
25 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
26 |
27 | # Additional information about this file can be found at
28 | # https://dart.dev/guides/language/analysis-options
29 |
--------------------------------------------------------------------------------
/bmi_calculator/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 | **/*.keystore
13 | **/*.jks
14 |
--------------------------------------------------------------------------------
/bmi_calculator/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id "com.android.application"
3 | id "kotlin-android"
4 | id "dev.flutter.flutter-gradle-plugin"
5 | }
6 |
7 | def localProperties = new Properties()
8 | def localPropertiesFile = rootProject.file('local.properties')
9 | if (localPropertiesFile.exists()) {
10 | localPropertiesFile.withReader('UTF-8') { reader ->
11 | localProperties.load(reader)
12 | }
13 | }
14 |
15 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
16 | if (flutterVersionCode == null) {
17 | flutterVersionCode = '1'
18 | }
19 |
20 | def flutterVersionName = localProperties.getProperty('flutter.versionName')
21 | if (flutterVersionName == null) {
22 | flutterVersionName = '1.0'
23 | }
24 |
25 | android {
26 | namespace "com.example.bmi_calculator"
27 | compileSdkVersion flutter.compileSdkVersion
28 | ndkVersion flutter.ndkVersion
29 |
30 | compileOptions {
31 | sourceCompatibility JavaVersion.VERSION_1_8
32 | targetCompatibility JavaVersion.VERSION_1_8
33 | }
34 |
35 | kotlinOptions {
36 | jvmTarget = '1.8'
37 | }
38 |
39 | sourceSets {
40 | main.java.srcDirs += 'src/main/kotlin'
41 | }
42 |
43 | defaultConfig {
44 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
45 | applicationId "com.example.bmi_calculator"
46 | // You can update the following values to match your application needs.
47 | // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
48 | minSdkVersion flutter.minSdkVersion
49 | targetSdkVersion flutter.targetSdkVersion
50 | versionCode flutterVersionCode.toInteger()
51 | versionName flutterVersionName
52 | }
53 |
54 | buildTypes {
55 | release {
56 | // TODO: Add your own signing config for the release build.
57 | // Signing with the debug keys for now, so `flutter run --release` works.
58 | signingConfig signingConfigs.debug
59 | }
60 | }
61 | }
62 |
63 | flutter {
64 | source '../..'
65 | }
66 |
67 | dependencies {}
68 |
--------------------------------------------------------------------------------
/bmi_calculator/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/bmi_calculator/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
14 |
18 |
22 |
23 |
24 |
25 |
26 |
27 |
29 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/bmi_calculator/android/app/src/main/kotlin/com/example/bmi_calculator/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.example.bmi_calculator
2 |
3 | import io.flutter.embedding.android.FlutterActivity
4 |
5 | class MainActivity: FlutterActivity() {
6 | }
7 |
--------------------------------------------------------------------------------
/bmi_calculator/android/app/src/main/res/drawable-v21/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/bmi_calculator/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/bmi_calculator/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/bmi_calculator/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/bmi_calculator/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/bmi_calculator/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/bmi_calculator/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/bmi_calculator/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/bmi_calculator/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/bmi_calculator/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/bmi_calculator/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/bmi_calculator/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/bmi_calculator/android/app/src/main/res/values-night/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/bmi_calculator/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/bmi_calculator/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/bmi_calculator/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext.kotlin_version = '1.7.10'
3 | repositories {
4 | google()
5 | mavenCentral()
6 | }
7 |
8 | dependencies {
9 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
10 | }
11 | }
12 |
13 | allprojects {
14 | repositories {
15 | google()
16 | mavenCentral()
17 | }
18 | }
19 |
20 | rootProject.buildDir = '../build'
21 | subprojects {
22 | project.buildDir = "${rootProject.buildDir}/${project.name}"
23 | }
24 | subprojects {
25 | project.evaluationDependsOn(':app')
26 | }
27 |
28 | tasks.register("clean", Delete) {
29 | delete rootProject.buildDir
30 | }
31 |
--------------------------------------------------------------------------------
/bmi_calculator/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx4G
2 | android.useAndroidX=true
3 | android.enableJetifier=true
4 |
--------------------------------------------------------------------------------
/bmi_calculator/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | zipStoreBase=GRADLE_USER_HOME
4 | zipStorePath=wrapper/dists
5 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
6 |
--------------------------------------------------------------------------------
/bmi_calculator/android/settings.gradle:
--------------------------------------------------------------------------------
1 | pluginManagement {
2 | def flutterSdkPath = {
3 | def properties = new Properties()
4 | file("local.properties").withInputStream { properties.load(it) }
5 | def flutterSdkPath = properties.getProperty("flutter.sdk")
6 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
7 | return flutterSdkPath
8 | }
9 | settings.ext.flutterSdkPath = flutterSdkPath()
10 |
11 | includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle")
12 |
13 | repositories {
14 | google()
15 | mavenCentral()
16 | gradlePluginPortal()
17 | }
18 |
19 | plugins {
20 | id "dev.flutter.flutter-gradle-plugin" version "1.0.0" apply false
21 | }
22 | }
23 |
24 | plugins {
25 | id "dev.flutter.flutter-plugin-loader" version "1.0.0"
26 | id "com.android.application" version "7.3.0" apply false
27 | }
28 |
29 | include ":app"
30 |
--------------------------------------------------------------------------------
/bmi_calculator/ios/.gitignore:
--------------------------------------------------------------------------------
1 | **/dgph
2 | *.mode1v3
3 | *.mode2v3
4 | *.moved-aside
5 | *.pbxuser
6 | *.perspectivev3
7 | **/*sync/
8 | .sconsign.dblite
9 | .tags*
10 | **/.vagrant/
11 | **/DerivedData/
12 | Icon?
13 | **/Pods/
14 | **/.symlinks/
15 | profile
16 | xcuserdata
17 | **/.generated/
18 | Flutter/App.framework
19 | Flutter/Flutter.framework
20 | Flutter/Flutter.podspec
21 | Flutter/Generated.xcconfig
22 | Flutter/ephemeral/
23 | Flutter/app.flx
24 | Flutter/app.zip
25 | Flutter/flutter_assets/
26 | Flutter/flutter_export_environment.sh
27 | ServiceDefinitions.json
28 | Runner/GeneratedPluginRegistrant.*
29 |
30 | # Exceptions to above rules.
31 | !default.mode1v3
32 | !default.mode2v3
33 | !default.pbxuser
34 | !default.perspectivev3
35 |
--------------------------------------------------------------------------------
/bmi_calculator/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 | 12.0
25 |
26 |
27 |
--------------------------------------------------------------------------------
/bmi_calculator/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/bmi_calculator/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/bmi_calculator/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/bmi_calculator/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/bmi_calculator/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/bmi_calculator/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/bmi_calculator/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/bmi_calculator/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/bmi_calculator/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 |
--------------------------------------------------------------------------------
/bmi_calculator/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/bmi_calculator/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
--------------------------------------------------------------------------------
/bmi_calculator/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/bmi_calculator/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
--------------------------------------------------------------------------------
/bmi_calculator/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/bmi_calculator/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
--------------------------------------------------------------------------------
/bmi_calculator/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/bmi_calculator/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
--------------------------------------------------------------------------------
/bmi_calculator/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/bmi_calculator/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
--------------------------------------------------------------------------------
/bmi_calculator/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/bmi_calculator/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
--------------------------------------------------------------------------------
/bmi_calculator/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/bmi_calculator/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
--------------------------------------------------------------------------------
/bmi_calculator/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/bmi_calculator/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
--------------------------------------------------------------------------------
/bmi_calculator/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/bmi_calculator/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
--------------------------------------------------------------------------------
/bmi_calculator/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/bmi_calculator/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
--------------------------------------------------------------------------------
/bmi_calculator/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/bmi_calculator/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
--------------------------------------------------------------------------------
/bmi_calculator/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/bmi_calculator/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
--------------------------------------------------------------------------------
/bmi_calculator/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/bmi_calculator/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
--------------------------------------------------------------------------------
/bmi_calculator/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/bmi_calculator/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
--------------------------------------------------------------------------------
/bmi_calculator/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/bmi_calculator/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/bmi_calculator/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 |
--------------------------------------------------------------------------------
/bmi_calculator/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/bmi_calculator/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/bmi_calculator/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/bmi_calculator/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/bmi_calculator/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/bmi_calculator/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/bmi_calculator/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.
--------------------------------------------------------------------------------
/bmi_calculator/ios/Runner/Base.lproj/LaunchScreen.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 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/bmi_calculator/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 |
--------------------------------------------------------------------------------
/bmi_calculator/ios/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleDisplayName
8 | Bmi Calculator
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | bmi_calculator
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | $(FLUTTER_BUILD_NAME)
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | $(FLUTTER_BUILD_NUMBER)
25 | LSRequiresIPhoneOS
26 |
27 | UILaunchStoryboardName
28 | LaunchScreen
29 | UIMainStoryboardFile
30 | Main
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 | UIInterfaceOrientationLandscapeLeft
35 | UIInterfaceOrientationLandscapeRight
36 |
37 | UISupportedInterfaceOrientations~ipad
38 |
39 | UIInterfaceOrientationPortrait
40 | UIInterfaceOrientationPortraitUpsideDown
41 | UIInterfaceOrientationLandscapeLeft
42 | UIInterfaceOrientationLandscapeRight
43 |
44 | CADisableMinimumFrameDurationOnPhone
45 |
46 | UIApplicationSupportsIndirectInputEvents
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/bmi_calculator/ios/Runner/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
2 |
--------------------------------------------------------------------------------
/bmi_calculator/ios/RunnerTests/RunnerTests.swift:
--------------------------------------------------------------------------------
1 | import Flutter
2 | import UIKit
3 | import XCTest
4 |
5 | class RunnerTests: XCTestCase {
6 |
7 | func testExample() {
8 | // If you add code to the Runner application, consider adding tests here.
9 | // See https://developer.apple.com/documentation/xctest for more information about using XCTest.
10 | }
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/bmi_calculator/linux/.gitignore:
--------------------------------------------------------------------------------
1 | flutter/ephemeral
2 |
--------------------------------------------------------------------------------
/bmi_calculator/linux/flutter/generated_plugin_registrant.cc:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | // clang-format off
6 |
7 | #include "generated_plugin_registrant.h"
8 |
9 |
10 | void fl_register_plugins(FlPluginRegistry* registry) {
11 | }
12 |
--------------------------------------------------------------------------------
/bmi_calculator/linux/flutter/generated_plugin_registrant.h:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | // clang-format off
6 |
7 | #ifndef GENERATED_PLUGIN_REGISTRANT_
8 | #define GENERATED_PLUGIN_REGISTRANT_
9 |
10 | #include
11 |
12 | // Registers Flutter plugins.
13 | void fl_register_plugins(FlPluginRegistry* registry);
14 |
15 | #endif // GENERATED_PLUGIN_REGISTRANT_
16 |
--------------------------------------------------------------------------------
/bmi_calculator/linux/flutter/generated_plugins.cmake:
--------------------------------------------------------------------------------
1 | #
2 | # Generated file, do not edit.
3 | #
4 |
5 | list(APPEND FLUTTER_PLUGIN_LIST
6 | )
7 |
8 | list(APPEND FLUTTER_FFI_PLUGIN_LIST
9 | )
10 |
11 | set(PLUGIN_BUNDLED_LIBRARIES)
12 |
13 | foreach(plugin ${FLUTTER_PLUGIN_LIST})
14 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin})
15 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin)
16 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $)
17 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
18 | endforeach(plugin)
19 |
20 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
21 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin})
22 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
23 | endforeach(ffi_plugin)
24 |
--------------------------------------------------------------------------------
/bmi_calculator/linux/main.cc:
--------------------------------------------------------------------------------
1 | #include "my_application.h"
2 |
3 | int main(int argc, char** argv) {
4 | g_autoptr(MyApplication) app = my_application_new();
5 | return g_application_run(G_APPLICATION(app), argc, argv);
6 | }
7 |
--------------------------------------------------------------------------------
/bmi_calculator/linux/my_application.h:
--------------------------------------------------------------------------------
1 | #ifndef FLUTTER_MY_APPLICATION_H_
2 | #define FLUTTER_MY_APPLICATION_H_
3 |
4 | #include
5 |
6 | G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION,
7 | GtkApplication)
8 |
9 | /**
10 | * my_application_new:
11 | *
12 | * Creates a new Flutter-based application.
13 | *
14 | * Returns: a new #MyApplication.
15 | */
16 | MyApplication* my_application_new();
17 |
18 | #endif // FLUTTER_MY_APPLICATION_H_
19 |
--------------------------------------------------------------------------------
/bmi_calculator/macos/.gitignore:
--------------------------------------------------------------------------------
1 | # Flutter-related
2 | **/Flutter/ephemeral/
3 | **/Pods/
4 |
5 | # Xcode-related
6 | **/dgph
7 | **/xcuserdata/
8 |
--------------------------------------------------------------------------------
/bmi_calculator/macos/Flutter/Flutter-Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "ephemeral/Flutter-Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/bmi_calculator/macos/Flutter/Flutter-Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "ephemeral/Flutter-Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/bmi_calculator/macos/Flutter/GeneratedPluginRegistrant.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | import FlutterMacOS
6 | import Foundation
7 |
8 |
9 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
10 | }
11 |
--------------------------------------------------------------------------------
/bmi_calculator/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/bmi_calculator/macos/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/bmi_calculator/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/bmi_calculator/macos/Runner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import Cocoa
2 | import FlutterMacOS
3 |
4 | @NSApplicationMain
5 | class AppDelegate: FlutterAppDelegate {
6 | override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
7 | return true
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/bmi_calculator/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "16x16",
5 | "idiom" : "mac",
6 | "filename" : "app_icon_16.png",
7 | "scale" : "1x"
8 | },
9 | {
10 | "size" : "16x16",
11 | "idiom" : "mac",
12 | "filename" : "app_icon_32.png",
13 | "scale" : "2x"
14 | },
15 | {
16 | "size" : "32x32",
17 | "idiom" : "mac",
18 | "filename" : "app_icon_32.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "32x32",
23 | "idiom" : "mac",
24 | "filename" : "app_icon_64.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "128x128",
29 | "idiom" : "mac",
30 | "filename" : "app_icon_128.png",
31 | "scale" : "1x"
32 | },
33 | {
34 | "size" : "128x128",
35 | "idiom" : "mac",
36 | "filename" : "app_icon_256.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "256x256",
41 | "idiom" : "mac",
42 | "filename" : "app_icon_256.png",
43 | "scale" : "1x"
44 | },
45 | {
46 | "size" : "256x256",
47 | "idiom" : "mac",
48 | "filename" : "app_icon_512.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "512x512",
53 | "idiom" : "mac",
54 | "filename" : "app_icon_512.png",
55 | "scale" : "1x"
56 | },
57 | {
58 | "size" : "512x512",
59 | "idiom" : "mac",
60 | "filename" : "app_icon_1024.png",
61 | "scale" : "2x"
62 | }
63 | ],
64 | "info" : {
65 | "version" : 1,
66 | "author" : "xcode"
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/bmi_calculator/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/bmi_calculator/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png
--------------------------------------------------------------------------------
/bmi_calculator/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/bmi_calculator/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png
--------------------------------------------------------------------------------
/bmi_calculator/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/bmi_calculator/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png
--------------------------------------------------------------------------------
/bmi_calculator/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/bmi_calculator/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png
--------------------------------------------------------------------------------
/bmi_calculator/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/bmi_calculator/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png
--------------------------------------------------------------------------------
/bmi_calculator/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/bmi_calculator/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png
--------------------------------------------------------------------------------
/bmi_calculator/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/bmi_calculator/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png
--------------------------------------------------------------------------------
/bmi_calculator/macos/Runner/Configs/AppInfo.xcconfig:
--------------------------------------------------------------------------------
1 | // Application-level settings for the Runner target.
2 | //
3 | // This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the
4 | // future. If not, the values below would default to using the project name when this becomes a
5 | // 'flutter create' template.
6 |
7 | // The application's name. By default this is also the title of the Flutter window.
8 | PRODUCT_NAME = bmi_calculator
9 |
10 | // The application's bundle identifier
11 | PRODUCT_BUNDLE_IDENTIFIER = com.example.bmiCalculator
12 |
13 | // The copyright displayed in application information
14 | PRODUCT_COPYRIGHT = Copyright © 2024 com.example. All rights reserved.
15 |
--------------------------------------------------------------------------------
/bmi_calculator/macos/Runner/Configs/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "../../Flutter/Flutter-Debug.xcconfig"
2 | #include "Warnings.xcconfig"
3 |
--------------------------------------------------------------------------------
/bmi_calculator/macos/Runner/Configs/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "../../Flutter/Flutter-Release.xcconfig"
2 | #include "Warnings.xcconfig"
3 |
--------------------------------------------------------------------------------
/bmi_calculator/macos/Runner/Configs/Warnings.xcconfig:
--------------------------------------------------------------------------------
1 | WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings
2 | GCC_WARN_UNDECLARED_SELECTOR = YES
3 | CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES
4 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE
5 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES
6 | CLANG_WARN_PRAGMA_PACK = YES
7 | CLANG_WARN_STRICT_PROTOTYPES = YES
8 | CLANG_WARN_COMMA = YES
9 | GCC_WARN_STRICT_SELECTOR_MATCH = YES
10 | CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES
11 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES
12 | GCC_WARN_SHADOW = YES
13 | CLANG_WARN_UNREACHABLE_CODE = YES
14 |
--------------------------------------------------------------------------------
/bmi_calculator/macos/Runner/DebugProfile.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.security.app-sandbox
6 |
7 | com.apple.security.cs.allow-jit
8 |
9 | com.apple.security.network.server
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/bmi_calculator/macos/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIconFile
10 |
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | $(FLUTTER_BUILD_NAME)
21 | CFBundleVersion
22 | $(FLUTTER_BUILD_NUMBER)
23 | LSMinimumSystemVersion
24 | $(MACOSX_DEPLOYMENT_TARGET)
25 | NSHumanReadableCopyright
26 | $(PRODUCT_COPYRIGHT)
27 | NSMainNibFile
28 | MainMenu
29 | NSPrincipalClass
30 | NSApplication
31 |
32 |
33 |
--------------------------------------------------------------------------------
/bmi_calculator/macos/Runner/MainFlutterWindow.swift:
--------------------------------------------------------------------------------
1 | import Cocoa
2 | import FlutterMacOS
3 |
4 | class MainFlutterWindow: NSWindow {
5 | override func awakeFromNib() {
6 | let flutterViewController = FlutterViewController()
7 | let windowFrame = self.frame
8 | self.contentViewController = flutterViewController
9 | self.setFrame(windowFrame, display: true)
10 |
11 | RegisterGeneratedPlugins(registry: flutterViewController)
12 |
13 | super.awakeFromNib()
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/bmi_calculator/macos/Runner/Release.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.security.app-sandbox
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/bmi_calculator/macos/RunnerTests/RunnerTests.swift:
--------------------------------------------------------------------------------
1 | import FlutterMacOS
2 | import Cocoa
3 | import XCTest
4 |
5 | class RunnerTests: XCTestCase {
6 |
7 | func testExample() {
8 | // If you add code to the Runner application, consider adding tests here.
9 | // See https://developer.apple.com/documentation/xctest for more information about using XCTest.
10 | }
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/bmi_calculator/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 in the flutter_test package. 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:bmi_calculator/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( BMICalculator());
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 |
--------------------------------------------------------------------------------
/bmi_calculator/web/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/bmi_calculator/web/favicon.png
--------------------------------------------------------------------------------
/bmi_calculator/web/icons/Icon-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/bmi_calculator/web/icons/Icon-192.png
--------------------------------------------------------------------------------
/bmi_calculator/web/icons/Icon-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/bmi_calculator/web/icons/Icon-512.png
--------------------------------------------------------------------------------
/bmi_calculator/web/icons/Icon-maskable-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/bmi_calculator/web/icons/Icon-maskable-192.png
--------------------------------------------------------------------------------
/bmi_calculator/web/icons/Icon-maskable-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/bmi_calculator/web/icons/Icon-maskable-512.png
--------------------------------------------------------------------------------
/bmi_calculator/web/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 | bmi_calculator
33 |
34 |
35 |
39 |
40 |
41 |
42 |
43 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/bmi_calculator/web/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "bmi_calculator",
3 | "short_name": "bmi_calculator",
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 | "src": "icons/Icon-maskable-192.png",
24 | "sizes": "192x192",
25 | "type": "image/png",
26 | "purpose": "maskable"
27 | },
28 | {
29 | "src": "icons/Icon-maskable-512.png",
30 | "sizes": "512x512",
31 | "type": "image/png",
32 | "purpose": "maskable"
33 | }
34 | ]
35 | }
36 |
--------------------------------------------------------------------------------
/bmi_calculator/windows/.gitignore:
--------------------------------------------------------------------------------
1 | flutter/ephemeral/
2 |
3 | # Visual Studio user-specific files.
4 | *.suo
5 | *.user
6 | *.userosscache
7 | *.sln.docstates
8 |
9 | # Visual Studio build-related files.
10 | x64/
11 | x86/
12 |
13 | # Visual Studio cache files
14 | # files ending in .cache can be ignored
15 | *.[Cc]ache
16 | # but keep track of directories ending in .cache
17 | !*.[Cc]ache/
18 |
--------------------------------------------------------------------------------
/bmi_calculator/windows/flutter/generated_plugin_registrant.cc:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | // clang-format off
6 |
7 | #include "generated_plugin_registrant.h"
8 |
9 |
10 | void RegisterPlugins(flutter::PluginRegistry* registry) {
11 | }
12 |
--------------------------------------------------------------------------------
/bmi_calculator/windows/flutter/generated_plugin_registrant.h:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | // clang-format off
6 |
7 | #ifndef GENERATED_PLUGIN_REGISTRANT_
8 | #define GENERATED_PLUGIN_REGISTRANT_
9 |
10 | #include
11 |
12 | // Registers Flutter plugins.
13 | void RegisterPlugins(flutter::PluginRegistry* registry);
14 |
15 | #endif // GENERATED_PLUGIN_REGISTRANT_
16 |
--------------------------------------------------------------------------------
/bmi_calculator/windows/flutter/generated_plugins.cmake:
--------------------------------------------------------------------------------
1 | #
2 | # Generated file, do not edit.
3 | #
4 |
5 | list(APPEND FLUTTER_PLUGIN_LIST
6 | )
7 |
8 | list(APPEND FLUTTER_FFI_PLUGIN_LIST
9 | )
10 |
11 | set(PLUGIN_BUNDLED_LIBRARIES)
12 |
13 | foreach(plugin ${FLUTTER_PLUGIN_LIST})
14 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin})
15 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin)
16 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $)
17 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
18 | endforeach(plugin)
19 |
20 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
21 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin})
22 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
23 | endforeach(ffi_plugin)
24 |
--------------------------------------------------------------------------------
/bmi_calculator/windows/runner/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.14)
2 | project(runner LANGUAGES CXX)
3 |
4 | # Define the application target. To change its name, change BINARY_NAME in the
5 | # top-level CMakeLists.txt, not the value here, or `flutter run` will no longer
6 | # work.
7 | #
8 | # Any new source files that you add to the application should be added here.
9 | add_executable(${BINARY_NAME} WIN32
10 | "flutter_window.cpp"
11 | "main.cpp"
12 | "utils.cpp"
13 | "win32_window.cpp"
14 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc"
15 | "Runner.rc"
16 | "runner.exe.manifest"
17 | )
18 |
19 | # Apply the standard set of build settings. This can be removed for applications
20 | # that need different build settings.
21 | apply_standard_settings(${BINARY_NAME})
22 |
23 | # Add preprocessor definitions for the build version.
24 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"")
25 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}")
26 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}")
27 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}")
28 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}")
29 |
30 | # Disable Windows macros that collide with C++ standard library functions.
31 | target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX")
32 |
33 | # Add dependency libraries and include directories. Add any application-specific
34 | # dependencies here.
35 | target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app)
36 | target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib")
37 | target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}")
38 |
39 | # Run the Flutter tool portions of the build. This must not be removed.
40 | add_dependencies(${BINARY_NAME} flutter_assemble)
41 |
--------------------------------------------------------------------------------
/bmi_calculator/windows/runner/flutter_window.cpp:
--------------------------------------------------------------------------------
1 | #include "flutter_window.h"
2 |
3 | #include
4 |
5 | #include "flutter/generated_plugin_registrant.h"
6 |
7 | FlutterWindow::FlutterWindow(const flutter::DartProject& project)
8 | : project_(project) {}
9 |
10 | FlutterWindow::~FlutterWindow() {}
11 |
12 | bool FlutterWindow::OnCreate() {
13 | if (!Win32Window::OnCreate()) {
14 | return false;
15 | }
16 |
17 | RECT frame = GetClientArea();
18 |
19 | // The size here must match the window dimensions to avoid unnecessary surface
20 | // creation / destruction in the startup path.
21 | flutter_controller_ = std::make_unique(
22 | frame.right - frame.left, frame.bottom - frame.top, project_);
23 | // Ensure that basic setup of the controller was successful.
24 | if (!flutter_controller_->engine() || !flutter_controller_->view()) {
25 | return false;
26 | }
27 | RegisterPlugins(flutter_controller_->engine());
28 | SetChildContent(flutter_controller_->view()->GetNativeWindow());
29 |
30 | flutter_controller_->engine()->SetNextFrameCallback([&]() {
31 | this->Show();
32 | });
33 |
34 | // Flutter can complete the first frame before the "show window" callback is
35 | // registered. The following call ensures a frame is pending to ensure the
36 | // window is shown. It is a no-op if the first frame hasn't completed yet.
37 | flutter_controller_->ForceRedraw();
38 |
39 | return true;
40 | }
41 |
42 | void FlutterWindow::OnDestroy() {
43 | if (flutter_controller_) {
44 | flutter_controller_ = nullptr;
45 | }
46 |
47 | Win32Window::OnDestroy();
48 | }
49 |
50 | LRESULT
51 | FlutterWindow::MessageHandler(HWND hwnd, UINT const message,
52 | WPARAM const wparam,
53 | LPARAM const lparam) noexcept {
54 | // Give Flutter, including plugins, an opportunity to handle window messages.
55 | if (flutter_controller_) {
56 | std::optional result =
57 | flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam,
58 | lparam);
59 | if (result) {
60 | return *result;
61 | }
62 | }
63 |
64 | switch (message) {
65 | case WM_FONTCHANGE:
66 | flutter_controller_->engine()->ReloadSystemFonts();
67 | break;
68 | }
69 |
70 | return Win32Window::MessageHandler(hwnd, message, wparam, lparam);
71 | }
72 |
--------------------------------------------------------------------------------
/bmi_calculator/windows/runner/flutter_window.h:
--------------------------------------------------------------------------------
1 | #ifndef RUNNER_FLUTTER_WINDOW_H_
2 | #define RUNNER_FLUTTER_WINDOW_H_
3 |
4 | #include
5 | #include
6 |
7 | #include
8 |
9 | #include "win32_window.h"
10 |
11 | // A window that does nothing but host a Flutter view.
12 | class FlutterWindow : public Win32Window {
13 | public:
14 | // Creates a new FlutterWindow hosting a Flutter view running |project|.
15 | explicit FlutterWindow(const flutter::DartProject& project);
16 | virtual ~FlutterWindow();
17 |
18 | protected:
19 | // Win32Window:
20 | bool OnCreate() override;
21 | void OnDestroy() override;
22 | LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam,
23 | LPARAM const lparam) noexcept override;
24 |
25 | private:
26 | // The project to run.
27 | flutter::DartProject project_;
28 |
29 | // The Flutter instance hosted by this window.
30 | std::unique_ptr flutter_controller_;
31 | };
32 |
33 | #endif // RUNNER_FLUTTER_WINDOW_H_
34 |
--------------------------------------------------------------------------------
/bmi_calculator/windows/runner/main.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 |
5 | #include "flutter_window.h"
6 | #include "utils.h"
7 |
8 | int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev,
9 | _In_ wchar_t *command_line, _In_ int show_command) {
10 | // Attach to console when present (e.g., 'flutter run') or create a
11 | // new console when running with a debugger.
12 | if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) {
13 | CreateAndAttachConsole();
14 | }
15 |
16 | // Initialize COM, so that it is available for use in the library and/or
17 | // plugins.
18 | ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED);
19 |
20 | flutter::DartProject project(L"data");
21 |
22 | std::vector command_line_arguments =
23 | GetCommandLineArguments();
24 |
25 | project.set_dart_entrypoint_arguments(std::move(command_line_arguments));
26 |
27 | FlutterWindow window(project);
28 | Win32Window::Point origin(10, 10);
29 | Win32Window::Size size(1280, 720);
30 | if (!window.Create(L"bmi_calculator", origin, size)) {
31 | return EXIT_FAILURE;
32 | }
33 | window.SetQuitOnClose(true);
34 |
35 | ::MSG msg;
36 | while (::GetMessage(&msg, nullptr, 0, 0)) {
37 | ::TranslateMessage(&msg);
38 | ::DispatchMessage(&msg);
39 | }
40 |
41 | ::CoUninitialize();
42 | return EXIT_SUCCESS;
43 | }
44 |
--------------------------------------------------------------------------------
/bmi_calculator/windows/runner/resource.h:
--------------------------------------------------------------------------------
1 | //{{NO_DEPENDENCIES}}
2 | // Microsoft Visual C++ generated include file.
3 | // Used by Runner.rc
4 | //
5 | #define IDI_APP_ICON 101
6 |
7 | // Next default values for new objects
8 | //
9 | #ifdef APSTUDIO_INVOKED
10 | #ifndef APSTUDIO_READONLY_SYMBOLS
11 | #define _APS_NEXT_RESOURCE_VALUE 102
12 | #define _APS_NEXT_COMMAND_VALUE 40001
13 | #define _APS_NEXT_CONTROL_VALUE 1001
14 | #define _APS_NEXT_SYMED_VALUE 101
15 | #endif
16 | #endif
17 |
--------------------------------------------------------------------------------
/bmi_calculator/windows/runner/resources/app_icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anshumansinha3301/quicksort_code/5dfe629849656d72b3bf7fb85a6eb211f00350e6/bmi_calculator/windows/runner/resources/app_icon.ico
--------------------------------------------------------------------------------
/bmi_calculator/windows/runner/runner.exe.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PerMonitorV2
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/bmi_calculator/windows/runner/utils.cpp:
--------------------------------------------------------------------------------
1 | #include "utils.h"
2 |
3 | #include
4 | #include
5 | #include
6 | #include
7 |
8 | #include
9 |
10 | void CreateAndAttachConsole() {
11 | if (::AllocConsole()) {
12 | FILE *unused;
13 | if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
14 | _dup2(_fileno(stdout), 1);
15 | }
16 | if (freopen_s(&unused, "CONOUT$", "w", stderr)) {
17 | _dup2(_fileno(stdout), 2);
18 | }
19 | std::ios::sync_with_stdio();
20 | FlutterDesktopResyncOutputStreams();
21 | }
22 | }
23 |
24 | std::vector GetCommandLineArguments() {
25 | // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use.
26 | int argc;
27 | wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc);
28 | if (argv == nullptr) {
29 | return std::vector();
30 | }
31 |
32 | std::vector command_line_arguments;
33 |
34 | // Skip the first argument as it's the binary name.
35 | for (int i = 1; i < argc; i++) {
36 | command_line_arguments.push_back(Utf8FromUtf16(argv[i]));
37 | }
38 |
39 | ::LocalFree(argv);
40 |
41 | return command_line_arguments;
42 | }
43 |
44 | std::string Utf8FromUtf16(const wchar_t* utf16_string) {
45 | if (utf16_string == nullptr) {
46 | return std::string();
47 | }
48 | int target_length = ::WideCharToMultiByte(
49 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string,
50 | -1, nullptr, 0, nullptr, nullptr)
51 | -1; // remove the trailing null character
52 | int input_length = (int)wcslen(utf16_string);
53 | std::string utf8_string;
54 | if (target_length <= 0 || target_length > utf8_string.max_size()) {
55 | return utf8_string;
56 | }
57 | utf8_string.resize(target_length);
58 | int converted_length = ::WideCharToMultiByte(
59 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string,
60 | input_length, utf8_string.data(), target_length, nullptr, nullptr);
61 | if (converted_length == 0) {
62 | return std::string();
63 | }
64 | return utf8_string;
65 | }
66 |
--------------------------------------------------------------------------------
/bmi_calculator/windows/runner/utils.h:
--------------------------------------------------------------------------------
1 | #ifndef RUNNER_UTILS_H_
2 | #define RUNNER_UTILS_H_
3 |
4 | #include
5 | #include
6 |
7 | // Creates a console for the process, and redirects stdout and stderr to
8 | // it for both the runner and the Flutter library.
9 | void CreateAndAttachConsole();
10 |
11 | // Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string
12 | // encoded in UTF-8. Returns an empty std::string on failure.
13 | std::string Utf8FromUtf16(const wchar_t* utf16_string);
14 |
15 | // Gets the command line arguments passed in as a std::vector,
16 | // encoded in UTF-8. Returns an empty std::vector on failure.
17 | std::vector GetCommandLineArguments();
18 |
19 | #endif // RUNNER_UTILS_H_
20 |
--------------------------------------------------------------------------------
/quicksort.c:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | // Function to swap two elements
4 | void swap(int* a, int* b) {
5 | int temp = *a;
6 | *a = *b;
7 | *b = temp;
8 | }
9 |
10 | // Partition function to place the pivot element at its correct position
11 | int partition(int arr[], int low, int high) {
12 | int pivot = arr[high]; // Choose the rightmost element as pivot
13 | int i = (low - 1); // Index of smaller element
14 |
15 | for (int j = low; j <= high - 1; j++) {
16 | if (arr[j] < pivot) { // If current element is smaller than the pivot
17 | i++; // Increment index of smaller element
18 | swap(&arr[i], &arr[j]);
19 | }
20 | }
21 | swap(&arr[i + 1], &arr[high]);
22 | return (i + 1); // Return the partition index
23 | }
24 |
25 | // Quicksort function
26 | void quickSort(int arr[], int low, int high) {
27 | if (low < high) {
28 | int pi = partition(arr, low, high); // Partitioning index
29 |
30 | // Recursively sort elements before and after partition
31 | quickSort(arr, low, pi - 1);
32 | quickSort(arr, pi + 1, high);
33 | }
34 | }
35 |
36 | // Function to print the array
37 | void printArray(int arr[], int size) {
38 | for (int i = 0; i < size; i++) {
39 | printf("%d ", arr[i]);
40 | }
41 | printf("\n");
42 | }
43 |
44 | int main() {
45 | int arr[] = {10, 7, 8, 9, 1, 5};
46 | int size = sizeof(arr) / sizeof(arr[0]);
47 |
48 | printf("Original array: \n");
49 | printArray(arr, size);
50 |
51 | quickSort(arr, 0, size - 1);
52 |
53 | printf("Sorted array: \n");
54 | printArray(arr, size);
55 |
56 | return 0;
57 | }
58 |
--------------------------------------------------------------------------------
/radix sort:
--------------------------------------------------------------------------------
1 | import java.util.Arrays;
2 |
3 | public class RadixSort {
4 | // Function to get the maximum value in the array
5 | static int getMax(int[] arr, int n) {
6 | int max = arr[0];
7 | for (int i = 1; i < n; i++) {
8 | if (arr[i] > max) {
9 | max = arr[i];
10 | }
11 | }
12 | return max;
13 | }
14 |
15 | // Function to perform counting sort based on the digit represented by exp
16 | static void countSort(int[] arr, int n, int exp) {
17 | int[] output = new int[n]; // output array
18 | int[] count = new int[10];
19 | Arrays.fill(count, 0);
20 |
21 | // Store count of occurrences in count[]
22 | for (int i = 0; i < n; i++) {
23 | count[(arr[i] / exp) % 10]++;
24 | }
25 |
26 | // Change count[i] so that count[i] contains the actual position of this digit in output[]
27 | for (int i = 1; i < 10; i++) {
28 | count[i] += count[i - 1];
29 | }
30 |
31 | // Build the output array
32 | for (int i = n - 1; i >= 0; i--) {
33 | output[count[(arr[i] / exp) % 10] - 1] = arr[i];
34 | count[(arr[i] / exp) % 10]--;
35 | }
36 |
37 | // Copy the output array to arr[], so that arr[] now contains sorted numbers according to the current digit
38 | for (int i = 0; i < n; i++) {
39 | arr[i] = output[i];
40 | }
41 | }
42 |
43 | // Main function to implement radix sort
44 | static void radixSort(int[] arr, int n) {
45 | int max = getMax(arr, n);
46 |
47 | // Do counting sort for every digit. Note that instead of passing the digit number, exp is passed. exp is 10^i where i is the current digit number
48 | for (int exp = 1; max / exp > 0; exp *= 10) {
49 | countSort(arr, n, exp);
50 | }
51 | }
52 |
53 | // A utility function to print an array
54 | static void printArray(int[] arr, int n) {
55 | for (int i = 0; i < n; i++) {
56 | System.out.print(arr[i] + " ");
57 | }
58 | System.out.println();
59 | }
60 |
61 | // Driver code
62 | public static void main(String[] args) {
63 | int[] arr = {170, 45, 75, 90, 802, 24, 2, 66};
64 | int n = arr.length;
65 | radixSort(arr, n);
66 | printArray(arr, n);
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/socket/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
--------------------------------------------------------------------------------
/socket/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "socket",
3 | "version": "1.0.0",
4 | "main": "index.js",
5 | "type": "module",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "keywords": [],
10 | "author": "",
11 | "license": "ISC",
12 | "description": "",
13 | "dependencies": {
14 | "express": "^4.21.0",
15 | "socket.io": "^4.8.0"
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/socket/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | Socket io
9 |
10 |
11 |
12 | ChatApp
13 |
14 |
18 |
19 |
20 |
21 |
42 |
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/socket/public/style.css:
--------------------------------------------------------------------------------
1 | @import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');
2 |
3 | body{
4 | background-color:rgb(144, 144, 238);
5 | }
6 |
7 | h1{
8 | text-align: center;
9 | font-family: 'Poppins', sans-serif;
10 | color: rgb(230, 249, 249);
11 | }
12 |
13 | .inputMsg{
14 | display: flex;
15 | justify-content: center;
16 | align-items: center;
17 | gap: 2vh;
18 | width: 100%;
19 | height: 6vh;
20 | /* background-color: bisque; */
21 | }
22 |
23 | input{
24 | border-radius: 10px;
25 | font-family: Poppins;
26 | padding: 2vh;
27 | width: 75%;
28 | height: 2vh;
29 | border: none;
30 | }
31 |
32 | button{
33 | background-color: rgb(0, 0, 0);
34 | color: white;
35 | width: 12%;
36 | padding: 1.7vh 2vh;
37 | border: none;
38 | border-radius: 10px;
39 | font-size: 14px;
40 | font-family: Poppins;
41 | }
42 |
43 | .messages{
44 | margin-top: 40vh;
45 | /* background-color: #fff; */
46 | width: 90vw;
47 | height: 90vh;
48 | }
49 |
50 | p{
51 | color: black;
52 | }
--------------------------------------------------------------------------------
/socket/server.js:
--------------------------------------------------------------------------------
1 | import express from "express"
2 | import http from "http"
3 | import { Server } from "socket.io";
4 |
5 | const PORT = 3000;
6 | const app = express();
7 | const server = http.createServer(app);
8 | const io = new Server(server); //it'll handle the socket io
9 |
10 | app.use(express.static('./public'))
11 |
12 | app.get("/",(req,res)=>{
13 | // res.send("Hello World!")
14 | res.sendFile("index.html")
15 | })
16 |
17 | io.on('connection',(socket)=>{
18 | socket.on('chat msg',(msg)=>{
19 | // console.log(msg);
20 | io.emit('chat msg',msg);
21 | })
22 | console.log('a new client connected')
23 | })
24 |
25 | server.listen(PORT,()=>{
26 | console.log(`Server is running on port ${PORT}`);
27 | })
28 |
29 |
30 |
--------------------------------------------------------------------------------