473,769 Members | 5,869 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Array and Hash in JavaScript : materials for FAQ : v2

VK
A while ago I proposed to update info in the group FAQ section, but I
dropped the discussion using the approach "No matter what color the cat
is as long as it still hounts the mice". Over the last month I had
enough of extra proof that the cat doesn't hount mice anymore in more
and more situations. And the surrent sicretisme among array and hash is
the base for it.

I summarized all points in this article:
<http://www.geocities.c om/schools_ring/ArrayAndHash.ht ml>

I invite all members of the previous discussion, as well as anyone
interested in Array vs Hash mechanics in JavaScript to read this
article and to express your opinion (if any).

As each point in the article is illustrated by a concrete code sample,
I expect do not see any abstract considerations/injurations. But of
course factual mistakes illustrated by contre-samples should be edited
immediately.

Jul 23 '05
22 4643
VK
>> As you don't need to allocate memory
for your var's (talking JavaScript only).
The second sentence doesn't make sense.
Simply means that you *usually* don't have to worry about memory
menagement issues in JavaScript (variables, baskets etc.). And if you
even had have some worries, the only way to handle them would be a pill
of Prozac because JavaScript itself has nearly nothing to offer.
Do you really know what a hash table is?

I guess I do. But if you have ideas how to check something for
"hashness" for 100% guarantee, I would love to hear it. That qualities
should be tested and what responses should be received?

Jul 23 '05 #21
In article <11************ *********@z14g2 000cwz.googlegr oups.com>, VK
<sc**********@y ahoo.com> writes
As you don't need to allocate memory
for your var's (talking JavaScript only).

The second sentence doesn't make sense.


Simply means that you *usually* don't have to worry about memory
menagement issues in JavaScript (variables, baskets etc.). And if you
even had have some worries, the only way to handle them would be a pill
of Prozac because JavaScript itself has nearly nothing to offer.
Do you really know what a hash table is?

I guess I do. But if you have ideas how to check something for
"hashness" for 100% guarantee, I would love to hear it. That qualities
should be tested and what responses should be received?


It looks as though you don't know what can go wrong with the hashing
function, the function that turns key values into bucket numbers.

I can only conclude that you really don't know what a hash table is.

John
--
John Harris
Jul 23 '05 #22
"VK" <sc**********@y ahoo.com> writes:

Please include attributions for your quotes!
Do you really know what a hash table is?

I guess I do. But if you have ideas how to check something for
"hashness" for 100% guarantee, I would love to hear it. That qualities
should be tested and what responses should be received?


Then I would say that you don't.

A hast table is an implementation of an associative array that uses
hash values (numbers) calculated from key values to do approx.
constant time lookup.

There are no external qualities, except time compliexity of
operations, that distinguish a hash based implementation from other
choices of implementation.

The 100% guarantee only requires looking at the code implementing
the associative array.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 23 '05 #23

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

26
9632
by: JGH | last post by:
How can I check if a key is defined in an associative array? var users = new array(); users = "Joe Blow"; users = "John Doe"; users = "Jane Doe"; function isUser (userID) { if (?????)
47
5088
by: VK | last post by:
Or why I just did myArray = "Computers" but myArray.length is showing 0. What a hey? There is a new trend to treat arrays and hashes as they were some variations of the same thing. But they are not at all. If you are doing *array", then you have to use only integer values for array index, as it was since ALGOL.
21
21220
by: scandal | last post by:
I am a javascript newbie working on a script that checks whether a "path" from one element in an array to another is "blocked." Currently, the script pushes an already processed cell index (hence an integer) into an array. To prevent rechecking already processed cells, the script iterates through the (sorted) array to see whether that integer is an element of the array. After reading about javascript arrays a bit more, I thought...
7
39848
by: Robert Mark Bram | last post by:
Hi All! How do you get the length of an associative array? var my_cars= new Array() my_cars="Mustang"; my_cars="Station Wagon"; my_cars="SUV"; alert(my_cars.length);
8
74892
by: J. B. Moreno | last post by:
What's the best (i.e. fastest) way to find out if an array contains a given value? Other than looping, the only way I know to do it is to use an associative array/hash instead.... Is there a better/faster way? I.e if I have a list of names, what's the best way to find out if the aray contains "jane"? --
38
5228
by: VK | last post by:
Hello, In my object I have getDirectory() method which returns 2-dimentional array (or an imitation of 2-dimentional array using two JavaScript objects with auto-handled length property - please let's us do not go into an "each dot over i" clarification discussion now - however you want to call - you call it ;-) array contains records of all files in the current dir. array contains records of all subs in the current dir
21
3222
by: yeti349 | last post by:
Hi, I'm using the following code to retrieve data from an xml file and populate a javascript array. The data is then displayed in html table form. I would like to then be able to sort by each column. Once the array elements are split, what is the best way to sort them? Thank you. //populate data object with data from xml file. //Data is a comma delimited list of values var jsData = new Array(); jsData = {lib: "#field...
104
17007
by: Leszek | last post by:
Hi. Is it possible in javascript to operate on an array without knowing how mamy elements it has? What i want to do is sending an array to a script, and this script should add all values from that array Could you show me a little example how to do this? Thanks.
7
3797
by: Sam Kong | last post by:
Hello! My question would not be very practical but just out of curiosity. In JavaScript, Array is a subclass of Object. Well maybe not exactly... but sort of... For normal objects, you can access members by writing either of the two. obj.memberName
0
9579
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
9979
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8861
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7393
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6661
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5293
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5433
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3948
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3551
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.