java数据结构链表

R以及Rstudio超详细安装教程(包括安装过程中出现的问题) R安装及Rstudio安装,以及安装中出现的问题 阅读详情

 看了很多事还是weiss的书有效.他不知给出了方法还给出了完整代码并且给出了实例,就好比哲学家之于马克思.

大部分哲学家在解释世界而马克思提出了改造世界.

手头终于搞定了两种链表.单链表和双链表.

明天彻底改造.

第一个原始双链表上面有两个小瑕疵.代码是在他博客上下的.我改正了,目前至少编译出来了.呵呵

Code:
  1. import java.util.*;  
  2.   
  3. /** 
  4.  * LinkedList class implements a doubly-linked list. 
  5.  */  
  6. public abstract class LinkedList<AnyType> extends AbstractCollection<AnyType> implements List<AnyType>, Queue<AnyType>  
  7. {  
  8.     /** 
  9.      * Construct an empty LinkedList. 
  10.      */  
  11.     public LinkedList( )  
  12.     {  
  13.         clear( );  
  14.     }  
  15.       
  16.     /** 
  17.      * Construct a LinkedList with same items as another Collection. 
  18.      */  
  19.     public LinkedList( Collection<? extends AnyType> other )  
  20.     {  
  21.         clear( );  
  22.         for( AnyType val : other )  
  23.             add( val );  
  24.     }  
  25.       
  26.     /** 
  27.      * Change the size of this collection to zero. 
  28.      */  
  29.     public void clear( )  
  30.     {  
  31.         beginMarker = new Node<AnyType>( null, null, null );  
  32.         endMarker = new Node<AnyType>( null, beginMarker, null );  
  33.         beginMarker.next = endMarker;  
  34.           
  35.         theSize = 0;  
  36.         modCount++;  
  37.     }  
  38.       
  39.     /** 
  40.      * Returns the number of items in this collection. 
  41.      * @return the number of items in this collection. 
  42.      */  
  43.     public int size( )  
  44.     {  
  45.         return theSize;  
  46.     }  
  47.       
  48.       
  49.     /** 
  50.      * Tests if some item is in this collection. 
  51.      * @param x any object. 
  52.      * @return true if this collection contains an item equal to x. 
  53.      */  
  54.     public boolean contains( Object x )  
  55.     {  
  56.         return findPos( x ) != NOT_FOUND;  
  57.     }   
  58.       
  59.     /** 
  60.      * Returns the position of first item matching x in this collection, 
  61.      * or NOT_FOUND if not found. 
  62.      * @param x any object. 
  63.      * @return the position of first item matching x in this collection, 
  64.      * or NOT_FOUND if not found. 
  65.      */  
  66.     private Node<AnyType> findPos( Object x )  
  67.     {  
  68.         for( Node<AnyType> p = beginMarker.next; p != endMarker; p = p.next )  
  69.             if( x == null )  
  70.             {  
  71.                 if( p.data == null )  
  72.                     return p;  
  73.             }  
  74.             else if( x.equals( p.data ) )  
  75.                 return p;  
  76.                   
  77.         return NOT_FOUND;  
  78.     }  
  79.       
  80.     /** 
  81.      * Adds an item to this collection, at the end. 
  82.      * @param x any object. 
  83.      * @return true. 
  84.      */  
  85.     public boolean add( AnyType x )  
  86.     {  
  87.         addLast( x );     
  88.         return true;           
  89.     }  
  90.       
  91.     /** 
  92.      * Adds an item to this collection, at specified position. 
  93.      * Items at or after that position are slid one position higher. 
  94.      * @param x any object. 
  95.      * @param idx position to add at. 
  96.      * @throws IndexOutOfBoundsException if idx is not between 0 and size(), inclusive. 
  97.      */  
  98.     public void add( int idx, AnyType x )  
  99.     {  
  100.         Node<AnyType> p = getNode( idx, 0, size( ) );  
  101.         Node<AnyType> newNode = new Node<AnyType>( x, p.prev, p );  
  102.         newNode.prev.next = newNode;  
  103.         p.prev = newNode;           
  104.         theSize++;  
  105.         modCount++;  
  106.     }  
  107.       
  108.     /** 
  109.      * Adds an item to this collection, at front. 
  110.      * Other items are slid one position higher. 
  111.      * @param x any object. 
  112.      */      
  113.     public void addFirst( AnyType x )  
  114.     {  
  115.         add( 0, x );  
  116.     }  
  117.   
  118.     /** 
  119.      * Adds an item to this collection, at end. 
  120.      * @param x any object. 
  121.      */      
  122.     public void addLast( AnyType x )  
  123.     {  
  124.         add( size( ), x );  
  125.     }      
  126.       
  127.     /** 
  128.      * Returns the front item in the list. 
  129.      * @throws NoSuchElementException if the list is empty. 
  130.      */  
  131.     public AnyType element( )  
  132.     {  
  133.         return getFirst( );      
  134.     }  
  135.       
  136.     /** 
  137.      * Returns the first item in the list. 
  138.      * @throws NoSuchElementException if the list is empty. 
  139.      */  
  140.     public AnyType getFirst( )  
  141.     {  
  142.         if( isEmpty( ) )  
  143.             throw new NoSuchElementException( );  
  144.         return getNode( 0 ).data;      
  145.     }  
  146.       
  147.     /** 
  148.      * Returns the last item in the list. 
  149.      * @throws NoSuchElementException if the list is empty. 
  150.      */  
  151.     public AnyType getLast( )  
  152.     {  
  153.         if( isEmpty( ) )  
  154.             throw new NoSuchElementException( );  
  155.         return getNode( size( ) - 1 ).data;      
  156.     }  
  157.       
  158.     /** 
  159.      * Returns the item at position idx. 
  160.      * @param idx the index to search in. 
  161.      * @throws IndexOutOfBoundsException if index is out of range. 
  162.      */  
  163.     public AnyType get( int idx )  
  164.     {  
  165.         return getNode( idx ).data;  
  166.     }  
  167.           
  168.     /** 
  169.      * Changes the item at position idx. 
  170.      * @param idx the index to change. 
  171.      * @param newVal the new value. 
  172.      * @return the old value. 
  173.      * @throws IndexOutOfBoundsException if index is out of range. 
  174.      */  
  175.     public AnyType set( int idx, AnyType newVal )  
  176.     {  
  177.         Node<AnyType> p = getNode( idx );  
  178.         AnyType oldVal = p.data;  
  179.           
  180.         p.data = newVal;     
  181.         return oldVal;  
  182.     }  
  183.       
  184.     /** 
  185.      * Removes the front item in the queue. 
  186.      * @return the front item. 
  187.      * @throws NoSuchElementException if the list is empty. 
  188.      */  
  189.     public AnyType remove( )  
  190.     {  
  191.         return removeFirst( );      
  192.     }  
  193.       
  194.     /** 
  195.      * Removes the first item in the list. 
  196.      * @return the item was removed from the collection. 
  197.      * @throws NoSuchElementException if the list is empty. 
  198.      */  
  199.     public AnyType removeFirst( )  
  200.     {  
  201.         if( isEmpty( ) )  
  202.             throw new NoSuchElementException( );  
  203.         return remove( getNode( 0 ) );      
  204.     }  
  205.       
  206.     /** 
  207.      * Removes the last item in the list. 
  208.      * @return the item was removed from the collection. 
  209.      * @throws NoSuchElementException if the list is empty. 
  210.      */  
  211.     public AnyType removeLast( )  
  212.     {  
  213.         if( isEmpty( ) )  
  214.             throw new NoSuchElementException( );  
  215.         return remove( getNode( size( ) - 1 ) );      
  216.     }  
  217.       
  218.     /** 
  219.      * Removes an item from this collection. 
  220.      * @param x any object. 
  221.      * @return true if this item was removed from the collection. 
  222.      */  
  223.     public boolean remove( Object x )  
  224.     {  
  225.         Node<AnyType> pos = findPos( x );  
  226.           
  227.         if( pos == NOT_FOUND )  
  228.             return false;  
  229.         else  
  230.         {  
  231.             remove( pos );  
  232.             return true;  
  233.         }          
  234.     }  
  235.       
  236.       
  237.     /** 
  238.      * Gets the Node at position idx, which must range from 0 to size( )-1. 
  239.      * @param idx index to search at. 
  240.      * @return internal node corrsponding to idx. 
  241.      * @throws IndexOutOfBoundsException if idx is not between 0 and size()-1, inclusive. 
  242.      */  
  243.     private Node<AnyType> getNode( int idx )  
  244.     {  
  245.         return getNode( idx, 0, size( ) - 1 );  
  246.     }  
  247.       
  248.     /** 
  249.      * Gets the Node at position idx, which must range from lower to upper. 
  250.      * @param idx index to search at. 
  251.      * @param lower lowest valid index. 
  252.      * @param upper highest valid index. 
  253.      * @return internal node corrsponding to idx. 
  254.      * @throws IndexOutOfBoundsException if idx is not between lower and upper, inclusive. 
  255.      */  
  256.     private Node<AnyType> getNode( int idx, int lower, int upper )  
  257.     {  
  258.         Node<AnyType> p;  
  259.           
  260.         if( idx < lower || idx > upper )  
  261.             throw new IndexOutOfBoundsException( "getNode index: " + idx + "; size: " + size( ) );  
  262.               
  263.         if( idx < size( ) / 2 )  
  264.         {  
  265.             p = beginMarker.next;  
  266.             for( int i = 0; i < idx; i++ )  
  267.                 p = p.next;              
  268.         }  
  269.         else  
  270.         {  
  271.             p = endMarker;  
  272.             for( int i = size( ); i > idx; i-- )  
  273.                 p = p.prev;  
  274.         }   
  275.           
  276.         return p;  
  277.     }  
  278.       
  279.     /** 
  280.      * Removes an item from this collection. 
  281.      * @param idx the index of the object. 
  282.      * @return the item was removed from the collection. 
  283.      */  
  284.     public AnyType remove( int idx )  
  285.     {  
  286.         return remove( getNode( idx ) );  
  287.     }  
  288.       
  289.     /** 
  290.      * Removes the object contained in Node p. 
  291.      * @param p the Node containing the object. 
  292.      * @return the item was removed from the collection. 
  293.      */  
  294.     private AnyType remove( Node<AnyType> p )  
  295.     {  
  296.         p.next.prev = p.prev;  
  297.         p.prev.next = p.next;  
  298.         theSize--;  
  299.         modCount++;  
  300.           
  301.         return p.data;  
  302.     }  
  303.       
  304.     /** 
  305.      * Obtains an Iterator object used to traverse the collection. 
  306.      * @return an iterator positioned prior to the first element. 
  307.      */  
  308.     public Iterator<AnyType> iterator( )  
  309.     {  
  310.         return new LinkedListIterator( 0 );  
  311.     }  
  312.       
  313.     /** 
  314.      * Obtains a ListIterator object used to traverse the collection bidirectionally. 
  315.      * @return an iterator positioned prior to the requested element. 
  316.      * @param idx the index to start the iterator. Use size() to do complete 
  317.      * reverse traversal. Use 0 to do complete forward traversal. 
  318.      * @throws IndexOutOfBoundsException if idx is not between 0 and size(), inclusive. 
  319.      */  
  320.     public ListIterator<AnyType> listIterator( int idx )  
  321.     {  
  322.         return new LinkedListIterator( idx );  
  323.     }  
  324.   
  325.     /** 
  326.      * This is the implementation of the LinkedListIterator. 
  327.      * It maintains a notion of a current position and of 
  328.      * course the implicit reference to the LinkedList. 
  329.      */  
  330.     private class LinkedListIterator implements ListIterator<AnyType>  
  331.     {  
  332.         private Node<AnyType> current;  
  333.         private Node<AnyType> lastVisited = null;  
  334.         private boolean lastMoveWasPrev = false;  
  335.         private int expectedModCount = modCount;  
  336.           
  337.         public LinkedListIterator( int idx )  
  338.         {  
  339.             current = getNode( idx, 0, size( ) );    
  340.         }  
  341.           
  342.         public boolean hasNext( )  
  343.         {  
  344.             if( expectedModCount != modCount )  
  345.                 throw new ConcurrentModificationException( );  
  346.             return current != endMarker;  
  347.         }  
  348.           
  349.         public AnyType next( )  
  350.         {  
  351.             if( !hasNext( ) )  
  352.                 throw new NoSuchElementException( );   
  353.                      
  354.             AnyType nextItem = current.data;  
  355.             lastVisited = current;  
  356.             current = current.next;  
  357.             lastMoveWasPrev = false;  
  358.             return nextItem;  
  359.         }  
  360.           
  361.         public void remove( )  
  362.         {  
  363.             if( expectedModCount != modCount )  
  364.                 throw new ConcurrentModificationException( );  
  365.             if( lastVisited == null )  
  366.                 throw new IllegalStateException( );  
  367.                   
  368.             LinkedList.this.remove( lastVisited );  
  369.             lastVisited = null;  
  370.             if( lastMoveWasPrev )  
  371.                 current = current.next;  
  372.             expectedModCount++;         
  373.         }  
  374.           
  375.         public boolean hasPrevious( )  
  376.         {  
  377.             if( expectedModCount != modCount )  
  378.                 throw new ConcurrentModificationException( );  
  379.             return current != beginMarker.next;  
  380.         }  
  381.           
  382.         public AnyType previous( )  
  383.         {  
  384.             if( expectedModCount != modCount )  
  385.                 throw new ConcurrentModificationException( );  
  386.             if( !hasPrevious( ) )  
  387.                 throw new NoSuchElementException( );   
  388.                      
  389.             current = current.prev;  
  390.             lastVisited = current;  
  391.             lastMoveWasPrev = true;  
  392.             return current.data;  
  393.         }  
  394.   
  395.         @Override  
  396.         public void add(AnyType e) {  
  397.             // TODO Auto-generated method stub  
  398.               
  399.         }  
  400.   
  401.         @Override  
  402.         public int nextIndex() {  
  403.             // TODO Auto-generated method stub  
  404.             return 0;  
  405.         }  
  406.   
  407.         @Override  
  408.         public int previousIndex() {  
  409.             // TODO Auto-generated method stub  
  410.             return 0;  
  411.         }  
  412.   
  413.         @Override  
  414.         public void set(AnyType e) {  
  415.             // TODO Auto-generated method stub  
  416.               
  417.         }           
  418.     }  
  419.       
  420.     /** 
  421.      * This is the doubly-linked list node. 
  422.      */  
  423.     private static class Node<AnyType>  
  424.     {  
  425.         public Node( AnyType d, Node<AnyType> p, Node<AnyType> n )  
  426.         {  
  427.             data = d; prev = p; next = n;  
  428.         }  
  429.           
  430.         public AnyType data;  
  431.         public Node<AnyType>   prev;  
  432.         public Node<AnyType>   next;  
  433.     }  
  434.       
  435.     private final Node<AnyType> NOT_FOUND = null;  
  436.       
  437.     private int theSize;  
  438.     private Node<AnyType> beginMarker;  
  439.     private Node<AnyType> endMarker;  
  440.     private int modCount = 0;  
  441. }  

下面是单链表的东东.看起来复制.用起来更复杂.还有一个问题编译器报错但是可以编译.不知道为啥.数据结构部分

Code:
  1. // Basic node stored in a linked list  
  2. // Note that this class is not accessible outside  
  3. // of package weiss.nonstandard  
  4. //copy by blacksapper  
  5.   
  6. class ListNode<AnyType>  
  7. {  
  8.       // Constructors  
  9.     public ListNode( AnyType theElement )  
  10.     {  
  11.         this( theElement, null );  
  12.     }  
  13.   
  14.     public ListNode( AnyType theElement, ListNode<AnyType> n )  
  15.     {  
  16.         element = theElement;  
  17.         next    = n;  
  18.     }  
  19.   
  20.     public AnyType   element;  
  21.     public ListNode<AnyType> next;  
  22. }  

具体方法,提供安全的访问

Code:
  1. package LinkNodetest;  
  2.   
  3. import LinkNodetest.LinkedList;  
  4. import LinkNodetest.ListNode;  
  5.   
  6.   
  7. //LinkedListIterator class; maintains "current position"  
  8. //  
  9. //CONSTRUCTION: Package visible only, with a ListNode  
  10. //  
  11. //******************PUBLIC OPERATIONS*********************  
  12. //void advance( )        --> Advance  
  13. //boolean isValid( )     --> True if at valid position in list  
  14. //AnyType retrieve       --> Return item in current position  
  15.   
  16. /**  
  17. * Linked list implementation of the list iterator  
  18. *    using a header node.  
  19. * @author Mark Allen Weiss  
  20. *@copy by blacksapper  
  21. * @see LinkedList  
  22. */  
  23. public class LinkedListIterator<AnyType>  
  24. {  
  25.  /** 
  26.   * Construct the list iterator 
  27.   * @param theNode any node in the linked list. 
  28.   */  
  29.  LinkedListIterator( ListNode<AnyType> theNode )  
  30.  {  
  31.      current = theNode;  
  32.  }  
  33.   
  34.  /** 
  35.   * Test if the current position is a valid position in the list. 
  36.   * @return true if the current position is valid. 
  37.   */  
  38.  public boolean isValid( )  
  39.  {  
  40.      return current != null;  
  41.  }  
  42.   
  43.  /** 
  44.   * Return the item stored in the current position. 
  45.   * @return the stored item or null if the current position 
  46.   * is not in the list. 
  47.   */  
  48.  public AnyType retrieve( )  
  49.  {  
  50.      return isValid( ) ? current.element : null;  
  51.  }  
  52.   
  53.  /** 
  54.   * Advance the current position to the next node in the list. 
  55.   * If the current position is null, then do nothing. 
  56.   */  
  57.  public void advance( )  
  58.  {  
  59.      if( isValid( ) )  
  60.          current = current.next;  
  61.  }  
  62.   
  63.  ListNode<AnyType> current;    // Current position  
  64. }  

