Question
Question 1:
Which hash table collision resolution method did you use (eg. chaining or open addressing)? Explain your choice briefly

Question 2:
Which hash function (division or multiplication) did you use? How did you convert a string into a number?

Question 3:
Another legal XML tag not used in this lab is the stand-alone tag. This kind of tag combines both a start-tag and end-tag in one. It is identified with a '/' (slash) preceding the final >. (For example, the <foo/> is a stand-alone tag that is self balancing.
      
Describe briefly how you would modify Part 3 to allow this kind of tag.
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.

**
* The functions in this module implement a Stack data structure
* of char pointers (aka "strings").
*
* NOTE: the stack is implemented as a fixed size array (size = 100).
* Consequently, no more than 100 strings can be pushed onto
* the Stack at any given time.
*/

// Implementation hints:
//   The 3 functions--push, pop and isEmpty--share information
//   about the array used to implement the stack and the index
//   of the "top" of the stack.
//
//   You may want to make these variables global...
//   ...but that would
//   be a mistake (because anyone using the module would have
//   to ensure that they did not use global variables with the
//   same names).
//
//   An alternative in C is a "static global".
//   If a global variable is qualified as "static", it is global only
//   within the source code file where it is declared.
//   In parituclar, it cannot conflict with any other global variable.
//
// RECOMMENDATION:
//   Uncomment the following 2 lines and use these static globals!
#include <stdio.h>
static int top = 0;
static char * stack[100];

/**
* pop() removes the top string on the stack and returns it.
*
* If pop() is attempted on an empty stack, an error message
* is printed to stderr and the value NULL ((char *) 0) is returned.
*/

char * pop()
{
if(top == 0) {
    fprintf(stderr, "Stack underflow!\n");
    return (char *) 0;
}
else {
    top--;
    return stack[top];
}
}

/**
* push(thing2push) adds the "thing2push" to the top of the stack.
*
* If there is no more space available on the Stack, an error
* message is printed to stderr.
*/
void push(char * thing2push)
This is only a preview of the solution.
Please use the purchase button to see the entire solution.
By purchasing this solution you'll be able to access the following files:
Solution.zip
Purchase Solution
$60.00 $30
Google Pay
Amazon
Paypal
Mastercard
Visacard
Discover
Amex
View Available Computer Science Tutors 639 tutors matched
Ionut
(ionut)
Master of Computer Science
Hi! MSc Applied Informatics & Computer Science Engineer. Practical experience in many CS & IT branches.Research work & homework
5/5 (6,804+ sessions)
1 hour avg response
$15-$50 hourly rate
Pranay
(math1983)
Doctor of Philosophy (PhD)
Ph.D. in mathematics and working as an Assistant Professor in University. I can provide help in mathematics, statistics and allied areas.
4.6/5 (6,670+ sessions)
1 hour avg response
$40-$50 hourly rate
Leo
(Leo)
Doctor of Philosophy (PhD)
Hi! I have been a professor in New York and taught in a math department and in an applied math department.
4.9/5 (6,425+ sessions)
2 hours avg response

Similar Homework Solutions