Master Fuji
BAN USERmissed a point, in fact compressed trie does the same.
- Master Fuji June 29, 2011sorting and indexing at each level, starting from isd code, std code then local codes
if any of the particular index is growing par limit, again subindex it. compressed trie would do the same functionality
@Dan, what ever it is, but it got some strategy to solve
I recommend two data structures, one is to maintain a array of pointers to lists,each pointer is pointing to list of reachable locns from locn, in non decreasing order of their probabilities
-----
addr1| ->locn3(0.4,4 sec)->locn4(0.1,45 sec)->null
-----
addr2|->null
-----
addr3|->locn2(0.2,34 sec)->locn1(0.2, 76 sec)->null
-----
other is a map<locn,bool> set to all false on start, which on reaching is set to true
typdef struct
{
prob;
duration;
locn;
List* next;
}List;
typdef struct
{
locn;
bt * next;
}bt;
Bt *bt;
int locate(vector<List*> list ,map<locn> m)
{
int i=0;
double total_duration;
List temp = list[i];
bool found = false;
int total_locn = m.size();//total entries
int total_visited =1;
do
{
if( total_locn == total_visited)
{
print(total_duration);
return 0;
}
while(temp || m(temp)) temp=temp->next;
if(!temp) // no more movements
{
print("NO SoLUTION");
return 1;
}
else
{
m(temp) = true;
total_duration += temp->duration;
add_traversal_path(bt,temp->locn);
temp = set_vector_index(temp);// sets temp with list pointer of current locn
total_visited++;
add_traversal_path(bt,temp);// for tracking path
}
}(while(!found))
return 0;
}
move all elements in 2nd array towards right and do merging
- Master Fuji April 21, 2011sorry!! it works fine
- Master Fuji April 21, 2011it fails at
8
3 10
1 6 N N
N N 4 9
thanks wooohooo......
can't view the pictures though, plz update pics again
however i think it might fail incase, current block there is no allocation and it has span uptill this block from previous
Allocate(199)
Allocate(5222)
lookup(8300) - it might fail coz my map would look like
0 - 199
1 - 5222
correct me if im wrong
public int lookup(int lookup) {
Integer input_address = lookup;
int address_return, new_return_value;
if (hash.containsKey(input_address/4096)) {
address_return = hash.get(input_address/4096);
if (input_address >= address_return)
return address_return;
} // it checks and returns immediately
if (hash.containsKey(input_address/4096 - 1)) {
new_return_value = hash.get(input_address/4096 - 1);
if (new_return_value + 4096 > input_address)
return new_return_value
}
return -1; /* shouldn't get here, ever */
}
take two bit vectors one each for array,for bit vector B set bits which has values between 0 and 1024, finally do bitwise-and operation
that will give u intended result
RepSandraGabriel, Analyst at ABC TECH SUPPORT
We Data Entry Operators have a variety of duties, including processing documents, solving inconsistencies, securing information, updating databases and using ...
Repgladysloweg, Brokerage clerk at Bell Markets
I am Gladys from Defiance city . I am working as a Brokerage clerk with tasks associated with securities such as ...
RepAriAllen, AT&T Customer service email at ABC TECH SUPPORT
I have experience with collecting data and conducting experiments for studies in a variety of industries. I am a respected ...
I think words needs to be arranged in a line to avoid as much spaces as possible
this is what i got .. give ur comments
- Master Fuji October 08, 2011