- Login/Sign Up to your GitHub account.
- Fork this Gist from the Top-Right corner.
- Edit your Gist and paste/write the code solutions inside the respective functions.
- Do NOT change anything in the structure of the existing code/functions/class given in the GitHub Gist.
- Share your Gist link in the submission form as per the instructions given.
Last active
December 6, 2023 20:45
-
-
Save AbhiiAB/30cbfb806d927b9fb29722870b1fb4e9 to your computer and use it in GitHub Desktop.
Mid Course Summative Assessment - Data Structures (ST)
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
var invertTree = function (root) { | |
// Write your solution below | |
}; | |
// Do NOT change anything below this line | |
class Node { | |
constructor(val) { | |
this.val = val; | |
this.left = this.right = null; | |
} | |
} | |
module.exports = { invertTree, Node }; |
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
var deckRevealedIncreasing = function (deck) { | |
// Write your solution below | |
}; | |
// Do NOT change anything below this line | |
module.exports = { deckRevealedIncreasing }; |
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 baseballScore(operations) { | |
// Write your solution below | |
} | |
// Do NOT change anything below this line | |
module.exports = { baseballScore }; |
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 isPalindromeList(head) { | |
// Write your solution below | |
} | |
// Do NOT change anything below this line | |
class ListNode { | |
constructor(val, next = null) { | |
this.val = val; | |
this.next = next; | |
} | |
} | |
module.exports = { isPalindromeList, ListNode }; |
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
class LinkedList { | |
constructor() { | |
} | |
add(data) { | |
} | |
remove(data) { | |
} | |
getSize() { | |
} | |
printList() { | |
} | |
} | |
// Do NOT change anything below this line | |
class Node { | |
constructor(data) { | |
this.data = data; | |
this.next = null; | |
} | |
} | |
module.exports = { LinkedList }; |
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
class Stack { | |
constructor() { | |
} | |
push(item) { | |
} | |
pop() { | |
} | |
peek() { | |
} | |
isEmpty() { | |
} | |
} | |
// Do NOT change anything below this line | |
class Node { | |
constructor(item) { | |
this.item = item; | |
this.next = null; | |
} | |
} | |
module.exports = { Stack }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment