FinalPractice - CSC 4005 Fall 2007 Practice problems for...

Info icon This preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CSC 4005 Fall 2007 Practice problems for the Final Draw a (single) binary tree T such that Each internal node of T stores a single character. A preorder traversal of T yields GOHAWKS. An inorder traversal of T yields AHWOKGS. Let T be a binary tree. If T has 7 nodes, what is its minimum height? What is its maximum height? Draw two trees that achieve the minimum and maximum height, respectively. Give pseudo-code for concatenating two concrete singly linked lists L and M with head sentinels (no tail) into a single list L that contains all the nodes of L (in their original order) followed by all the nodes of M (also in their original order). The first node in a linked list could be obtained by the head() method. You can use getNext(), setNext(...) methods of the Node class. What is the running time of your method if we let n denote the number of nodes in L and we let m denote the number of nodes in M? Write a Java program to convert a postfix expression to infix. Use a Stack. Write a method that would reverse a Queue using a Stack. You are given a LinkedList storing String objects in sorted order (increasing order). Write a Java method, insert(LinkedList alist, String newStr) that would insert a new String object into the linked list preserving the list’s order. You SHOULD use a ListIterator for the linked list and methods of the ListIterator interface when writing your method. You are given a LinkedList storing String objects . Write a Java method, replace(LinkedList alist, String oldStr, String newStr) that would replace the oldStr with the newStr in the linked list. You SHOULD use a ListIterator for the linked list and methods of the ListIterator interface when writing your method.
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern