length of a vector code example
Example 1: vector length c++
#include <vector>
int main () {
std::vector<int> v;
auto size = v.size();
}
Example 2: vector length formula
||v|| = sqrt(a^2+b^2)
Example 3: vector length java
import java.util.*;
class sizeaf
{
public static void main(String args[])
{
Vector v = new Vector();
v.add(1);
v.add(2);
v.add(3);
v.add(4);
System.out.println("Size : "+v.size());
}
}