Skip to content

Instantly share code, notes, and snippets.

@mahmmoudkinawy
mahmmoudkinawy / Traning
Created November 10, 2020 19:20
nothing
#include <iostream>
using namespace std;
int main()
{
int size = 0 ;
int sum = 0 ;
cout<<"Enter Size Of Array : ";
cin>>size;
@mahmmoudkinawy
mahmmoudkinawy / khlaf
Created November 11, 2020 08:41
none
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
@mahmmoudkinawy
mahmmoudkinawy / test
Created November 11, 2020 08:54
C++ code
#include <iostream>
using namespace std;
int main()
{
int size = 0 ;
int sum = 0 ;
cout<<"Enter Size Of Array : ";
cin>>size;
#include <iostream>
#include <algorithm>
using namespace std;
void selectionSort(int arr[] , int n)
{
int minIdx;
for(int i = 0 ; i < n - 1 ; i++){
minIdx = i ;
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
int arr[] = {10,20,-3,5,6,7,9};
int size = sizeof(arr) / sizeof(arr[0]);
@mahmmoudkinawy
mahmmoudkinawy / bubbleSort
Created December 6, 2020 12:01
Bubble Sort With Java
public static void swap(int[] arr, int index1, int index2) {
int temp = arr[index1];
arr[index1] = arr[index2];
arr[index2] = temp;
}
public static void bubbleSort(int[] arr) {
for (int i = 0; i < arr.length; i++) {
for (int j = 1; j < arr.length; j++) {
if (arr[j] < arr[j - 1]) {
public class MergeSort {
public void Sort(int[] arr) {
if (arr.length < 2) {
return;
}
int middle = arr.length / 2;
int[] left = new int[middle];
#include<iostream>
#include<windows.h>
#include<conio.h>
#include<fstream>
#include<cstring>
#include<cstdio>
#include<cstdlib>
#include<iomanip>
using namespace std;
//global variable declaration
//To run this code Just right click then Run file or shif 6
import java.util.Arrays;
public class MergeSort {
public void Sort(int[] arr) {
if (arr.length < 2) {
return;
}
#include <iostream>
#include <string>
#include <cctype>
#include <fstream>
#include <iomanip>
#include <cmath>
#include <cstdio>
#include <stdlib.h>
#define max 10