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
//Binary Search Algorithm | |
func binarySearch ( inputSortedData: [Int], searchElement: Int ) -> Int { | |
var minLeft = 0 | |
var maxRight = inputSortedData.count - 1 | |
while ( minLeft <= maxRight ) { | |
let middleElement = (minLeft + maxRight) / 2 | |
if (searchElement == inputSortedData[middleElement]) { return middleElement + 1; } | |
if (searchElement < inputSortedData[middleElement]) { maxRight = middleElement - 1 } | |
if (searchElement > inputSortedData[middleElement]) { minLeft = middleElement + 1 } |
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 in Java | |
public static void bubbleSort(int[] inputData) { | |
int inputDataLength = inputData.length; | |
while (inputDataLength != 0) { | |
int newn = 0; | |
for (int forwardPointer = 1; forwardPointer < inputData.length - 1; forwardPointer++) { | |
if(inputData[forwardPointer - 1] > inputData[forwardPointer]) { | |
final int temp = inputData[forwardPointer - 1]; | |
inputData[forwardPointer - 1] = inputData[forwardPointer]; |
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 Algorithm | |
func bubbleSort(inputData: inout [Int]) { | |
var inputDataLength = inputData.count | |
while inputDataLength != 0 { | |
var newn = 0 | |
for forwardPointer in 1...inputDataLength - 1 { | |
if (inputData[forwardPointer - 1] > inputData[forwardPointer]) { | |
let temp = inputData[forwardPointer - 1] | |
inputData[forwardPointer - 1] = inputData[forwardPointer] |
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
func insertionSort(inputData: inout [Int]) { | |
for forwardPointer in 1...inputData.count - 1 { | |
let selectElement = inputData[forwardPointer] //Select the element | |
var reversePointer = forwardPointer - 1 //Set the reverse pointer | |
while (reversePointer >= 0 && selectElement < inputData[reversePointer]) { | |
inputData[reversePointer + 1] = inputData[reversePointer] //move the value forward | |
reversePointer -= 1; //decrease the pointer | |
} | |
inputData[reversePointer + 1] = selectElement //store the value at correct place | |
} |
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
public static void insertionSort (int[] inputData) { | |
for (int forwardPointer = 1; forwardPointer < inputData.length; forwardPointer++) { | |
int selectElement = inputData[forwardPointer]; | |
int reversePointer = forwardPointer -1; | |
while (reversePointer >= 0 && selectElement < inputData[reversePointer]) { | |
inputData[reversePointer+1] = inputData[reversePointer]; | |
reversePointer--; | |
} | |
inputData[reversePointer + 1] = selectElement; | |
} |
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
package callbyvalue; | |
public class ObjectCallWithCreate { | |
public static void main(String[] args) { | |
TempNum z = new TempNum(10); | |
System.out.println("Value of x before the call: " + z); | |
add(z); | |
System.out.println("Value of x after the call: " + z); | |
} |
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
package callbyvalue; | |
public class ObjectCall { | |
public static void main(String[] args) { | |
TempNum z = new TempNum(10); | |
System.out.println("Value of x before the call: " + z); | |
add(z); | |
System.out.println("Value of x after the call: " + z); | |
} |
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
package callbyvalue; | |
public class PrimitiveCall { | |
public static void main(String[] args) { | |
int x = 10; | |
System.out.println("Value of x before the call: " + x); | |
add(x); | |
System.out.println("Value of x after the call: " + x); | |
} |
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
[youtube src="SHxP5Jd9Lm8" title="Rename Multiple Files Through Automator" duration="T6M18S" thumbnail="test.jpg" description="This is a test embed"] |
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
/************ Responsive Video *********/ | |
.video-container { | |
position: relative; | |
padding-bottom: 56.25%; | |
padding-top: 30px; | |
height: 0; | |
overflow: hidden; | |
} | |
.video-container iframe, | |
.video-container object, |