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 Solution { | |
public: | |
bool isLeaf(Node* root){ | |
return !root->left and !root->right; | |
} | |
void addLeftBoundary(Node* root, vector<int> &ans){ | |
Node* curr = root->left; | |
while(curr){ | |
if(!isLeaf(curr)) ans.push_back(curr->data); | |
if(curr->left) curr = curr->left; |
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 Solution { | |
public: | |
void traverseLeft(Node* root, vector<int> &ans){ | |
if(!root or (!root->left and !root->right)) return; | |
ans.push_back(root->data); | |
if(root->left) traverseLeft(root->left, ans); | |
else traverseLeft(root->right, ans); | |
} | |
void traverseLeaf(Node* root, vector<int> &ans){ |
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
const regForm = document.querySelector("#regForm"); | |
regForm.addEventListener("submit", () => { | |
event.preventDefault(); | |
const fullName = document.querySelector("#fullName"); | |
const email = document.querySelector("#email"); | |
const phone = document.querySelector("#phone"); | |
const qual = document.querySelector("#qual"); | |
const state = document.querySelector("#state"); | |
const city = document.querySelector("#city"); | |
const district = document.querySelector("#district"); |