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
public static void doInsertionSort(int[] arr) | |
{ | |
for(int i = 1; i < arr.Length; i++) | |
{ | |
var key = arr[i]; | |
var j = i -1; | |
while(j>=0 && arr[j] > key) | |
{ | |
arr[j+1] = arr[j]; |
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
public static void doSelectionSort(int[] arr) | |
{ | |
for (int index = 0; index < arr.Length; index++) | |
{ | |
var minIndex = index; | |
var item = arr[index]; | |
for (int j = index; j < arr.Length; j++) | |
{ | |
if (arr[minIndex] > arr[j]) | |
{ |
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
def areAnagrams(first: String, second: String) = { | |
(first, second) match { | |
case x if first.length != second.length => false | |
case _ => { | |
val firstGroup = first.groupBy(i => i).map { case (item, repetitions) => (item, repetitions.size) } | |
val secondGroup = second.groupBy(i => i).map { case (item, repetitions) => (item, repetitions.size) } | |
firstGroup.size == secondGroup.size && |
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
def getNthFibnacci(n: Int): Int = { | |
if (n == 0 || n == 1) { | |
return n | |
} | |
return getNthFibnacci(n - 1) + getNthFibnacci(n - 2) | |
} | |
print(getNthFibnacci(7)) |
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
> sudo ng add @angular/pwa --project angular-pwa | |
Password: | |
Installing packages for tooling via npm. | |
Installed packages for tooling via npm. | |
CREATE ngsw-config.json (620 bytes) | |
CREATE src/manifest.webmanifest (1079 bytes) | |
CREATE src/assets/icons/icon-128x128.png (1253 bytes) | |
CREATE src/assets/icons/icon-144x144.png (1394 bytes) | |
CREATE src/assets/icons/icon-152x152.png (1427 bytes) | |
CREATE src/assets/icons/icon-192x192.png (1790 bytes) |
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
http-server -c-1 dist/angular-pwa | |
Starting up http-server, serving dist/angular-pwa | |
Available on: | |
http://127.0.0.1:8080 | |
http://172.20.10.3:8080 |
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
> http-server | |
Starting up http-server, serving ./ | |
Available on: | |
http://127.0.0.1:8080 | |
http://172.20.10.3:8080 | |
Hit CTRL-C to stop the server |
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
sudo npm install -g http-server |
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
ng serve |
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
ng new angular-pwa | |
? Would you like to add Angular routing? Yes | |
? Which stylesheet format would you like to use? CSS |
NewerOlder