dataSnapshot.getChildrenCount() it will show you total number of children's.!
All you have to do is make a Model class save your value in objects and while editing check if object has same data then don't update data and if its different then update data.!