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
<?php | |
use PHPMailer\PHPMailer\PHPMailer; | |
use PHPMailer\PHPMailer\Exception; | |
require 'PHPMailer-6.0.3/src/Exception.php'; | |
require 'PHPMailer-6.0.3/src/PHPMailer.php'; | |
require 'PHPMailer-6.0.3/src/SMTP.php'; | |
?> |
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
<?php | |
use PHPMailer\PHPMailer\PHPMailer; | |
use PHPMailer\PHPMailer\Exception; | |
require 'PHPMailer-6.0.3/src/Exception.php'; | |
require 'PHPMailer-6.0.3/src/PHPMailer.php'; | |
require 'PHPMailer-6.0.3/src/SMTP.php'; | |
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
function bubbleSort(arr) { | |
var temp; | |
console.log("Given array"); | |
console.log(arr); | |
for (var i = 0; i < arr.length - 1; i++) { | |
// Last i elements are already in order | |
for (var j = 0; j < arr.length - i - 1; j++) { | |
if (arr[j] > arr[j + 1]) { | |
temp = arr[j]; | |
arr[j] = arr[j + 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
function bubbleSort(arr) { | |
var temp, swapped; | |
console.log("Given array"); | |
console.log(arr); | |
for (var i = 0; i < arr.length - 1; i++) { | |
swapped = false; | |
// Last i elements are already in order | |
for (var j = 0; j < arr.length - i - 1; j++) { | |
if (arr[j] > arr[j + 1]) { | |
temp = arr[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
class node { | |
constructor(data) { | |
this.data = data; | |
this.next = null; | |
} | |
} |
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
class SingleLinkedList { | |
constructor() { | |
this.head = null; | |
this.length = 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
addToHead(data) { | |
let newNode = new node(data); | |
/* | |
If the list is empty , | |
newly created `node` | |
will be the `head` of the list. | |
*/ | |
if (this.head == null) { | |
this.head = newNode; | |
} |
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
addToLast(data) { | |
let newNode = new node(data); | |
/* | |
If the list is empty , | |
newly created `node` | |
will be the `head` of the list. | |
*/ | |
if (this.head == null) { | |
this.head = newNode; |
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
insertAfter(key, data) { | |
/* | |
If list is empty | |
*/ | |
if (this.head == null) { | |
console.log("The list is empty"); | |
} | |
/* | |
Travese through the list until `key` |
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
display() { | |
/* | |
if list is empty | |
*/ | |
if (this.head == null) { | |
console.log('List is empty'); | |
} | |
/* | |
Traverse through the list | |
recursively until `currentnode` |
OlderNewer