Can you do it in order and with the element next to it

. 3

Step-by-step answer

15.12.2022, solved by verified expert
Unlock the full answer
1 students found this answer . helpful

Answer:

Congratulations are done on the basis of Auf bau rule.

Step-by-step explanation:

H(1) 1s1

He( 2) 1s2

Li (3) 1s2 2s1

Be(4) 1s2 2s2

B(5) 1s2 2s2 2p1

C(6) 1s2 2s2 2p2

N(7) 1s2 2s2 2p3 

O(8) 1s2 2s2 2p4

F(9) 1s2 2s2 2p5

Ne( 10) 1s2 2s2 2p6

Na( 11) 1s2 2s2 2p6 3s1

Mg ( 12) 1s2 2s2 p6 3s2

Al(13) 1s2 2s2 2p6 3s2 3p1

Si( 14) 1s2 2s2 2p6 3s2 3p2

P(15) 1s2 2s2 2p6 3s2 3p3

S(16) 1s2 2s2 2p6 3s2 3p4

Cl(17) 1s2 2s2 2p6 3s2 3p5

Ar(18) 1s2 2s2 2p6 3s2 3p6

K(19) 1s2 2s2 2p6 3s2 3p6 4s1

Ca(20) 1s2 2s2 2p6 3s2 3p6 4s2

Sc(21) 1s2 2s2 2p6 3s2 3p6 4s2 3d1

Ti(22)..........                                       3d2

V(23) ........                                          3d3

Cr(24)...                                       4s1 3d5

Mn(25).                                                3d5 

Fe(26).                                                  3d6 

Co(27).                                                  3d7

Ni(28)                                                   3d8 

Cu(29).                                           4s1 3d10

Zn(30).                                                    3d10

It is was helpful?

Faq

Computers and Technology
Step-by-step answer
P Answered by PhD

import java.util.NoSuchElementException;

public class LinkedStringList {

  private Node first;

  private Node currentNode;

  private int length;

  class Node

  {

      private String data;

      private Node next;

      public void printNodeData()

      {

          System.out.println("Node data: " + data);

      }

      public Node getNext()

      {

          return next;

      }

  }

  public LinkedStringList()

  {

      first = null;

      currentNode = null;

      length = 0;

  }

  public void addFirst(String value)

  {

      // create the Node and set its value

      Node newNode = new Node();

      newNode.data = value;

      // if newNode is the first node, this will be null

      // otherwise it will point to the former "first" now

      newNode.next = first;

      // set our "first" Node to the Node we just created

      first = newNode;

      currentNode = newNode;

      length++;

  }

  public void setFirstValue(String value)

  {

      first.data = value;

  }

  public void setCurrentValue(String value)

  {

      currentNode.data = value;

  }

  public void moveNext()

  {

      if (currentNode.next == null)

      {

          throw new NoSuchElementException();

      }

      else

      {

          currentNode = currentNode.next;

      }

  }

  public void moveFirst()

  {

      currentNode = first;

  }

  public boolean isEmpty()

  {

      return (first == null);

  }

  public int getLength()

  {

      return length;

  }

  public String getFirstValue()

  {

      if (first == null)

      {

          throw new NoSuchElementException();

      }

      else

      {

          return first.data;

      }

  }

  public String getCurrentValue()

  {

      if (currentNode == null)

      {

          throw new NoSuchElementException();

      }

      else

      {

          return currentNode.data;

      }

  }

  public void displayList()

  {

      Node currentNode = first;

      System.out.println("List contents:");

      while (currentNode != null)

      {

          currentNode.printNodeData();

          currentNode = currentNode.getNext();

      }

  }

  public void add(String value) {

      Node newNode = new Node();

      newNode.data = value;

      newNode.next = null;

      if (first == null || currentNode == null) {

          // create the Node and set its value

          // if newNode is the first node, this will be null

          // otherwise it will point to the former "first" now

          newNode.next = first;

          // set our "first" Node to the Node we just created

          first = newNode;

      } else {

          Node curr = first;

          while (curr.next != null) {

              curr = curr.next;

          }

          curr.next = newNode;

      }

      currentNode = newNode;

      length++;

  }

  public void removeFirst() {

      if (first == null)

      {

          throw new NoSuchElementException();

      } else if (first == currentNode) {

          first = first.next;

          currentNode = first;

      } else {

          first = first.next;

      }

  }

  public void remove() {

      if (first == null)

      {

          throw new NoSuchElementException();

      } else if (first.next == null) {

          first = null;

          currentNode = null;

      } else {

          Node curr = first, prev = null;

          while (curr != currentNode) {

              prev = curr;

              curr = curr.next;

          }

          prev.next = curr.next;

          currentNode = prev;

         

     

      }

      length--;

  }

  public int indexOf(String value) {

      Node curr = first;

      int index = -1;

      while (curr != null) {

          ++index;

          if (curr.data.equals(value))

              return index;

         

          curr = curr.next;

      }

     

      return index;

  }

  public void sortAscending() {

      if (length > 1) {

          for (int i = 0; i < length; i++) {

              Node currentNode = first;

              Node next = first.next;

              for (int j = 0; j < length - 1; j++) {

                  if (currentNode.data.compareTo(next.data) > 0) {

                      String temp = currentNode.data;

                      currentNode.data = next.data;

                      next.data = temp;

                  }

                  currentNode = next;

                  next = next.next;

              }

          }

      }

  }

 

  public static void main(String[] args) {

      LinkedStringList list = new LinkedStringList();

      list.add("First");

      list.add("Second");

      list.add("Third");

     

     

     

      list.displayList();

      System.out.println("---------After Modification:--------");

      list.moveFirst();

      list.setCurrentValue("Red");

      list.moveNext();

      list.setCurrentValue("Green");

      list.moveNext();

      list.setCurrentValue("Blue");

     

      list.displayList();

     

     

      System.out.println("Index of: " + list.indexOf("Green"));

     

      list.displayList();

     

      list.sortAscending();

     

      System.out.println("---------After Sort:--------");

     

      list.displayList();

     

     

      System.out.println("---------After Removing Twice:--------");

      list.remove();

      list.remove();

     

      list.displayList();

     

     

  }

}

Explanation:


Requirements: 1) You must follow the pattern (and starter code) given by Dr. Rimland in class 2) You
Computers and Technology
Step-by-step answer
P Answered by PhD

import java.util.NoSuchElementException;

public class LinkedStringList {

  private Node first;

  private Node currentNode;

  private int length;

  class Node

  {

      private String data;

      private Node next;

      public void printNodeData()

      {

          System.out.println("Node data: " + data);

      }

      public Node getNext()

      {

          return next;

      }

  }

  public LinkedStringList()

  {

      first = null;

      currentNode = null;

      length = 0;

  }

  public void addFirst(String value)

  {

      // create the Node and set its value

      Node newNode = new Node();

      newNode.data = value;

      // if newNode is the first node, this will be null

      // otherwise it will point to the former "first" now

      newNode.next = first;

      // set our "first" Node to the Node we just created

      first = newNode;

      currentNode = newNode;

      length++;

  }

  public void setFirstValue(String value)

  {

      first.data = value;

  }

  public void setCurrentValue(String value)

  {

      currentNode.data = value;

  }

  public void moveNext()

  {

      if (currentNode.next == null)

      {

          throw new NoSuchElementException();

      }

      else

      {

          currentNode = currentNode.next;

      }

  }

  public void moveFirst()

  {

      currentNode = first;

  }

  public boolean isEmpty()

  {

      return (first == null);

  }

  public int getLength()

  {

      return length;

  }

  public String getFirstValue()

  {

      if (first == null)

      {

          throw new NoSuchElementException();

      }

      else

      {

          return first.data;

      }

  }

  public String getCurrentValue()

  {

      if (currentNode == null)

      {

          throw new NoSuchElementException();

      }

      else

      {

          return currentNode.data;

      }

  }

  public void displayList()

  {

      Node currentNode = first;

      System.out.println("List contents:");

      while (currentNode != null)

      {

          currentNode.printNodeData();

          currentNode = currentNode.getNext();

      }

  }

  public void add(String value) {

      Node newNode = new Node();

      newNode.data = value;

      newNode.next = null;

      if (first == null || currentNode == null) {

          // create the Node and set its value

          // if newNode is the first node, this will be null

          // otherwise it will point to the former "first" now

          newNode.next = first;

          // set our "first" Node to the Node we just created

          first = newNode;

      } else {

          Node curr = first;

          while (curr.next != null) {

              curr = curr.next;

          }

          curr.next = newNode;

      }

      currentNode = newNode;

      length++;

  }

