电子配置逻辑 [英] Electron Configuration Logic

查看:186
本文介绍了电子配置逻辑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个方法(Java)中找出电子配置的元素。

I am trying to create a method (in java) to figure out the Electron Configuration for an element.

例。
他(第二单元:2个电子)电子配置:1秒 2     
O(8元8个电子)电子配置:1秒 2 2秒 2 2P 4     
锆(40元40电子)电子配置:1秒 2 2秒 2 2P 6 3秒 2 3P 6 4S 2 3D 10 4P 6 5秒 2 4D 2

Ex.
He (2nd element: 2 electrons) Electron config: 1s2
O (8th element 8 electrons) Electron config: 1s2 2s2 2p4
Zr (40th element 40 electrons) Electron config: 1s2 2s2 2p6 3s2 3p6 4s2 3d10 4p6 5s2 4d2

我怎样才能找出逻辑来计算呢?当递增S,P,D和F壳,以及如图出标为每个壳

How can I figure out the logic to calculate this? When to increment the s, p, d, and f shells, as well as figure out the superscript for each shell.

的S 2电子MAX(2下标max)
6电子{P MAX(6下标max)
10电子ð最大(10标最大)
F最大的14电子(14标最大)

S max of 2 electrons (superscript max of 2)
P max of 6 electrons (superscript max of 6)
D max of 10 electrons (superscript max of 10)
F max of 14 electrons (superscript max of 14)

递归吧?

推荐答案

您可以创建一个类重present具有以下属性配置:

You may create a class for represent the configuration with the following attributes:

private final boolean[] K = new boolean[ 2];
private final boolean[] L = new boolean[ 8];
private final boolean[] M = new boolean[18];
private final boolean[] N = new boolean[32];
private final boolean[] O = new boolean[32];
private final boolean[] P = new boolean[32];

用于分配的地方,错误的一个自由的地方。

true for an allocated place, false for a free place.

实例钾:

K[0] = true;
K[1] = true;
L[0] = true;
...
L[7] = true;
M[0] = true;
...
M[7] = true;
N[0] = true;

这篇关于电子配置逻辑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