This file contains hidden or 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
# Python program for implementation of Bubble Sort | |
def bubbleSort(arr): | |
n = len(arr) | |
# Traverse through all array elements | |
for i in range(n): | |
# Last i elements are already in place | |
for j in range(0, n-i-1): |
This file contains hidden or 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
// C function to search a given key in a given BST | |
struct node* search(struct node* root, int key) | |
{ | |
// Base Cases: root is null or key is present at root | |
if (root == NULL || root->key == key) | |
return root; | |
// Key is greater than root's key | |
if (root->key < key) | |
return search(root->right, key); |
This file contains hidden or 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
# A utility function to search a given key in BST | |
def search(root,key): | |
# Base Cases: root is null or key is present at root | |
if root is None or root.val == key: | |
return root | |
# Key is greater than root's key | |
if root.val < key: | |
return search(root.right,key) |
This file contains hidden or 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
// Sort an arr[] of size n | |
insertionSort(arr, n) | |
Loop from i = 1 to n-1. | |
……a) Pick element arr[i] and insert it into sorted sequence arr[0…i-1] |
This file contains hidden or 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
Step 1 − If it is the first element, it is | |
already sorted. return 1; | |
Step 2 − Pick next element | |
Step 3 − Compare with all elements in the | |
sorted sub-list | |
Step 4 − Shift all the elements in the sorted | |
sub-list that is greater than the | |
value to be sorted | |
Step 5 − Insert the value | |
Step 6 − Repeat until list is sorted |
This file contains hidden or 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
// C program for insertion sort | |
#include <stdio.h> | |
#include <math.h> | |
/* Function to sort an array using insertion sort*/ | |
void insertionSort(int arr[], int n) | |
{ | |
int i, key, j; | |
for (i = 1; i < n; i++) | |
{ |
This file contains hidden or 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
# Python program for implementation of Insertion Sort | |
# Function to do insertion sort | |
def insertionSort(arr): | |
# Traverse through 1 to len(arr) | |
for i in range(1, len(arr)): | |
key = arr[i] | |
This file contains hidden or 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
// Java program for implementation of Insertion Sort | |
class InsertionSort | |
{ | |
/*Function to sort array using insertion sort*/ | |
void sort(int arr[]) | |
{ | |
int n = arr.length; | |
for (int i=1; i<n; ++i) | |
{ | |
int key = arr[i]; |
This file contains hidden or 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
4U | |
Claims you are a winner | |
For instant access | |
Accept credit cards | |
Claims you registered with Some Kind of Partner | |
For just $ (some amt) | |
Act now! Don’t hesitate! | |
Click below | |
Free access | |
Additional income |
This file contains hidden or 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
function shameem_comment_post( $incoming_comment ) { | |
$incoming_comment['comment_content'] = htmlspecialchars($incoming_comment['comment_content']); | |
$incoming_comment['comment_content'] = str_replace( "'", ''', $incoming_comment['comment_content'] ); | |
return( $incoming_comment ); | |
} | |
function shameem_comment_display( $comment_to_display ) { | |
$comment_to_display = str_replace( ''', "'", $comment_to_display ); | |
return $comment_to_display; | |
} | |
add_filter( 'preprocess_comment', 'shameem_comment_post', '', 1); |