Lab 4 – Lazy Deletion in BSTs

  

Lab 4 – Lazy Deletion in BSTs
Parts A is required. Part B is optional and is worth two points extra credit (but must be submitted in addition to, and along with, Part A). Part C is optional but has no extra point value. Make sure you have read and understood
● both ​ modules A​ and ​ B​ this week, and
● module 2R – Lab Homework Requirements before submitting this assignment. Hand in only one program, please.
Part A (required) – Lazy Deletion With Ints
This will be your first foray into an actual ADT implementation. It is not a toy program, but the real deal. You’ll take the binary search tree implemented in the modules (and supplied in your downloaded header file libraries) and modify it to use lazy deletion rather than the explicit “hard deletion.”
You will find it helpful to fetch and install the files in the following zip archives now:
● https://fgamedia.org/faculty/anand/resources/CS_2C_Client_Support.zip
● https://fgamedia.org/faculty/anand/resources/CS_2C_Files.zip
If you have carefully studied and experimented with the binary search tree template class, this assignment should be “just right”. It is not as difficult as doing an ADT from scratch, which might require more than a week. Nonetheless, in the few methods that you must retool, you’ll find just enough of a challenge to feel like you are really cracking the problem. The changes and debugging you will be doing are typical of ADT design.
Preparation
Copy the file ​ FHsearch_tree.h ​ and name the copy ​ FHlazySearchTree.h​ . Work on the latter file for this assignment. In the new file, change the name of the classes FHsearch_tree​ and ​ FHs_treeNode​ to ​ FHlazySearchTree ​ and FHlazySearchTreeNode​ , respectively. ​ Hint: Do a global search/replace of the old names with the new ones in this file​ . Also, if you use ​ #ifndef/#define ​ at the top of the file (to avoid nested compilation) they should be changed to some name ​ distinct​ from FHSEARCHTREE_H​ .
This file should now compile without any errors and be compatible with your cs_1c library and project as a whole (other than the name of the new tree class). So far, you have basically duplicated the logic of a BST into a second class that behaves exactly like the first, but has a new name. This is your starting point.
New Class Design
1. Add a ​ bool deleted​ member to ​ FHlazySearchTreeNode​ . Adjust this class to accommodate this member.
2. Add a new ​ int mSizeHard​ member to the ​FHlazySearchTree ​ class which tracks the number of “hard” nodes in it, i.e., both ​ deleted​ and ​ undeleted​.
Meanwhile, ​ mSize​ is still there and will only reflect the number of ​ undeleted nodes. Normally, the client will not need to know about ​ mSizeHard​ , but we want it for debugging purposes. Give it an accessor, ​ sizeHard()​ , so the client can test the class by displaying both the soft size (the number the client normally wants) and the hard size.
3. Revise ​ remove()​ (recursive version) to implement ​ lazy deletion​ .
4. Adjust​ insert()​ ​ and any other methods​ that might need revision to work with this new deletion technique. This often means inspecting the ​ deleted member when you are traversing for the data and take appropriate action based on the value of ​ deleted​ . (The only exceptions to this is the
height​ -related members and methods which are only there for the derived class ​ AVL tree​ . You can ignore any ​height​ -related code you find in the ​ .h​ file.)
5. Add a public/private pair, void ​ collectGarbage()​ (the private method is the
recursive counterpart of the public one). This allows the client to truly remove
all deleted (stale) nodes. Don’t do this by creating a new tree and inserting
data into it, but by traversing the tree and doing a ​ hard remove​ on each
deleted node. This will require that you have a private ​ removeHard()​ utility
that works very much like our old ​ remove()​ method.
6. Test your code thoroughly.
I will help you with the testing by providing a sample ​ main()​ and successful run, but this
is not a thorough test of the class:
// Assignment #4 Instructor Solution
In addition to testing your client a little better than the above ​ main()​ does, add a couple of tests for​ findMin()​ and ​ findMax()​ at various stages (e.g., hard-empty tree, a tree that has non-deleted stuff in it, and a tree that is completely empty but has all soft-deleted nodes) to make sure your exception handling is working in​ findMin()​ and findMax()​ .
Option B – Lazy Deletion with EBooks (2 EC Points)
Apply the same new ​ ADT​ to ​ EBookEntry​ objects by reading them in and doing various
removes and inserts. Do garbage collection at various points.
Option C: Benchmarking
If you have time and interest, after completing the above program, try to formulate an experiment to see if the ​ lazy deletion​ helps or hinders various operations (insertions,
deletions, finds, etc.)
   Submission Instructions Again