  public void removeFirst() {

      if (first == null)

      {

          throw new NoSuchElementException();

      } else if (first == currentNode) {

          first = first.next;

          currentNode = first;

      } else {

          first = first.next;

      }

  }

  public void remove() {

      if (first == null)

      {

          throw new NoSuchElementException();

      } else if (first.next == null) {

          first = null;

          currentNode = null;

      } else {

          Node curr = first, prev = null;

          while (curr != currentNode) {

              prev = curr;

              curr = curr.next;

          }

          prev.next = curr.next;

          currentNode = prev;

         

     

      }

      length--;

  }

  public int indexOf(String value) {

      Node curr = first;

      int index = -1;

      while (curr != null) {

          ++index;

          if (curr.data.equals(value))

              return index;

         

          curr = curr.next;

      }

     

      return index;

  }

  public void sortAscending() {

      if (length > 1) {

          for (int i = 0; i < length; i++) {

              Node currentNode = first;

              Node next = first.next;

              for (int j = 0; j < length - 1; j++) {

                  if (currentNode.data.compareTo(next.data) > 0) {

                      String temp = currentNode.data;

                      currentNode.data = next.data;

                      next.data = temp;

                  }

                  currentNode = next;

                  next = next.next;

              }

          }

      }

  }

 

  public static void main(String[] args) {

      LinkedStringList list = new LinkedStringList();

      list.add("First");

      list.add("Second");

      list.add("Third");

     

     

     

      list.displayList();

      System.out.println("---------After Modification:--------");

      list.moveFirst();

      list.setCurrentValue("Red");

      list.moveNext();

      list.setCurrentValue("Green");

      list.moveNext();

      list.setCurrentValue("Blue");

     

      list.displayList();

     

     

      System.out.println("Index of: " + list.indexOf("Green"));

     

      list.displayList();

     

      list.sortAscending();

     

      System.out.println("---------After Sort:--------");

     

      list.displayList();

     

     

      System.out.println("---------After Removing Twice:--------");

      list.remove();

      list.remove();

     

      list.displayList();

     

     

  }

}

Explanation:


Requirements: 1) You must follow the pattern (and starter code) given by Dr. Rimland in class 2) You
Computers and Technology
Step-by-step answer
P Answered by PhD

// The program below checks if an array is sorted or not

// Program is written in C++ Programming Language.

// Comments are used for explanatory purpose

//Program Starts here

#include<iostream>

using namespace std;

//Function to check if the array is sorted starts here

int isSorted(int arr[], int count)

{

// Check if arrays has one or no elements

if (count == 1 || count == 0) {

return 1;

}

else

{

// Check first two elements

if(arr[0] >= arr[1])

{

return 0; // Not sorted

}

else

{ // Check other elements

int check = 0;

for(int I = 1; I<count; I++){

if (arr[I-1] > arr[I]) { // Equal number are allowed

check++; // Not sorted

}

}

}

if(check==0)

return isSorted(arr, count - 1); //Sorted

else

return 0; // Not sorted

}

// Main Method starts here

int main()

{

int count;

cin<<count;

int arr[count];

for(int I = 1; I<=count; I++)

{

cin>>arr[I-1];

}

int n = sizeof(arr) / sizeof(arr[0]);

if (isSorted(arr, n))

cout << "Array is sorted";

else

cout << "Array is not sorted";

}

Computers and Technology
Step-by-step answer
P Answered by PhD

RANDY returns randomly, therefore any file within the index range with uniform distribution will have the recurrence relation to be

T(n) = T(n-i) + O(1)

With probability 1/n where i can range from 1 to n. Here, parameter n inside T(n) indicate the size of index range which will become (n-i) in next iteration.

Since i can range from 1 to n with probability 1/n, therefore the average case time complexity will be

T(n) = \sum_{i=1}^{n}\frac{1}{n}T(n-i) + O(1) = T(n/2)+O(1)

Now solving T(n) = T(n/2)+O(1)

Will give T(n) = O(log n)

Therefore time complexity of this algorithm is O(log n).

Note that this is average time complexity because it's a randomized algorithm. In worst case, index range may just reduce by 1 and give time complexity of O(n) since in worst case T(n) = T(n-1)+O(1)

Computers and Technology
Step-by-step answer
P Answered by PhD

RANDY returns randomly, therefore any file within the index range with uniform distribution will have the recurrence relation to be

T(n) = T(n-i) + O(1)

With probability 1/n where i can range from 1 to n. Here, parameter n inside T(n) indicate the size of index range which will become (n-i) in next iteration.

Since i can range from 1 to n with probability 1/n, therefore the average case time complexity will be

T(n) = \sum_{i=1}^{n}\frac{1}{n}T(n-i) + O(1) = T(n/2)+O(1)

Now solving T(n) = T(n/2)+O(1)

Will give T(n) = O(log n)

Therefore time complexity of this algorithm is O(log n).

Note that this is average time complexity because it's a randomized algorithm. In worst case, index range may just reduce by 1 and give time complexity of O(n) since in worst case T(n) = T(n-1)+O(1)

Computers and Technology
Step-by-step answer
P Answered by PhD

// The program below checks if an array is sorted or not

// Program is written in C++ Programming Language.

// Comments are used for explanatory purpose

//Program Starts here

#include<iostream>

using namespace std;

//Function to check if the array is sorted starts here

int isSorted(int arr[], int count)

{

// Check if arrays has one or no elements

if (count == 1 || count == 0) {

return 1;

}

else

{

// Check first two elements

if(arr[0] >= arr[1])

{

return 0; // Not sorted

}

else

{ // Check other elements

int check = 0;

for(int I = 1; I<count; I++){

if (arr[I-1] > arr[I]) { // Equal number are allowed

check++; // Not sorted

}

}

}

if(check==0)

return isSorted(arr, count - 1); //Sorted

else

return 0; // Not sorted

}

// Main Method starts here

int main()

{

int count;

cin<<count;

int arr[count];

for(int I = 1; I<=count; I++)

{

cin>>arr[I-1];

}

int n = sizeof(arr) / sizeof(arr[0]);

if (isSorted(arr, n))

cout << "Array is sorted";

else

cout << "Array is not sorted";

}

Computers and Technology
Step-by-step answer
P Answered by PhD

1. cout << monthSales[9];

2. arr[VECTOR_SIZE - 2] = x;

3. cout << a[33];

Explanation:

In the given question the programming language is not mentioned to write the statements, so the statements are written in C++ programming language.

1. 

Although months are between 1-12. Therefore, in January we can mark as element 0, February as element 1, and so on. So October, which was initially 10, was numbered 9.

2.

The second to last dimension is the next to the last element. The final element is smaller than the actual vector scale. The next place to the last element would, therefore, be two less than the vector size.

3.

The last element of the vector array is one less than the total vector number since vectors start at 0.

Computers and Technology
Step-by-step answer
P Answered by PhD

1. cout << monthSales[9];

2. arr[VECTOR_SIZE - 2] = x;

3. cout << a[33];

Explanation:

In the given question the programming language is not mentioned to write the statements, so the statements are written in C++ programming language.

1. 

Although months are between 1-12. Therefore, in January we can mark as element 0, February as element 1, and so on. So October, which was initially 10, was numbered 9.

2.

The second to last dimension is the next to the last element. The final element is smaller than the actual vector scale. The next place to the last element would, therefore, be two less than the vector size.

3.

The last element of the vector array is one less than the total vector number since vectors start at 0.

Computers and Technology
Step-by-step answer
P Answered by Specialist

Explanation:

Using Python as our programming language

code:

def partitionArray(A,k):

flag=0

if not A and k == 1:

return "Yes"

if k > len(A) or len(A)%len(A):

return "No"

flag+=1

cnt = {i:A.count(i) for i in A}

if len(A)//k < max(cnt.values()):

return "No"

flag+=1

if(flag==0):

return "Yes"

k=int(input("k= "))

n=int(input("n= "))

print("A= ")

A=list(map(int,input().split()))[:n]

print(partitionArray(A,k))

Code Screenshot:-

Try asking the Studen AI a question.

It will provide an instant answer!

FREE