抽象方法和例子

Code:
  1. package LinkNodetest;  
  2.   
  3. import LinkNodetest.LinkedListIterator;  
  4.   
  5. //LinkedList class  
  6. //  
  7. //CONSTRUCTION: with no initializer  
  8. //Access is via LinkedListIterator class  
  9. //  
  10. //******************PUBLIC OPERATIONS*********************  
  11. //boolean isEmpty( )     --> Return true if empty; else false  
  12. //void makeEmpty( )      --> Remove all items  
  13. //LinkedListIterator zeroth( )  
  14. //                     --> Return position to prior to first  
  15. //LinkedListIterator first( )  
  16. //                     --> Return first position  
  17. //void insert( x, p )    --> Insert x after current iterator position p  
  18. //void remove( x )       --> Remove x  
  19. //LinkedListIterator find( x )  
  20. //                     --> Return position that views x  
  21. //LinkedListIterator findPrevious( x )  
  22. //                     --> Return position prior to x  
  23. //******************ERRORS********************************  
  24. //No special errors  
  25.   
  26. /**  
  27. * Linked list implementation of the list  
  28. *    using a header node.  
  29. * Access to the list is via LinkedListIterator.  
  30. * @author Mark Allen Weiss  
  31. * @param blacksapper  
  32. * @see LinkedListIterator  
  33. */  
  34. public class LinkedList<AnyType>  
  35. {  
  36.  /** 
  37.   * Construct the list 
  38.   */  
  39.  public LinkedList( )  
  40.  {  
  41.      header = new ListNode<AnyType>( null );  
  42.  }  
  43.   
  44.  /** 
  45.   * Test if the list is logically empty. 
  46.   * @return true if empty, false otherwise. 
  47.   */  
  48.  public boolean isEmpty( )  
  49.  {  
  50.      return header.next == null;  
  51.  }  
  52.   
  53.  /** 
  54.   * Make the list logically empty. 
  55.   */  
  56.  public void makeEmpty( )  
  57.  {  
  58.      header.next = null;  
  59.  }  
  60.   
  61.  /** 
  62.   * Return an iterator representing the header node. 
  63.   */  
  64.  public LinkedListIterator<AnyType> createhead( )  
  65.  {  
  66.      return new LinkedListIterator<AnyType>( header );  
  67.  }  
  68.   
  69.  /** 
  70.   * Return an iterator representing the first node in the list. 
  71.   * This operation is valid for empty lists. 
  72.   */  
  73.  public LinkedListIterator<AnyType> first( )  
  74.  {  
  75.      return new LinkedListIterator<AnyType>( header.next );  
  76.  }  
  77.   
  78.  /** 
  79.   * Insert after p. 
  80.   * @param x the item to insert. 
  81.   * @param p the position prior to the newly inserted item. 
  82.   */  
  83.  public void insert( AnyType x, LinkedListIterator<AnyType> p )  
  84.  {  
  85.      if( p != null && p.current != null )  
  86.          p.current.next = new ListNode<AnyType>( x, p.current.next );  
  87.  }  
  88.   
  89.  /** 
  90.   * Return iterator corresponding to the first node containing an item. 
  91.   * @param x the item to search for. 
  92.   * @return an iterator; iterator is not valid if item is not found. 
  93.   */  
  94.  public LinkedListIterator<AnyType> find( AnyType x )  
  95.  {  
  96.      ListNode<AnyType> itr = header.next;  
  97.   
  98.      while( itr != null && !itr.element.equals( x ) )  
  99.          itr = itr.next;  
  100.   
  101.      return new LinkedListIterator<AnyType>( itr );  
  102.  }  
  103.   
  104.  /** 
  105.   * Return iterator prior to the first node containing an item. 
  106.   * @param x the item to search for. 
  107.   * @return appropriate iterator if the item is found. Otherwise, the 
  108.   * iterator corresponding to the last element in the list is returned. 
  109.   */  
  110.  public LinkedListIterator<AnyType> findPrevious( AnyType x )  
  111.  {  
  112.      ListNode<AnyType> itr = header;  
  113.   
  114.      while( itr.next != null && !itr.next.element.equals( x ) )  
  115.          itr = itr.next;  
  116.   
  117.      return new LinkedListIterator<AnyType>( itr );  
  118.  }  
  119.   
  120.  /** 
  121.   * Remove the first occurrence of an item. 
  122.   * @param x the item to remove. 
  123.   */  
  124.  public void remove( AnyType x )  
  125.  {  
  126.      LinkedListIterator<AnyType> p = findPrevious( x );  
  127.   
  128.      if( p.current.next != null )  
  129.          p.current.next = p.current.next.next;  // Bypass deleted node  
  130.  }  
  131.   
  132.  // Simple print method  
  133.  public static <AnyType> void printList( LinkedList<AnyType> theList )  
  134.  {  
  135.      if( theList.isEmpty( ) )  
  136.          System.out.print( "Empty list" );  
  137.      else  
  138.      {  
  139.          LinkedListIterator<AnyType> itr = theList.first( );  
  140.          for( ; itr.isValid( ); itr.advance( ) )  
  141.              System.out.print( itr.retrieve( ) + " " );  
  142.      }  
  143.   
  144.      System.out.println( );  
  145.  }  
  146.   
  147.  private ListNode<AnyType> header;  
  148.   
  149.  // In this routine, LinkedList and LinkedListIterator are the  
  150.  // classes written in Section 17.2.  
  151.  public static <AnyType> int listSize( LinkedList<AnyType> theList )  
  152.  {  
  153.      LinkedListIterator<AnyType> itr;  
  154.      int size = 0;  
  155.        
  156.      for( itr = theList.first(); itr.isValid(); itr.advance() )  
  157.          size++;  
  158.            
  159.      return size;      
  160.  }  
  161.   
  162.  public static void main( String [ ] args )  
  163.  {  
  164.      LinkedList<String> theList = new LinkedList<String>( );  
  165.      LinkedListIterator<String> theItr;  
  166.  //    int i;  
  167.   
  168.      theItr = theList.createhead();  
  169.      printList( theList );  
  170.   
  171.      String i="a";  
  172.          theList.insert(i , theItr );  
  173.          printList( theList );  
  174.          theItr.advance( );  
  175.   
  176.      System.out.println( "Size was: " + listSize( theList ) );  
  177.   
  178.   
  179.          theList.remove( i );  
  180.   
  181.   //   for( i = 0; i < 10; i++ )  
  182.      //    if( ( i % 2 == 0 ) == ( theList.find( i ).isValid( ) ) )  
  183.              System.out.println( "Find fails!" );  
  184.   
  185.      System.out.println( "Finished deletions" );  
  186.      printList( theList );  
  187.  }  
  188.   
  189. }  

