I am trying to create the below matrix in my vb.net so during processing I can get the match scores for the alphabets, for example: What is the match for A and N?, I will look into my inbuilt matrix and return -2 Similarly, What is the match for P and L?, I will look into my inbuilt matrix and return -3
Please suggest me how to go about it, I was trying to use nested dictionary like this:
Dim myNestedDictionary As New Dictionary(Of String, Dictionary(Of String, Integer))()
Dim lTempDict As New Dictionary(Of String, Integer)
lTempDict.Add("A", 4)
myNestedDictionary.Add("A", lTempDict)
The other way could be is to read the Matrix from a text based file and then fill the two dimensional array.
Thanks.
(source: clcbio.com)
Arrays. An array is the simplest and most widely used data structure. Other data structures like stacks and queues are derived from arrays.
Arrays. The array is the most basic data structure, merely a list of data elements that you can access by an index, which is the data's position inside the array. Arrays are quite efficient at searching if the elements in the array are ordered.
Arrays. An array is a linear data structure that holds an ordered collection of values. It's the most efficient in storing and accessing a sequence of objects.
When we think of data structures, there are generally four forms: Linear: arrays, lists. Tree: binary, heaps, space partitioning etc. Hash: distributed hash table, hash tree etc.
I would think it would be simpler to use an un-nested dictionary with two-character keys.
myDictionary.add("AA", 4)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With