Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #3051

Re: data structure that preserving insertion order

From Owner <Owner@Owner-PC.com>
Newsgroups comp.lang.c
Subject Re: data structure that preserving insertion order
Date 2011-04-29 13:35 -0400
Organization Aioe.org NNTP Server
Message-ID <pan.2011.04.29.17.35.35.60000@Owner-PC.com> (permalink)
References (1 earlier) <c6a02a1d-fe65-4fe7-bc19-99bd026aeacd@j26g2000yqa.googlegroups.com> <pan.2011.04.29.12.42.37.649000@Owner-PC.com> <0.be0c9ded1648c0c8479c.20110429162315BST.87zkn984kc.fsf@bsb.me.uk> <pan.2011.04.29.16.16.12.154000@Owner-PC.com> <0.8f97b0f95914d356e495.20110429181546BST.87hb9h7zct.fsf@bsb.me.uk>

Show all headers | View raw


On Fri, 29 Apr 2011 18:15:46 +0100, Ben Bacarisse wrote:

> Owner <Owner@Owner-PC.com> writes:
> 
>> On Fri, 29 Apr 2011 16:23:15 +0100, Ben Bacarisse wrote:
>>
>>> Owner <Owner@Owner-PC.com> writes:
>>> <snip>
>>>> Yes exactly, preserving order like that but with large data
>>>> like unicode mapping.  data structure preserving the inorder
>>>> of character( character has its own value according 
>>>> character set but when inserted the character in some 
>>>> sort of data structure, it preserves inorder ) with able 
>>>> to search the character efficiently.
>>> 
>>> I'm still not sure what you want.  In particular what is "Unicode
>>> mapping"?  Presumably it maps Unicode code points to ... what?
>>> 
>>> Anyway, any data structure that supports the mapping you want can be
>>> made to record the insertion order, simply by maintaining a list at the
>>> same time.  This so simple that I image it is not what you want but I
>>> can't tell.  Why not say what the actual problem is that needs to be
>>> solved?
>>
>> Trying to build tr unix tool that supports unicode.
>> ascii is 128 characters so a array can hold characters.
>> unicode is a little over 10,000 characters.
>> thought a binary tree could be right structure.  but then
>> I need preserve order which character goes in first.
> 
> Why?  I'd use something like a hash table.  I don't see any need to
> remember the insertion order.  What's your reasoning?

If you command something like "tr hashtable empttable"

replacing same length word hashtable with empttable.

I thought inorder needs to be preserved to replace the word,

no?

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

data structure that preserving insertion order Owner <Owner@Owner-PC.com> - 2011-04-28 22:10 -0400
  Re: data structure that preserving insertion order Peter Nilsson <airia@acay.com.au> - 2011-04-28 23:02 -0700
    Re: data structure that preserving insertion order Owner <Owner@Owner-PC.com> - 2011-04-29 08:06 -0400
  Re: data structure that preserving insertion order Paul N <gw7rib@aol.com> - 2011-04-29 05:18 -0700
    Re: data structure that preserving insertion order Owner <Owner@Owner-PC.com> - 2011-04-29 08:42 -0400
      Re: data structure that preserving insertion order Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-04-29 16:23 +0100
        Re: data structure that preserving insertion order Owner <Owner@Owner-PC.com> - 2011-04-29 12:16 -0400
          Re: data structure that preserving insertion order Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-04-29 18:15 +0100
            Re: data structure that preserving insertion order Owner <Owner@Owner-PC.com> - 2011-04-29 13:35 -0400
              Re: data structure that preserving insertion order Kai-Uwe Bux <jkherciueh@gmx.net> - 2011-04-29 20:00 +0200
                Re: data structure that preserving insertion order Owner <Owner@Owner-PC.com> - 2011-04-29 14:15 -0400
              Re: data structure that preserving insertion order James Kuyper <jameskuyper@verizon.net> - 2011-04-29 19:17 -0400
          Re: data structure that preserving insertion order "Scott Fluhrer" <sfluhrer@ix.netcom.com> - 2011-04-29 13:08 -0400
          Re: data structure that preserving insertion order William Ahern <william@wilbur.25thandClement.com> - 2011-04-29 10:53 -0700
            Re: data structure that preserving insertion order Owner <Owner@Owner-PC.com> - 2011-04-29 14:17 -0400
              Re: data structure that preserving insertion order James Kuyper <jameskuyper@verizon.net> - 2011-04-29 19:24 -0400
              Re: data structure that preserving insertion order Gene <gene.ressler@gmail.com> - 2011-04-29 16:25 -0700

csiph-web