It’s worth reiterating because many students find it hard to follow instructions the first time. If you’re not one of them, feel free to skip the below. Note the following very simple important instructions. I will
only accept and grade submissions that follow these guidelines except when they are specifically
overridden in instructions.
1. Your submission should be a plain text file. See above. Save your file as a plain text file.
2. It is insufficient to simply have plain text format. The file name SHOULD have a ​ .txt​ or .java​ extension. In the past, many students who submitted files with NO extension ended up
with no points earned for those assignments. I want to help you NOT be one of them. So that’s
why this guideline is explicitly stated here.
3. If you have multiple files you might otherwise need to submit, put them all in a single file, called
Assignment_N.txt and separate the various sections in this file using a commented line of
dashes. E.g. Your ​ Assignment_8.txt​ file could be:
4. IMPORTANT: Don’t include any provided files (e.g. iTunes*.*) in your submission (I already
have them 🙂
5. Submit your work ​ on time​ by uploading the above file into Canvas, well before the deadline.
6. The following guidelines are technically not mandatory, but following them would earn you the
full points you are eligible for. Why not earn easy-to-get points?
● Make sure you follow all the formatting guidelines. Serious points could be lost for badly
formatted or difficult-to-read code.
● Don’t over-engineer your code. Implement exactly what’s asked, no more and no less.
To demonstrate your additional knowledge, use the forums. Assignments are not the place to do it. No bells and whistles or decorative code/output.
● If you’re doing this course for a grade (i.e. your GPA is important) only attempt the BASIC OPTION unless you are absolutely certain you have the basics nailed.
Intermediate and Advanced options are generally graded far more strictly. You should, however, attempt the advanced options and post/discuss that code in the forums AFTER the lab has been graded.
● Make sure your output is not “touched up” by hand. Incorrect output is better than “doctored output.

 

Discussions and Practical Connection

Discussion :

  Given  the readings and assignments in the course, identify and briefly  discuss two important concepts from this course that are applicable to  your degree.    ***Standard for all discussion posts:   Please make your initial post and two response posts substantive. A substantive post will do at least two of the following:    

  • Ask an interesting, thoughtful question pertaining to the topic 
  • Answer a question (in detail) posted by another student or the instructor 
  • Provide extensive additional information on the topic 
  • Explain, define, or analyze the topic in detail 
  • Share an applicable personal experience 
  • Provide  an outside source (for example, an article from the UC Library) that  applies to the topic, along with additional information about the topic  or the source (please cite properly in APA 7) 
  • Make an argument concerning the topic 

At  least one scholarly source should be used in the initial discussion  thread. Be sure to use information from your readings and other sources  from the UC Library. Use proper citations and references in your post.  

Practical Connection :

Provide a reflection of at least 500 words (or 2 pages double spaced)  of how the knowledge, skills, or theories of this course have been  applied, or could be applied, in a practical manner to your current work  environment. If you are not currently working, share times when you  have or could observe these theories and knowledge could be applied to  an employment opportunity in your field of study.    
 

   Requirements:    

  • Provide a 500 word (or 2 pages double spaced) minimum reflection.
  • Use of proper APA formatting and citations. If supporting evidence from outside resources is used those must be properly cited.
  • Share a personal connection that identifies specific knowledge and theories from this course.
  • Demonstrate a connection to your current work environment. If you  are not employed, demonstrate a connection to your desired work  environment.
  • You should not provide an overview of the assignments assigned in  the course. The assignment asks that you reflect how the knowledge and  skills obtained through meeting course objectives were applied or could  be applied in the workplace.

com db5

 

Discussion Question

With the business you created in the previous discussion, tell us how you could use Excel and the new functions, graphs, and features covered in this Unit at your company. Additionally, tell how important or unimportant the integrity of your data in Excel would be for your company to grow.  Address these discussion topics with a substantive initial post (minimum 250 words).

Saint Leo Core Value

Saint Leo’s core value of integrity is described as follows: “The commitment of Saint Leo University to excellence demands that its members live its mission and deliver on its promise. The faculty, staff, and students pledge to be honest, just, and consistent in word and deed.”

Assingment

1-2 pages

Review lecture slides Network Management and reputable resources and:

1) Explain what is Configuration Management in Networking? Why is it important? Review and explain couple of Configuration Management tools and their function.

2) What is Fault Management in Networking? What is/are the function of Fault Management Tools?

The Internet and Dev-Ops

Placing equipment and services on the Internet exposes them to critical cybersecurity threats. Read this student submission to the SANS Institute, summarize in five sentences and comment on why you feel DevOps would or would not improve security for Internet-connected services.

Continuous Security: Implementing the Critical Controls in a DevOps Environment  (Links to an external site.)

Aligned Objectives

  • Identify methods of protecting servers and services on the Internet
  • Discuss the different types of web services typically run in cyberspace 
  • Identity different cyber threats and how previous topics can prevent issues

Response Parameters

  • Each initial post should be 250 to 350 words. Respond to at least one peer’s post by providing potential solutions to their concern

Criteria

Summarize the article.

Discuss how they would or would not improve security with DevOps.

Security – Technology

Submit your final draft of Chapter Two literature review . Before submitting, you should carefully review Chapter 2 and check the following:

Topic :  The Smart Phone as a Dangerous Technology  

Review all of your references. Are all references in APA format? Do all in-text citations have an associated reference in the reference list? Do you have references in the reference list that are not cited in the chapters?

40 pages 50 references needed.

APA format must.

Homework1

 Download and read the document and answer all questions in the document. Please see attached document H1.