This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <time.h> | |
/**************************** BINARY SEARCH *******************************/ | |
int A[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 }; | |
int binarySearch(int Arr[], int size, int num) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/************************* Strategy Pattern ************************/ | |
<?php | |
interface SortStrategy | |
{ | |
public function sort(); | |
} | |
class QuickSort | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
************************* Addapter Pattern ************************ | |
<br>* nra hamara vor orinak mi qani tex nuyn funkcian es kanchum mekel mi or uzum es funkciayi * | |
<br>* anun@ poxes amen mekin@ arandzin arandzin chpoxes ena miangamic erku tex poxum es u verj * <br><br> | |
<?php | |
class Facebook | |
{ | |
public function posting($msg) | |
{ | |
echo "<br>Posting message..."; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* *************** BUBBLE SORT speed O(n^2) ***************** */ | |
#include <iostream> | |
int ar[] = { 5, 9, 21, 1, 34, 22, 8, 12, 0, 22, 90, 65 }; | |
int size = sizeof(ar) / sizeof(ar[0]); | |
void bubbleSort(int arr[]) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ************* SELECTION SORT speed O(n^2) *************** */ | |
#include <iostream> | |
int ar[] = { 5, 9, 21, 1, 34, 22, 8, 12, 0, 22, 90, 65 }; | |
int size = sizeof(ar) / sizeof(ar[0]); | |
int min = 0; | |
void selectionSort(int arr[]) | |
{ | |
for (int i = 0; i < size - 1; i++) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ******** INSERTION SORT O(n^2) ********* */ | |
#include <iostream> | |
int ar[] = { 5, 9, 21, 1, 34, 22, 8, 12, 0, 22, 90, 65 }; | |
int size = sizeof(ar) / sizeof(ar[0]); | |
void insertionSort(int arr[]) | |
{ | |
int j; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ********** REVERSE STRING *********** */ | |
#include <iostream> | |
int main() | |
{ | |
char str[] = "Hello world"; | |
int i = 0, j = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <cstring> | |
class MatricFactory | |
{ | |
public: | |
int** createArray(int row, int col, int initial = 0) | |
{ | |
int **arr = new int* [row]; | |
for (int i = 0; i < row; i++) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>FaceBook LogIn</title> | |
<link rel="stylesheet" href="https://bootswatch.com/flatly/bootstrap.min.css"> | |
<style media="screen"> | |
#fb-btn { | |
margin-top: 20px; | |
} |
OlderNewer