最后main函数里面我改过了.开始是int的.有点不伦不类.

英伟达 Jetson AGX Thor 官方入门教程(一)系统U盘安装 NVIDIA Jetson AGX Thor开发套件快速安装指南 本指南详细介绍了NVIDIA Jetson AGX Thor开发套件的安装流程。该套件搭载T5000 SoM,为物理AI和机器人应用提供强大支持。安装过程采用全新的JetPack 7.0方案,通过USB闪存盘即可完成BSP(Jetson Linux)安装,无需依赖Ubuntu主机。指南包含硬件开箱说明、两种配置模式(带显示器/无显示器)、详细的ISO镜像下载和USB制作步骤(推荐使用Balena Etcher工具),以及首次启动后的初始设置流 阅读详情

相关推荐

Windows显卡TDR超时导致Unity崩溃?手把手教你修改注册表延长响应时间

本文详细解析了Windows显卡TDR超时导致Unity崩溃的问题,并提供了修改注册表延长响应时间的完整解决方案。通过调整TdrDelay和TdrDdiDelay键值,开发者可以有效避免D3D11设备丢失错误,提升Unity编辑器的稳定性。文章还包含显卡驱动优化、系统性能调优等实用技巧,帮助开发者彻底解决编辑器崩溃问题。

weixin_33737774的博客 634

