Can anyone help me decipher this?
Go to solution
Solved by madknight3,
1 hour ago, Remixt said:What on gods green earth is a characteristic vector?
Sorry if I'm incorrect but I think it's referring to this. Simple right? Well, I understand if that's also confusing so I'll try to explain it as I understand it.
Lets use an easy example (using pseudocode).
// Lets assume you're storing a set of boolean values // The set of all boolean values is {False, True} // So the characteristic vector would be vec = [0,0] // and here's your currently empty set set = {} // vec[0] denotes false // vec[1] denotes true // So if you have your own set object and you add false to it. // Then you change the false location to 1 // Now you have set = {false} vec = [1,0] // Now if you add true to your set you have set = {false, true} vec = [1,1] // if you try to add true or false to your set, you know they already exist // because the characteristic vector has a 1 in those spots // Now if you remove false from your set you have set = {true} vec = [0,1]
Lets take something a little bigger but still easy.
// Lets assume you're storing a set of integer values in the range of 1 and 10 inclusive // The set of all values is {1, 2, 3, 4, 5, 6, 7, 8, 9, 10} // So the characteristic vector would be vec = [0,0,0,0,0,0,0,0,0] // vec[0] denotes 1 // vec[1] denotes 2 // etc // and here's your currently empty set set = {} // So if you have your own set object and you add 5 to it. // Then you change the 5th location to 1 // Now you have set = {5} vec = [0,0,0,0,1,0,0,0,0,0] // if you try to add 5 to it again you know it already exists // because the characteristic vector has a 1 in that spot
The same concept can be applied to ASCII characters, or anything that can be represented uniquely by a natural number. Hopefully you are getting the idea.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now