Class Notes: Data Structures and Algorithms
Summer-C Semester 1999 - M WRF 2nd Period CSE/E119, Section 7344
Homework #6 -- Due Fri 09 July 1999 : 09.30am
In class, we discussed AVL trees, binary search trees, and the breadth-first and depth-first search (BFS and DFS) algorithms for graph or tree traversal. The purpose of this homework is to exercise your knowledge and develop skills you will need for the exams and for Projects 4 and 5. Use your class notes and the text (Chapter 12) as a guide to answering the following questions.
Clarifications in response to student questions are posted in red typeface.
* Question 1. Given the sequence {-3, 8, 2, -1, 4, 6, -2, 10},
(a) [1 point] Diagram an unbalanced binary search tree (BST) for this sequence. Right and left subtrees of the root should differ by two levels. This means that the balance factor can be -2 or +2.
(b) [1 point] Traverse the BST using DFS and label the vertices by their values as they are encountered, as you did for Homework #5.
(c) [1 point] Repeat Question 1b), but for BFS instead of DFS.
(d) [1 point] Tell which method - DFS or BFS - would be better for outputting the BST values in sorted order. You do not have to start at the root of the tree. To get credit, you must explain your answer in 1-2 sentences.
* Question 2. Given the sequence S = {-9, 2, 4, 6, 30, -10, 1, 5, 8, 7},
(a) [1 point] Diagram a binary search tree (BST) for this sequence.
(b) [1 point] Insert the values -46, -47, 38, 39, 40, and 45 into the BST you diagrammed in Question 2a) and draw the new BST (the resultant tree, after all values are inserted).
(c) [1 point] Using the array representation of a binary tree that we discussed in class, diagram the array representation of the tree you obtained in Question 2a).
3. Identify the layers of the Earth shown in the diagram to the right. (S6E5a)
To improve my procedure, there are plenty of different ways to do so now that I have an increased experience with working with a large selection of trees. A major flaw with my research is by having to record the different types of trees in the zone, mainly height. Therefore, having to examine trees that vary greatly from each other. By having trees that represented the whole zone, instead of part of a zone, it would give more accurate information. To achieve even more accurate information, looking at the largest leaf for each tree would give a better
There are many ways which help build rapport with children and young people. One of them is to ensure to actively listen to what they are saying. There may be times were you unintentionally brush aside what a child is saying perhaps it is because you are preoccupied or tired, however, even this can be enough to make a child feel unvalued. Being responded to appropriately reinforces a child's self-esteem. This will in turn help build a trusting relationship. Talking with children, asking and answering questions also helps build their language skills. If pupils are distressed and need to talk about it, they will more likely open up to the person who has made them feel that they have a voice. This is why it is very important to build a respectful and trusting relationship with students, as it can have an impact on most areas of development.
8. Repeat from step 4 twice more so you end up with three results for
2) Analyze the graph that compares the Segment Sequence numbers of the three scenarios. Why does the Drop_NoFast scenario have the slowest growth in sequence numbers?
In the chart below, provide the missing information -- either the name of each region illustrated, or the function of each region -- and then provide the letter for the location of each region based on the diagram below. Each correct answer will earn for the team two points. (For clarity, the colors of the letters assigned to each region matches the colors of the region displayed in the diagram, so when in doubt, follow the color.) Finally, answer the four questions below the chart. The point value for each of the four questions is given along with the question.
1) Sort the pictures into living and nonliving categories by using their definitions that they created.
The raw data which I have been given is in list form and provides me
Step-Stair Investigation For my GCSE Maths coursework I was asked to investigate the relationship between the stair total and the position of the stair shape on the grid. Secondly I was asked to investigate the relationship further between the stair totals and the other step stairs on other number grids. The number grid below has two examples of 3-step stairs. I will use Algebra as a way to find the relationship between the stair total and the position of the stair on the grid.
3. From the ground up - cirle diagram of stats/percents of entire forest (goes near intro)
[7] Elmasri & Navathe. Fundamentals of database systems, 4th edition. Addison-Wesley, Redwood City, CA. 2004.
Definition. A path from node n1 to node nk is a sequence of nodes n1, n2, …, nk such that ni is the parent of ni+1 for 1 ≤ i < k. The length of a path is the number of edges in the path, not the number of nodes. Because the edges in a tree are directed, all paths are “downward”, i.e., towards leaves and away from the root. The height of a node is the length of the longest path from the node to any of its descendants. Naturally the longest path must be to a leaf node. The depth of a node is the length of the path from the root to the node. The root has depth 0. All leaf nodes have height 0.
Now, suppose we were to partition the tuples in D on some attribute A having v distinct values, {a, a2, . . . , av}, as observed from the training data. If A is discrete-valued,these values correspond directly to the v outcomes of a test on A. Attribute A can be used to split D into v partitions or subsets, {D, D2, . . . , Dv},where Dj contains those tuples in D that have outcome aj of A. These partitions would correspond to the branches gr...
17. Given the state diagram in Figure 4.6, which test case is the minimum series of valid transitions to cover every state?