Java——数据结构之双向链表

文章目录1.单链表的实现(1)定义一个节点类型(2)头插法(3)尾插法(4)根据下标插入节点(5)查找关键字(6)删除第一次出现的关键字(7)删除所有出现的关键字key(8)节点的回收(9)链表打印展示2.完整代码展示完!   接上篇Java——数据结构之单链表   在之前的学习中,我们主要了解了很多 Java 的 基本语法,但是 在之后的 Java学习中,了解 基础 数据结构的知识 非常重要,数据结构的思想 可以帮助我们更加清晰 明白的了解 Java 的解题思路等等。   今天我们就来开始学习 实现一

rain67的博客 2659

【学习笔记】人群归因分数 PAF 以及combined PAF(更新)

在此推荐2篇发表在lancet以及jama子刊上的paf文章,这两篇文章套路是一样的,只是在不同国家进行。希望对大家学习PAF有所帮助,后面有新内容也会继续分享,也欢迎大家分享使用R语言计算PAF的经验~~~的时候,先建立了相关矩阵,再做主成分分析,得到communality。详细信息大家可翻阅原文。

weixin_53499537的博客 1498

数据结构之链表(Java实现)

数据结构中线性表的重要知识之一

Easenyang的博客 9317

python实现马丁策略(股市) (附完整源码)

