Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
193 commits
Select commit Hold shift + click to select a range
e567797
merge: added Problem 25 to Euler (#793)
byt3h3ad Oct 21, 2021
debc707
Auto-update DIRECTORY.md
Oct 21, 2021
278dc5c
merge: Add project-euler problem 12 (#767)
aayushborkar14 Oct 21, 2021
190ebb0
chore: use standard without fix
raklaptudirm Oct 22, 2021
71b48c8
fix: standard style problems
raklaptudirm Oct 22, 2021
b7f1a72
merge: added Problem 23 to Project Euler (#803)
byt3h3ad Oct 22, 2021
ffbfb20
Auto-update DIRECTORY.md
Oct 22, 2021
e83b570
merge: fixed some spellings (#773)
raghav-wd Oct 22, 2021
cd3974c
merge: Added Sum of GP (#807)
SpiderMath Oct 23, 2021
4ba2c32
Auto-update DIRECTORY.md
Oct 23, 2021
d5e309b
merge: Add binary to decimal test file and convert function to es6 mo…
ddhira123 Oct 23, 2021
d19108b
Auto-update DIRECTORY.md
Oct 23, 2021
32f1e33
merge: Added Hex to Binary conversion (#805)
ddhira123 Oct 24, 2021
e8d862c
merge: Added manhattan distance and euclidean distance for distance 2…
ddhira123 Oct 25, 2021
69a397c
merge: Added LucasSeries Implementation (#808)
SpiderMath Oct 25, 2021
32781c2
Auto-update DIRECTORY.md
Oct 25, 2021
4fb0809
merge: fixes: #774 - add test and fix MinPriorityQueue implementation…
pasagedev Oct 26, 2021
502aec2
merge: Added Aliquot Sum Implementation (#810)
SpiderMath Oct 26, 2021
3f00737
Auto-update DIRECTORY.md
Oct 26, 2021
7c2f19b
merge: Rename 2 filenames to follow PascalCase (#816)
SpiderMath Oct 26, 2021
4fa3c5e
Auto-update DIRECTORY.md
Oct 26, 2021
8a4f117
merge: add UnionFind.js plus tests (#814)
pschik Oct 26, 2021
4e18bbd
Auto-update DIRECTORY.md
Oct 26, 2021
54de6e5
merge: Fix pull request template (#818)
Bhargavishnu Oct 27, 2021
e4808a6
merge: Add MinHeap and test (#817)
tinatae Oct 27, 2021
970b4f2
Auto-update DIRECTORY.md
Oct 27, 2021
1cef191
merge: Made all tests follow file strcture convention already in-plac…
RenatoLopes771 Oct 28, 2021
820f8e9
merge: Create firstRelativeMaxPointInArray.js (#772)
jhonDoe15 Oct 28, 2021
00900f1
Auto-update DIRECTORY.md
Oct 28, 2021
9ad93c7
merge: Create findRelativeMaximumPointCount.js (#771)
jhonDoe15 Oct 28, 2021
82db978
Auto-update DIRECTORY.md
Oct 28, 2021
f8d4a26
chore: jest fall back
raklaptudirm Oct 28, 2021
59e9baf
feat: add codespell
raklaptudirm Oct 28, 2021
315db14
chore: fix spelling
raklaptudirm Oct 28, 2021
d16336a
chore: fix spelling
raklaptudirm Oct 28, 2021
b30f9f3
chore: fix spelling
raklaptudirm Oct 28, 2021
7722870
merge: Created composite Simpson's integration method. Tests included…
ggkogkou Oct 28, 2021
072523d
merge: Fix spellings (#821)
raklaptudirm Oct 28, 2021
1cd3b86
merge: Created midpoint integration numerical method (#822)
ggkogkou Oct 28, 2021
2203c1a
chore: use `UpperCamelCase`
raklaptudirm Oct 28, 2021
01a2e9a
chore: use `UpperCamelCase`
raklaptudirm Oct 28, 2021
d2883fe
chore: use `UpperCamelCase`
raklaptudirm Oct 28, 2021
9120085
chore: use `UpperCamelCase`
raklaptudirm Oct 28, 2021
3723322
fix: update file name
raklaptudirm Oct 28, 2021
09eebc4
merge: fix: optimize PrimeFactors (#823)
nella17 Oct 29, 2021
7c39839
merge: Add LinearSieve.js (#828)
nella17 Oct 31, 2021
f692da2
Auto-update DIRECTORY.md
Oct 31, 2021
2619ab6
merge: Added bisection method (#827)
ggkogkou Oct 31, 2021
12cf29e
fix: endlines in the CI file
Panquesito7 Nov 2, 2021
308b022
merge: Sliding window (#833)
Aditya1942 Nov 3, 2021
64920bf
merge: Removed ignored code files form codespell workflow. (#834)
raklaptudirm Nov 3, 2021
85b0571
chore: Strings: Credit Card Validation (#830)
Bhargavishnu Nov 4, 2021
65931be
merge: fixed argument data type (#835)
longvo04 Nov 8, 2021
c1c895b
chore: Add PowLogarithmic in Math (#836)
Yatin-kathuria Nov 19, 2021
f379475
merge: Add TribonacciNumber in dp (#839)
Yatin-kathuria Nov 20, 2021
93e57b0
merge: Add FibonacciNumber.js test case and update the decription of …
Yatin-kathuria Nov 20, 2021
02a4cee
merge: optamization,documantation,return Array[bool] => Array[primes …
Yatin-kathuria Nov 20, 2021
4e7a156
merge: add test case and description (#842)
Yatin-kathuria Nov 22, 2021
2ae00a9
merge: add description (#843)
Yatin-kathuria Nov 23, 2021
4aac366
merge: Refactor Code and Add test case (#845)
Yatin-kathuria Nov 25, 2021
8b1a4b9
merge: fix #844 (#846)
aditya1944 Nov 25, 2021
2fb0d48
merge: Add test cases, optamization of code, and Add description of f…
Yatin-kathuria Nov 26, 2021
de27089
merge: Add FindMin (#849)
Yatin-kathuria Nov 26, 2021
061218b
merge: Modify Graph bfs method (#847)
Yatin-kathuria Nov 26, 2021
c33b19a
merge: Graph (#850)
Yatin-kathuria Nov 27, 2021
51415f8
merge: Add test case (#851)
Yatin-kathuria Nov 27, 2021
cc34088
merge: Add Description and Optamization (#852)
Yatin-kathuria Nov 27, 2021
027c0d6
merge: Add test cases (#854)
Yatin-kathuria Nov 28, 2021
6f1edd1
merge: Add test Case for Palindrome Recursive (#855)
Yatin-kathuria Nov 28, 2021
bf681d1
merge: alphaNumericPlaindrome optamization (#857)
Yatin-kathuria Nov 29, 2021
c3b2bac
merge: fixes: #{} (#853)
itsmohitmkk Nov 30, 2021
961f21f
merge: Add test case and enacements (#858)
Yatin-kathuria Dec 1, 2021
6fb649e
merge: Add ValidateUrl in String (#856)
Yatin-kathuria Dec 2, 2021
62b151e
merge: Fixes: #860 (#861)
zaaath Dec 2, 2021
4c27e15
merge: Add lower (#863)
Yatin-kathuria Dec 4, 2021
43515a6
merge: Add Upper (#862)
Yatin-kathuria Dec 6, 2021
7560beb
merge: Add tests and docs for the Longest Common Subsequence algorith…
zaaath Dec 8, 2021
4d55b40
merge: Absolute value (#866)
Yatin-kathuria Dec 11, 2021
c30b897
merge: count Vowels (#864)
Yatin-kathuria Dec 11, 2021
f387ff3
chore: Remove duplicate `DigitSum` algorithm (#873)
raklaptudirm Dec 11, 2021
bbdb5cf
merge: Binary Convert (#865)
Yatin-kathuria Dec 14, 2021
3d2a48f
merge: Improve Mean method (#874)
Yatin-kathuria Dec 15, 2021
ef832f6
merge: add areaTriangleWithAllThreeSides method in Math/Area.js (#875)
Yatin-kathuria Dec 15, 2021
0aa5094
merge: add alphanumerical sort (#872)
RuSaG0 Dec 20, 2021
49fa7d1
merge: improve median (#869)
RuSaG0 Dec 20, 2021
7dd99c1
merge: chore(deps): bump node-fetch from 2.6.1 to 3.1.1 (#877)
dependabot[bot] Jan 23, 2022
31b06c9
merge: Let traverseLevel return early if node is null (#878)
Worldwidebrine Jan 24, 2022
c496925
merge: rename `SinglyLinkList` to `SinglyLinkedList` (#881)
maltejur Feb 14, 2022
833d05d
merge: binarySearch (#884)
AbmSourav Feb 16, 2022
6bd2ac6
merge: Decrease time period for marking an issue stale (#885)
raklaptudirm Feb 16, 2022
c9701e8
merge: Improving the coding standard for AvLTree Data Structure (#882)
rahulrajrd Feb 17, 2022
9911410
merge: Implement Add Two Numbers (Linked List) (#888)
ShakilAhmmed Feb 17, 2022
68ca0ce
merge: optimize the countVowels algo (#886)
fahimfaisaal Feb 17, 2022
29a3ab7
merge: Iterator and log methods added for linked lists (#891)
AbmSourav Feb 18, 2022
041918d
merge: Upgrade Lower function (#894)
fahimfaisaal Feb 19, 2022
dbc98d0
merge: Bubble Sort enhancements for nearly sorted or sorted array, ad…
aminhossain Feb 19, 2022
743b317
merge: Corrected JSdoc typo (#898)
Rudxain Feb 21, 2022
8bf29fe
merge: Optimize the space complexity of the fibonacci algo (#899)
fahimfaisaal Feb 22, 2022
be15d08
merge: replaced constructor function with es6 class syntax (#900)
mmestiyak Feb 23, 2022
0178efd
merge: Algorithm to calculate the Arithmetic Geometric Mean (#897)
Rudxain Feb 24, 2022
d466be9
merge: Upgrade `checkAnagram` function & Fixes (#902)
fahimfaisaal Feb 25, 2022
e8de031
merge: Improved pangram algorithm using regular expressions (#906)
fahimfaisaal Feb 28, 2022
ab06131
merge: Improved `Pow` function (#911)
fahimfaisaal Mar 2, 2022
378d4ab
merge: Upgraded `hexToBinary` function (#910)
fahimfaisaal Mar 2, 2022
eb748ae
merge: Fixed `wordOccurrence` algorithm (#909)
fahimfaisaal Mar 2, 2022
6656ece
merge: Improved `Memoize` function (#912)
fahimfaisaal Mar 2, 2022
cc55dab
merge: Updated `pull_request_template` (#913)
fahimfaisaal Mar 2, 2022
98c46b4
merge: Improved `IsOdd` function (#914)
fahimfaisaal Mar 4, 2022
00f5936
merge: Add alternative implementation for InsertionSort and relative …
HereBeAndre Mar 4, 2022
35ba618
merge: Added replace method to `Upper` (#916)
fahimfaisaal Mar 5, 2022
5198af8
merge: Run "style" and "test" scripts automatically when committing n…
akib22 Mar 9, 2022
4f6fe19
merge: resolve example mistake (#919)
fahimfaisaal Mar 10, 2022
da6c227
merge: refactor `isEven` function (#920)
fahimfaisaal Mar 11, 2022
7f479b8
merge: consistent list syntax in `CONTRIBUTING.md` (#921)
akib22 Mar 12, 2022
80cea08
merge: Add testcases of BinaryCountSetBits function (#922)
Ankush263 Mar 15, 2022
0924f1c
merge: Improved `abs` function (#923)
fahimfaisaal Mar 15, 2022
a545f76
merge: Add test case of SquareRoot function (#926)
Ankush263 Mar 15, 2022
1992425
merge: Add test cases to ArbitraryBase, DateToDay & DateDayDifference…
Ankush263 Mar 16, 2022
ffa4846
merge: Add FindMinIterator algorithm (#928)
trasherdk Mar 16, 2022
92a2f6d
merge: added @babel/eslint-parser (#931)
fahimfaisaal Mar 17, 2022
e33503f
merge: Add test case to DecimalToBinary,DecimalToOctal & OctToDecimal…
Ankush263 Mar 18, 2022
5302002
merge: Add test case to LowerCaseConversion (#934)
Ankush263 Mar 18, 2022
bb23382
merge: Add test case to RGBToHex & RailwayTimeConversion algorithm (#…
Ankush263 Mar 19, 2022
9f7ed56
merge: Remove duplicate helper functions in cache tests. (#933)
fahimfaisaal Mar 20, 2022
9d2a7f1
merge: Add test case to ConvexHullGraham Algorithm (#938)
Ankush263 Mar 21, 2022
ad68c63
merge: Added new clean `LFUCache` class (#939)
fahimfaisaal Mar 21, 2022
d246958
merge: Added explicit cache feature & optional parameter (#941)
fahimfaisaal Mar 22, 2022
9681688
merge: Add `CheckExceeding` function (#907)
fahimfaisaal Mar 22, 2022
ecf7cf9
merge: Add test case to countingSort algorithm (#943)
Ankush263 Mar 22, 2022
699146f
merge: Add test case to secondLargestElement Algorithm (#945)
Ankush263 Mar 23, 2022
233ec59
merge: Add Graph3 (add DFS in Iterative Way) (#944)
devycha Mar 24, 2022
532cf3e
merge: Add test case to FlashSort algorithm (#946)
Ankush263 Mar 24, 2022
73efc89
merge: Fix GnomeSort algorithm and Add test case to it (#948)
Ankush263 Mar 24, 2022
55da7a1
merge: Add test case to HeapSort Algorithm (#947)
Ankush263 Mar 24, 2022
81c771b
merge: Improved `LRUCache` (#953)
fahimfaisaal Mar 27, 2022
b85bf49
merge: Fixed a wrong sentence structure (#952)
utsav0 Mar 27, 2022
47c1c51
merge: Improved ciphers (#954)
fahimfaisaal Mar 27, 2022
d6a327a
merge: Add test case and fix the OddEvenSort Algorithm (#955)
Ankush263 Mar 27, 2022
5476021
chore(deps): bump minimist from 1.2.5 to 1.2.6 (#957)
dependabot[bot] Mar 28, 2022
1249dbe
merge: Round-trip testing for Atbash cipher (#958)
trasherdk Mar 28, 2022
b4fafb2
merge: added jest type for suggestions (#959)
fahimfaisaal Mar 28, 2022
3b9af46
merge: added `reduceRight` & `trim` method (#961)
fahimfaisaal Mar 28, 2022
27ae62e
merge: reduce upper & lower & add export default (#960)
fahimfaisaal Mar 28, 2022
7d57f7f
merge: cache repeated function calls (#962)
fahimfaisaal Mar 28, 2022
cdfa264
merge: Improved `CaesarsCipher` Algorithm (#963)
fahimfaisaal Mar 29, 2022
075d35f
merge: Improved `ROT13` function (#964)
fahimfaisaal Mar 29, 2022
c21ad2c
merge: Improved `xorCipher` (#965)
fahimfaisaal Mar 29, 2022
d47555b
merge: Add test case and fix HeapSort Algorithm (#969)
Ankush263 Mar 31, 2022
871a49f
merge: test case to radixSort Algorithm (#968)
Ankush263 Apr 1, 2022
6f33f99
merge: Add test case and fix pigeonHoleSort Algorithm (#967)
Ankush263 Apr 1, 2022
2be0fdc
merge: Decimal Expansion (#787)
lvlte Apr 2, 2022
42b9f64
merge: Update workflow organization and environments (#971)
raklaptudirm Apr 3, 2022
2169e17
merge: Add test case to shellSort algorithm (#975)
Ankush263 Apr 3, 2022
35035f7
merge: Add test case and fix TimSort algo (#977)
Ankush263 Apr 3, 2022
dfe200a
merge: Improving coding standard of singly linked list (#980)
rahulrajrd Apr 9, 2022
74857b7
merge: Improvement on singly circular linkedList (#981)
rahulrajrd Apr 10, 2022
48e3e8d
chore: use `stale` label to mark something as stale
raklaptudirm Apr 16, 2022
4098932
Change 1 week to 2 weeks for stale issues
Panquesito7 Apr 18, 2022
8fc5390
merge: FindLCM: Improve code readablility (#985)
CarlosZoft Apr 20, 2022
298ab33
merge: Add proper tests for binary search (#987)
CarlosZoft Apr 21, 2022
eb36e2d
merge: Format codebase with `standard.js` (#989)
CarlosZoft Apr 21, 2022
1e0dd1c
chore: add appgurueu to `CODEOWNERS`
raklaptudirm Apr 21, 2022
9513bcd
merge: WhileLoopFactorial: Optimize and add tests (#992)
merelymyself Apr 21, 2022
c81db62
merge: EuclidGCD: add tests (#994)
merelymyself Apr 22, 2022
7881cb5
Add Boyer-Moore string search algorithm (#990)
ayDavidGitHere Apr 23, 2022
5641b6f
Add Zeller's Congruence Algorithm in Math (#996)
merelymyself Apr 27, 2022
2e18fbb
merge: Add the Stooge Sort Algorithm (#998)
Madiena Apr 28, 2022
6d5e641
merge: tweak `DIRECTORY.md` generation (#999)
raklaptudirm Apr 28, 2022
01db0fb
Fix wiggle sort (#991)
BranAndSceolan Apr 28, 2022
e447b55
merge: Update directory workflow (#1000)
raklaptudirm Apr 28, 2022
2806253
merge: Upgrade max char (#983)
fahimfaisaal May 2, 2022
b81c339
merge: Improve pull request template (#1002)
appgurueu May 4, 2022
edd7076
merge: A better `README` (#1003)
raklaptudirm May 6, 2022
03d0b1e
merge: Update README.md (#1004)
ozayman May 6, 2022
e05b443
merge: Improved the complexity of dequeue O(n) to O(1) (#1005)
fahimfaisaal May 6, 2022
cbc669a
merge: Upgraded Algorithm of alpha numeric palindrome (#1006)
fahimfaisaal May 7, 2022
21a8511
merge: Find max recursion (#1010)
Exortions May 9, 2022
f736217
merge: Add test case to KeywordShiftedAlphabet algorithm (#1013)
Ankush263 May 12, 2022
c865654
Clean up phone number formatting (#1015)
fahimfaisaal May 16, 2022
4cd6fd4
merge: Add test case to Vigenere Cipher Algorithm (#1017)
Ankush263 May 17, 2022
360c447
merge: Add test case to HexToRGB algorithm (#1018)
Ankush263 May 17, 2022
d28ae8b
merge: Update test case for bubbleSort ( with code style is fixed) (#…
thanhphuonghdhh May 23, 2022
dc67506
merge: Add pronic number implementation (#1023)
itsAkshayDubey May 25, 2022
0357a23
merge: Add the Collatz Conjecture (#1022)
Exortions May 26, 2022
92a81a2
merge: Add Twin Primes algorithm (#1024)
Exortions May 27, 2022
9befd92
Add testcase to checkKebabCase (#1027)
Ankush263 May 30, 2022
07e77fa
merge: Add testcase to AlternativeStringArrange Algorithm (#1026)
Ankush263 May 30, 2022
162e90f
merge: Add test case to palindromeRearranging Algorithm (#1030)
Ankush263 May 31, 2022
d59213d
merge: Add test case to CheckPascalCase Algorithm (#1029)
Ankush263 May 31, 2022
0dccd28
merge: fix typo(change file name) (#1034)
Ankush263 Jun 2, 2022
dbffac2
merge: FindSecondLargestElement: Support negative numbers (#1036)
appgurueu Jun 3, 2022
61ee224
merge: Add test case to Find Second Largest Element Algorithm (#1037)
Ankush263 Jun 5, 2022
c105c4d
merge: Rename pigeonHoleSort.test.js to PigeonHoleSort.test.js (#1038)
Ankush263 Jun 5, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
merge: replaced constructor function with es6 class syntax (TheAlgori…
…thms#900)

* replaced constructor function with es6 class syntax

* formatted code with standard.js
  • Loading branch information
mmestiyak authored Feb 23, 2022
commit be15d08b4a13c4e8d2f1fe6f01b46edf39d8c08f
125 changes: 64 additions & 61 deletions Data-Structures/Linked-List/DoublyLinkedList.js
Original file line number Diff line number Diff line change
@@ -1,54 +1,57 @@
// Hamza chabchoub contribution for a university project
function DoubleLinkedList () {
const Node = function (element) {
class Node {
constructor (element) {
this.element = element
this.next = null
this.prev = null
}
}

let length = 0
let head = null
let tail = null
class DoubleLinkedList {
constructor () {
this.length = 0
this.head = null
this.tail = null
}

// Add new element
this.append = function (element) {
append (element) {
const node = new Node(element)

if (!head) {
head = node
tail = node
if (!this.head) {
this.head = node
this.tail = node
} else {
node.prev = tail
tail.next = node
tail = node
node.prev = this.tail
this.tail.next = node
this.tail = node
}

length++
this.length++
}

// Add element
this.insert = function (position, element) {
insert (position, element) {
// Check of out-of-bound values
if (position >= 0 && position <= length) {
if (position >= 0 && position <= this.length) {
const node = new Node(element)
let current = head
let current = this.head
let previous = 0
let index = 0

if (position === 0) {
if (!head) {
head = node
tail = node
if (!this.head) {
this.head = node
this.tail = node
} else {
node.next = current
current.prev = node
head = node
this.head = node
}
} else if (position === length) {
current = tail
} else if (position === this.length) {
current = this.tail
current.next = node
node.prev = current
tail = node
this.tail = node
} else {
while (index++ < position) {
previous = current
Expand All @@ -63,35 +66,35 @@ function DoubleLinkedList () {
node.prev = previous
}

length++
this.length++
return true
} else {
return false
}
}

// Remove element at any position
this.removeAt = function (position) {
removeAt (position) {
// look for out-of-bounds value
if (position > -1 && position < length) {
let current = head
if (position > -1 && position < this.length) {
let current = this.head
let previous = 0
let index = 0

// Removing first item
if (position === 0) {
head = current.next
this.head = current.next

// if there is only one item, update tail //NEW
if (length === 1) {
tail = null
// if there is only one item, update this.tail //NEW
if (this.length === 1) {
this.tail = null
} else {
head.prev = null
this.head.prev = null
}
} else if (position === length - 1) {
current = tail
tail = current.prev
tail.next = null
} else if (position === this.length - 1) {
current = this.tail
this.tail = current.prev
this.tail.next = null
} else {
while (index++ < position) {
previous = current
Expand All @@ -103,16 +106,16 @@ function DoubleLinkedList () {
current.next.prev = previous
}

length--
this.length--
return current.element
} else {
return null
}
}

// Get the indexOf item
this.indexOf = function (elm) {
let current = head
indexOf (elm) {
let current = this.head
let index = -1

// If element found then return its position
Expand All @@ -130,28 +133,28 @@ function DoubleLinkedList () {
}

// Find the item in the list
this.isPresent = (elm) => {
isPresent (elm) {
return this.indexOf(elm) !== -1
}

// Delete an item from the list
this.delete = (elm) => {
delete (elm) {
return this.removeAt(this.indexOf(elm))
}

// Delete first item from the list
this.deleteHead = function () {
deleteHead () {
this.removeAt(0)
}

// Delete last item from the list
this.deleteTail = function () {
this.removeAt(length - 1)
deleteTail () {
this.removeAt(this.length - 1)
}

// Print item of the string
this.toString = function () {
let current = head
toString () {
let current = this.head
let string = ''

while (current) {
Expand All @@ -163,9 +166,9 @@ function DoubleLinkedList () {
}

// Convert list to array
this.toArray = function () {
toArray () {
const arr = []
let current = head
let current = this.head

while (current) {
arr.push(current.element)
Expand All @@ -176,27 +179,27 @@ function DoubleLinkedList () {
}

// Check if list is empty
this.isEmpty = function () {
return length === 0
isEmpty () {
return this.length === 0
}

// Get the size of the list
this.size = function () {
return length
size () {
return this.length
}

// Get the head
this.getHead = function () {
return head
// Get the this.head
getHead () {
return this.head
}

// Get the tail
this.getTail = function () {
return tail
// Get the this.tail
getTail () {
return this.tail
}

// Method to iterate over the LinkedList
this.iterator = function () {
iterator () {
let currentNode = this.getHead()
if (currentNode === null) return -1

Expand All @@ -211,7 +214,7 @@ function DoubleLinkedList () {

// Method to log the LinkedList, for debugging
// it' a circular structure, so can't use stringify to debug the whole structure
this.log = function () {
log () {
let currentNode = this.getHead()
while (currentNode) {
console.log(currentNode.element)
Expand Down