SORU
12 AĞUSTOS 2008, Salı


En iyi Anahtar Değeri için uygulama Veri Yapısı Çift?

C ile çevresinde alay ettim# son zamanlarda, ve tüm Genel Koleksiyon benim biraz kafam karıştı. Demek istediğim temsil eden bir veri yapısı kafasını bir ağaç bir anahtar değer çifti, ve sonra bir isteğe bağlı listesi anahtar değer çiftleri altında (ama başka aşama daha bu). Bu uygun olur mu?

public class TokenTree
{
    public TokenTree()
    {
        /* I must admit to not fully understanding this,
         * I got it from msdn. As far as I can tell, IDictionary is an
         * interface, and Dictionary is the default implementation of
         * that interface, right?
         */
        SubPairs = new Dictionary<string, string>();
    }

    public string Key;
    public string Value;
    public IDictionary<string, string> SubPairs;
}

Sadece gerçekten veri iletimi için basit bir yol.

CEVAP
12 AĞUSTOS 2008, Salı


Gerçek bir Veri Türü KeyValuePair aradı, böyle bir kullanım yoktur

KeyValuePair<string, string> myKeyValuePair = new KeyValuePair<string,string>("defaultkey", "defaultvalue");

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • Flash CS6 Video Tutorials for Beginners (Actionscript 3 Gaming)

    Flash CS6 Vi

    14 EYLÜL 2012
  • Kenneth Håkonsen

    Kenneth Håk

    13 Mart 2011
  • maxman.tv

    maxman.tv

    29 EKİM 2013