python实现马丁策略(股市) (附完整源码)

希望我的博客,能帮上你解决学习中工作中所遇到的问题 606

静态时序分析(STA)—— 标准单元库

目录 1、时序库 概览 2、时序模型 1、基本概念 2、影响因素 3、线性延时模型 4、非线性延时模型 5、单元时序弧 1、组合逻辑单元 2、时序逻辑单元 6、线负载模型 参考说明 上一篇,学习了 STA相关的基本概念,本篇继续学习 STA相关的 标准单元库。 1、时序库 概览 库文件概览: 2、时序模型 1、基本概念 2、影响因素 对于组合逻辑的时序弧而言,其延时的大小取决于: 1、输出负载,即,输出端的电容负载的大小。容性负载越大,...

记录所学,分享知识,结识挚友 2855

Java——数据结构之单链表

文章目录Java——数据结构之单链表1. 链表的概念及结构2.单链表的实现(1)定义一个节点类型(2)头插法(3)尾插法(4)根据下标插入节点(5)查找关键字(6)删除第一次出现的关键字(7)得到单链表的长度(8)单链表打印展示(9)节点的回收3.完整代码的展示完! Java——数据结构之单链表 本次内容介绍大纲   在之前的学习中,我们主要了解了很多 Java 的 基本语法,但是 在之后的 Java学习中,了解 基础 数据结构的知识 非常重要,数据结构的思想 可以帮助我们更加清晰 明白的了解 Ja

rain67的博客 2655

数据处理和分析之数据聚类:层次聚类(Hierarchical Clustering):单链接层次聚类方法

单链接层次聚类(Single-Linkage Hierarchical Clustering)是凝聚型层次聚类的一种,它基于数据点之间的最小距离来定义聚类间的相似性。在单链接层次聚类中,两个聚类之间的距离定义为这两个聚类中任意两个数据点之间的最短距离。这种聚类方法倾向于形成链状或线性的聚类,因为聚类的边界是由最远的数据点决定的,而不是聚类的平均或中心位置。单链接层次聚类通过计算簇间最近点的距离来决定簇的合并,这种方法简单直观,但可能导致簇的形状不规则,尤其是在数据点分布不均匀的情况下。

2401_87715305的博客 1443

Java数据结构--链表

