Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

Lv 14 points

ali

Favorite Answers0%
Answers36
  • questions about conditional and un conditional instructionsWrite assembly language?

    questions about conditional and un conditional instructionsWrite assembly language to find sum between two number for example 6 and 2 the answer will be 2+3+4+5+6=20

    1 AnswerProgramming & Design3 years ago
  • question about assembly language?

    my question is if i want to add number by the number before it for example 4+3+2+1+0=10

    how i can do it by using emu8086 i try by using there code but it had many error

    include 'emu8086.inc'

    org 100h

    mov ax,4

    mov bx,0

    add ax,bx

    jz a

    dec ax,1

    add ax,bx

    jmp exit

    2 AnswersProgramming & Design3 years ago
  • i want to convert there python code to java how i can do it ?can any one help me?

    __slots__='_element','_prev','_next';

    def __init__(self,element,prev,next);

    self._element=element;

    self._prev=prev;

    self._next=next;

    def __init__(self);

    self._heart=self._Node(None,None,None)

    self._club=self.Node(None,None,None)

    self._spade=self._Node(None,None,None)

    self._diamond=self._Node(None,None,None)

    self.trailer=self._Node(None,None,None)

    self._heart._next=self._Node

    self._club._prev=_self._heart

    self._club._next=self.spade

    self._spade._prev=self._club

    self._spade._next=self._diamond

    self._diamond._prev=self._spade

    self._diamond._next=self._trailer

    self._trailer._prev=self._diamond

    self._size=0

    self._heart_size=0;

    self._club_size=0

    self._spade_size=0

    self._diamon_size=0

    def__len__(self);

    return self._size

    dep all_of_suit(self,s);

    if(s=='heart') and (self._heart_size>0);

    cursor =self._heart._next

    while cursor ._elemnt is not None;

    yield Cursor

    CROSSHAIR_CURSOR element

    if(s=='club')and (self._club_size>0);

    cursor=self._club._next

    while cursor._element is not None;

    yield cursor._element

    cursor=cursor._next

    if (s=='spade')and (self ._spade_size >0);

    cursor=self._spade._next

    while cursor ._elemnt is not None;

    yield cursor ._element

    cursor = cursor ._next

    if (s=='diamond')and (self._diamond _size>0);

    while cursor ._element is not None ;

    yield Cursor .CROSSHAIR_CURSOR element

    cursor = cursor ._next

    }

    1 AnswerProgramming & Design4 years ago
  • please this code about doubly linked lis is important can any one help me?

    I want to create method two add between to element or two node any here know it

    ?

    public class DoublyLinkedListImpl<E> {

    private Node head;

    private Node tail;

    private int size;

    public DoublyLinkedListImpl() {

    size = 0;

    }

    /**

    * this class keeps track of each element information

    * @author java2novice

    *

    */

    private class Node {

    E element;

    Node next;

    Node prev;

    public Node(E element, Node next, Node prev) {

    this.element = element;

    this.next = next;

    this.prev = prev;

    public void addBetween(Node e1, E first element, Node second element) {

  • add node between two node?

    i have another question if i want two add node between two node in doubly linked list

    add between is my method if i have two add method one for first and one for second what i shall do in my add between method

    import java.util.NoSuchElementException;

    public class DoublyLinkedListImpl<E> {

    private Node head;

    private Node tail;

    private int size;

    public DoublyLinkedListImpl() {

    size = 0;

    }

    /**

    * this class keeps track of each element information

    * @author java2novice

    *

    */

    private class Node {

    E element;

    Node next;

    Node prev;

    public Node(E element, Node next, Node prev) {

    this.element = element;

    this.next = next;

    this.prev = prev;

    }

    }

    /**

    * returns the size of the linked list

    * @return

    */

    public int size() { return size; }

    /**

    * return whether the list is empty or not

    * @return

    */

    public boolean isEmpty() { return size == 0; }

    public E getFirstt()

    {

    return head.element;

    }

    public E getLast()

    {

    return tail.element;

    }

    /**

    * adds element at the starting of the linked list

    * @param element

    */

    private void addBetween(Node e1, E elem, Node e2) {

    prior.add(elem);

    }

    2 AnswersProgramming & Design4 years ago
  • linked list get first &last element?

    my program is about doubly linked list and I want to add two method one to get first element and another one to get last element ,these are my codes but when I add any code two this method it give me an error

    package doublelinkeddd;

    import java.util.NoSuchElementException;

    public class DoublyLinkedListImpl<E> {

    private Node head;

    private Node tail;

    private int size;

    public DoublyLinkedListImpl() {

    size = 0;

    }

    private class Node {

    E element;

    Node next;

    Node prev;

    public Node(E element, Node next, Node prev) {

    this.element = element;

    this.next = next;

    this.prev = prev;

    }

    }

    public boolean isEmpty() { return size == 0; }

    public E first(){

    }

    public E last(){

    }

    public void addFirst(E element) {

    Node tmp = new Node(element, head, null);

    if(head != null ) {head.prev = tmp;}

    head = tmp;

    if(tail == null) { tail = tmp;}

    size++;

    System.out.println("adding: "+element);

    }

    public static void main(String a[]){

    DoublyLinkedListImpl<Integer> dll = new DoublyLinkedListImpl<Integer>();

    dll.addFirst(10);

    dll.addFirst(34);

    }

    }

    1 AnswerProgramming & Design4 years ago
  • doubly linked list get first and last element?

    dear all ,i want to write two diffirent method for doubly linked list , one for get first element and the second ont to get the las element i try with these code but it give me an error

    package doublelinked;

    public class doublee {

    int size =0;

    Node head = null;

    Node tail = null;

    class Node{

    int data;

    Node next;

    Node previous;

    public Node(int data){

    this.data = data;

    next = null;

    previous = null;

    }

    }

    public Node addAtStart(int data){

    System.out.println("Adding Node " + data + " at the start");

    Node n = new Node(data);

    if(size==0){

    head = n;

    tail = n;

    }else{

    n.next = head;

    head.previous = n;

    head = n;

    }

    size++;

    return n;

    }

    public Node addAtEnd(int data){

    System.out.println("Adding Node " + data + " at the End");

    Node n = new Node(data);

    if(size==0){

    head = n;

    tail = n;

    }else{

    tail.next = n;

    n.previous = tail;

    tail =n;

    }

    size++;

    return n;

    }

    public node getfirst();

    if(isEmpty()) return null;

    return head.getNext;

    }public node getlast();

    if(isemty(()) return null;

    return tail.getNext;

    }

  • Cartesian product of two set?

    dear all im working with this code to find Cartesian product of two set but it does not work this is the code

    public static int[][] cartesianProducta(int[] B, int[] a2) {

    int size1 = B.length;

    int size2 = a2.length;

    int[][] result = new int[size1 * size2][2];

    for (int i = 0, d = 0; i < size1; ++i) {

    for (int j = 0; j < size2; ++j, ++d) {

    result[d][0] = B[i];

    result[d][1] = a2[j];

    }

    }

    return result;

    }

    public static void main(String args[])

    {

    int[] B = {4, 2, 3};

    int[] a2 = {2, 5};

    System.out.println(cartesianProducta(B,a2));

    3 AnswersProgramming & Design4 years ago
  • 7 segment display?

    how i can use multimedia logic program to display number 1 ,2 and 6 by using two switches and single logic gate and single 7 segment

    1 AnswerProgramming & Design4 years ago
  • about physic please answer me i have test?

    2. A wheel initially at rest begins to rotate around its center with a constant angular acceleration. Its second complete rotation takes (0.77) s.

    a) How long did the first rotation take for a complete rotation?

    b) How much is the angular acceleration?

    1 AnswerPhysics5 years ago