# Part 1 Write a function destroyAllXs that, given a linked list of ...

## Question

Part 1
Write a function destroyAllXs that, given a linked list of characters and a separate character, removes all Nodes with the given character from the list.
All remaining elements must appear in their original order.

Part 2
Write a function infinitySnap that, given a binary search tree, removes and puts half the tree nodes into a new tree, and returns both trees.
This snap, however, is not random and takes every node in an even position, given a pre-order depth-first traversal.
The first tree should have the nodes in the odd positions.
The second tree should have the nodes in the even positions.

Example: if the order was ['a', 'b', 'c', 'd'], tree1 would have'a' and "c", and tree2 would have 'b' and d'.
If the BST is empty, return None.
Make a second function endgameSnap that takes the two binary search trees and restores them to the original binary tree.

Write your own preorder function as part of quiz6.py and use that in your part 2 code.

## Solution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

import unittest
from node import Node
from treenode import TreeNode
from unorderedlist import UnorderedList
from binarysearchtree import BinarySearchTree

def preOrder(bst, lst):
if bst is not None:
lst.append(bst)
preOrder(bst....

By purchasing this solution you'll be able to access the following files:
Solution.py.

\$55.00
for this solution

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

### Find A Tutor

View available Python Programming Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.