What is BitSet in Scala?

0 votes
Can any help me out with the above question and how does BitSet works?
Jul 25 in Apache Spark by Jigar
29 views

1 answer to this question.

0 votes

Hey,

A BitSet is a set of non-negative integers depicted as arrays. These arrays are variable in size and packed into 64-bit words. The largest number in a BitSet determines its memory footprint. 

Let’s take an example:

scala> import scala.collection.immutable._

import scala.collection.immutable._

scala> var nums=BitSet(7,2,4,3,1)

nums: scala.collection.immutable.BitSet = BitSet(1, 2, 3, 4, 7)

scala> nums+=9 

scala> nums
answered Jul 25 by Gitika
• 25,340 points

Related Questions In Apache Spark

0 votes
1 answer

What is ofDim in Scala?

Hey, ofDim() is a method in Scala that ...READ MORE

answered Jul 24 in Apache Spark by Gitika
• 25,340 points
46 views
0 votes
1 answer

What is exception propagation in Scala?

Hi, When a function experiences an exception, it ...READ MORE

answered Jul 25 in Apache Spark by Gitika
• 25,340 points
27 views
0 votes
1 answer

What is Streams in Scala?

Hi, A stream is a lazy list as ...READ MORE

answered Jul 25 in Apache Spark by Gitika
• 25,340 points
31 views
0 votes
1 answer

What is recursion in Scala function? How does it works?

Hey, A Scala function involves recursion when it ...READ MORE

answered Jul 25 in Apache Spark by Gitika
• 25,340 points
22 views
0 votes
1 answer
0 votes
1 answer

Hadoop Mapreduce word count Program

Firstly you need to understand the concept ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 10,690 points
3,028 views
0 votes
1 answer

hadoop.mapred vs hadoop.mapreduce?

org.apache.hadoop.mapred is the Old API  org.apache.hadoop.mapreduce is the ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 10,690 points
339 views
0 votes
10 answers

hadoop fs -put command?

put syntax: put <localSrc> <dest> copy syntax: copyFr ...READ MORE

answered Dec 7, 2018 in Big Data Hadoop by Aditya
14,954 views
0 votes
1 answer

What is “Unit” and “()” in Scala?

Hey, Unit is a subtype of scala.anyval and ...READ MORE

answered Jul 24 in Apache Spark by Gitika
• 25,340 points
35 views
0 votes
1 answer

What is the advantage of having immutability in design for Scala programming language?

Hi, Scala uses immutability by default in most ...READ MORE

answered Jul 24 in Apache Spark by Gitika
• 25,340 points
38 views