一起学习编程的友友们,我以及经历JavaSE的学习到了数据结构这个篇章,在数据结构中我们了解时间和空间复杂度的是什么以及怎么计算。到数据结构的一个重点篇---链表是一种存储结构,数据元素的是通过链表中的次序实现的。链表有一系列(链表中每一个元素称为节点)组成,节点可以在运行时动态生成。每个节点包括两部分:一个是存储数据元素的;另一个是存储下一个节点地址的。相比于线性顺序结构,操作复杂。

2401_86698066的博客 846

16. SAP Fiori Elements 应用里图片字段(Image)的显示原理介绍

很多朋友向我反映,学习了 一段时间的 SAP Fiori Elements 开发,但是感觉整套体系对于自己来说还是个黑盒子,很多技术点,看了 SAP 官方帮助文档后,觉得自己懂了,但是一旦需要自己动手做一些东西出来时,又觉得一片茫然。 其实笔者自己也经历过这个过程。究其原因,还是大家对 Fiori Elements 一些技术细节没有理解,对 SAP 官方的知识点仅仅停留在记忆,甚至是死记硬背上面。 不过没有关系,本教程笔者会刻意设置一些练习,让大家动手,在实战中逐渐熟悉 Fiori Elements 这

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 769

LVGL嵌入式GUI工程化架构与多窗口实践

嵌入式GUI开发中,LVGL作为轻量级图形库,其核心价值在于高效渲染与事件驱动机制。理解LVGL的对象树模型、资源管理机制(如RAW图像、静态字体)和屏幕生命周期,是构建稳定界面的基础。结合FreeRTOS等实时操作系统,可实现低功耗、高响应的交互体验。典型应用场景包括智能电表、HMI人机界面、工业控制面板等对内存敏感、需长期运行的设备。本文以微信式多窗口架构为范例,深入解析LVGL工程化落地的关键路径:分层目录结构、窗口模块封装、状态机式登录逻辑、TabView多页导航及图表/仪表盘动态可视化,覆盖从资源

weixin_36001279的博客 94

java版数据结构之链表

