Today, I leanred is about the element postition in Javascript. In the Javascript, the posisiton property is used to specify the type of positioning. absolute: The element is removed from normal flow and positioned in relation to its nearest positioned ancestor (if no positioned ancestor, then in relation to the browser window). fixed: The element is fixed in a specific position in the window eve..
Modifying the DOM Changing an Element's style Changing the Content of any given element. DOM manipulation Methods How can we change an element's style?? The first method is by directy change the properties of the style property for that element. Here is the example: The second method is by changing its class using the className or classList properties. Like this: There was an exercise to get use..
What is "DOM" in javascript?? ๐คจ The DOM is an abstract model that defines the interface between HTML documents and application programs. An API What I understand is that HTML properties can be used as values in Javascript. In this picture, we can see the "type" and "address" are the values in Javascript. There is the picture like tree to represent the structure of DOM: I can see the inheritance ..
How to assign an IP address to a host? 1. Manually: hard-coded by system admin in a file Windows: control-panel -> networking -> configuration -> TCP/IP -> properties. UNIX: /etc/rc.config 2. Automatically: DHCP: Dynamic Host Configuration Protocol DHCP is a plug and play protocol: a node can dynamically obtain an IP address when joining the network and release the IP address when leaving the ne..
Description: This question is to know whether subRoot is in root or not. If the subRoot is in the root, return True. However, in example 2, it returns False because subRoot has unexpected child node. This Question set it is false like example 2. Solution(Recursion with DFS): Before looking at identical function, we should look the cases. In the first case, we return true when we don't have subRo..
Description: This question asked us to get 2 dimensional array which includes the value and level of tree. "3" is the only value of first level of tree. 9, 20 are the second level. 15, 7 are the third level. Each level is in the same list, we can see the different list in the output list. Solution: First, the solution used the queue method in collections library. "res" is what we are gonna retur..
This is the Leetcode question called "Binary Tree Maximum Path): Every nodes have a specific value. Some are positive and some are negative. We can start from any node of tree. When we start, we can make a direction to other node. Solution: First, we make the list name "res" to return the sum. The function "dfs" is used for recurssion and return the value of the maximum case when we go thorugh t..
Description: So, we should change the right value of the root to the left value of the root. Solution: First, we have a condition: if the tree is empty, we just return root. I made the variable name "left", "right" which is pointer the right and the left value of the root. We change the value of right to the left, the left to the right through recurrsion. Finally, return the root.
Description: In this problem, we are gonna check the identical structure and their values. Two tree must the same tree structurely. Solution: * First condition checks "both p and q are None." If it is return True. * Second condition checks "one of p and q are None." If it is, then return False. --> The reason is that just one of p or q done, that menas both tree don't have identical structure. *..
Description: We are trying to get a depth of binary tree. In example 1, weshould return "3", and example 2 should return "2." Solution1(Recursion): This is the method using recursive. We are going down to tree, adding 1 until the depth of tree. Since the recursive function have both value l and r, we should compare which is the longer. That's why we use the max(r, l) to compare which is the dept..