No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
I know an AVL Tree guarantees a time of log(n), but what is the time cost of the actual re balancing of the tree and why is this ignored? |
|
I seem to have an error updating a checkbox using an SQL Query. I am trying to get the box to be checked if equal to 1 and unchecked if equal to 0. My database is updating correctly, but the checkbox is not. [CODE]<input type="checkbox" <?php if ($row['create_event'] = 1){ … |
|
I am trying to optimize my hash function, for a separate chaining hash table that I have created from scratch. My hash function is as follows: [CODE] int hash( const string &key, int tableSize) { int hashVal = 0; for(int i = 0; i<key.length(); i++) hashVal = 37*hashVal+key[i]; hashVal %= … |
|
When I declare a new Hashtable such as: String a = null; HashTable<string> = new HashTable(a, 100); It tells me HashTable is not a type. [CODE]#ifndef HASHTABLE_H #define HASHTABLE_H #include <iostream> #include <vector> #include <list> using namespace std; template <typename HashedObj> class HashTable { public: explicit HashTable( const HashedObj & … |
|
My compiler is throwing me this error when I try to make a new one. I am trying to make it with this [CODE]string a = "five"; HashTable<string> *hashy = new HashTable<string>(a,100);[/CODE] This is the compiler error (.text+0x1d3): undefined reference to `HashTable<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >::HashTable(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, … |
|
My code is an expression tree program, in which I make treenodes pointers and push them in the end all into the 1st spot of a stack, in which is declared in my header file of the program. I wipe all the treenode pointers with a recursive traversal. Is this … |
|
I'm creating an expression tree that reads in postfix notation and converts it and prints it out into infix notation. I was wondering how would I go about correctly distributing parentheses and balancing them properly. |
|
I'm having a problem reading in a file to a scanner, it is supposed to take in a filename and then evaluate whether it is a URL or filename, but it having trouble reading just a local file. [CODE]public boolean loadSongs(String filename) { Scanner load1 = null; if (filename.contains("http")) { … |
|
I'm having a problem with creating my own stack class and implementing it in a postfix calculator program I made. I was trying to make the stack.h file, but it keeps telling me stack is not a template [CODE]#ifndef STACK_H #define STACK_H #include <iostream> using namespace std; template <typename T> … |