链表是一种线性数据结构,由节点(Node)数据域:存储元素值。指针域:存储指向下一个(或上一个)节点的引用。示例(单链表节点结构):T data;示例(单链表):​} else {= null) {size++;​// 其他方法(如addFirst、remove等)类似实现。

2301_79418644的博客 722

BMS硬件设计要点:从STM32主控到BQ76920监控芯片的工程实践

电池管理系统(BMS)是锂电安全与寿命保障的核心,其硬件设计涉及微控制器选型、专用监控芯片接口、电源完整性、信号完整性及PCB布局等多维度协同。基于STM32与BQ76920的典型双层架构,需深入理解功能安全解耦原理——关键保护由ASIC硬件实现,算法决策交由MCU完成,契合ASIL-B等级要求。技术价值体现在毫秒级硬件保护响应、±10mV电压采样精度及抗EMI鲁棒性设计;广泛应用于电动工具、储能系统与轻型电动车等中高功率场景。本文聚焦BMS控制板硬件实现中的高频时钟EMC、I²C总线信号完整性、被动均衡可

weixin_30591519的博客 93

【Java数据结构】LinkedList-链表

此文章详细讲解数据结构:链表,以模拟LinkedList的视角去研究链表,学习单链表以及双向链表的基础知识,后续我们可以靠这些知识,进攻更难的oj题,更特殊的链表类型~

Carefree_State的博客 1748

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

java数据结构之链表

LinkedList的底层是双向链表结构(链表后面介绍),由于链表没有将元素存储在连续的空间中,元素存储在单独的节点中,然后通过引用将节点连接起来了,因此在在任意位置插入或者删除元素时,不需要搬移元素,效率比较高1. LinkedList实现了List接口2. LinkedList的底层使用了双向链表3. LinkedList没有实现RandomAccess(该接口是实现随机访问)接口,因此LinkedList不支持随机访问。

mr_yuanshen的博客 874

pscad IEEE标准系统搭建说明

pscad IEEE标准系统搭建说明,包含典型的IEEE 9节点、14节点、30节点、39节点和118节点系统。内含标准测试系统的原始数据和潮流结果。

java链表数据结构是什么_JAVA数据结构之链表

/*(1)简单链表Java代码*///package ChapterFive;class Link {public E data;public Link next;public Link(E data){this.data = data;}}class LinkList {public Link first;//链表中数据项的个数public int size;public LinkList() ...

weixin_32487755的博客 181

JAVA数据结构之链表

1、单链表的数据结构 单链表中的数据是以结点的形式存在,每一个结点是由数据元素(数据域)和下一个结点的存储的位置(指针域)组成。单链表与数组相比的最大差别是:单链表的数据元素存放在内存空间的地址是不连续的,而数组的数据元素存放的地址在内存空间中是连续的。具体的数据模型用下图大概描述一下。 2、单链表的优缺点 优点: 插入删除速度快、内存利用率高,不会浪费内存、大小没有固定,拓展很灵活 由于链表的节点在内存中可以存在任何地方、不要求连续,且每个节点中都存储着下一节点的内存地址。如果需要新插.

奔跑的路路 798

java 链表数据结构实现

java 链表数据结构说明本文适合初学java想要了解数据结构的人,操作正确下面的代码都是可以工作的,如果不能与我联系我会改。java没有指针,虽然没有办法直接访问内存,但是java中有引用,可以引用一块内存空间,所以我们可以用java的指针模型,来实现链表数据结构。我会构建两个类,在两个包中,IntNode类提供基本的操作,IntLinkBag类在IntNode类基础之上,提出了包的概念相当于节点的集合。

TrueSpiderBoy Blog 909

java数据结构链表_Java数据结构与算法——链表

声明:码字不易,转载请注明出处,欢迎文章下方讨论交流。前言:Java数据结构与算法专题会不定时更新,欢迎各位读者监督。本文介绍另一种数据结构——链表,包括链表的特点特点、链表的创建、删除、插入和输出,文末给出java代码和一道常见的关于链表的面试题。1、链表的概念和特点链表是由若干结点组成,每个结点至少包括两部分信息:一个是元素数据,一个是指向下一个(上一个)元素地址的指针。链表的存储在物理上是非...

weixin_39797264的博客 201

【Java演示】什么是链表?数据结构(三)

目录链表:随机存储,顺序访问(读取)前言一、单向链表什么叫随机存储呢?链表的基本操作1. 查找节点2. 更新节点3. 插入节点3.1. 尾部插入3.2. 头部插入3.3. 中间插入4. 删除元素4.1. 尾部删除4.1. 头部删除4.1. 中间删除二、双向链表 链表:随机存储,顺序访问(读取) 前言 本博文的大部分插图来自于《漫画算法——小灰》,也复制了该书部分文字 我加了一些自己的总结、代码(...

子浩的博客 1万+

【Java数据结构】初始线性表之一:链表

本章节介绍了线性表中的链表以及如何模拟实现一个链表,并且介绍了Java中链表的一些常见的方法

yican2580的博客 3993

Java数据结构——单向链表

一、单链表的相关知识: 在链表之前,对于数据的群体存储一般采用的是数组来进行存储,数组是一种线性的结构,数组的优点就在于数组内所有的内容都是线性紧密分配的,通过下标就能很方便迅速的访问到我们要访问的指定元素。但是数组这种线性的特点也导致当数组需要添加元素的时候会很麻烦。首先由于数组长度已定,所以添加的时候有可能面临着数组长度不够的问题;另外由于数组每个元素之间紧密排布,所以如果想要插在指定位置增加...

qq_44997197的博客 218

数据结构之链表及其Java实现_数据结构之链表及其Java实现

数据的存储一般分线性存储结构和链式存储结构两种。前者是一种顺序的存储方式,在内存中用一块连续的内存空间存储数据,即逻辑上相连的物理位置相邻,比较常见的就是数组;后者是一种链式存储方式,不保证顺序性,逻辑上相邻的元素之间用指针所指定,它不是用一块连续的内存存储,逻辑上相连的物理位置不一定相邻。本篇主要介绍链式存储结构基于链表的实现,使用的语言为Java。链表是一种递归的数据结构,它要么为空(null...

weixin_39891694的博客 113

java 链表数据结构_Java实现数据结构之【链表】

链表相比于前几个章节讲的数据结构而言,是一个真正的动态数据结构也是一个最简单的动态数据结构,我们在后面还会接触更多的动态数据结构,所以对链表有一个理解非常好的基础,就能够更加容易的学习后面更加复杂的数据结构。首先我们了解一下什么是链表,链表将数据存储在一种单独的数据结构中,这个结构通常叫做“节点”,对于链表来说,节点通常只有两部分内容,e:存储的数据,next:链表中的节点通过next指向下一个节...

weixin_29193359的博客 192

深入探讨 Java 数据结构:链表

链表作为数据结构的经典成员,无论是在基础操作还是高级应用中,都有着不可替代的地位。从单向链表到双向链表,再到用链表实现 LRU 缓存,我们在不断深化对它的理解。使用的编程语言及工具:• 编程语言: Java• 工具: IntelliJ IDEA、JDK 11+

HSX的博客 1015

【Java数据结构】链表

1. 概况 链表在逻辑上是连续的,在物理上不一定连续。 分类: 单向、双向 带头、不带头 循环、非循环 2. 思路 data:数值域,里面存储的数据 next:引用变量 -> 下一个节点的地址 尾巴节点:当这个节点的next域为null的时候 头节点:整个链表当中的第一个节点 单向不带头非循环链表: 单向带头非循环链表: 单向不带头循环链表: 3. 定义链表节点 class Node { public int val; public...

Zincy星辰 2109

【单链表】数据结构,详解单链表,java实现代码

单链表基本操作,详解单链表

程序员良辰 2659
上一篇: java查看最大内存设置
下一篇: java从数据库中获取聚合函数的值
blacksapper
博客等级 码龄19年 20粉丝 81原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值