Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upFile master/DataStructures/Lists/SinglyLinkedList.java line 146 may cause NullPointerException #771
Comments
* Made Matrix equality comparison deep. Solution to the issue TheAlgorithms#719 * Comparing Matrix size before content size. * Update DoublyLinkedList.java * fix: fix link in README * Efficiency Just two small things that in case the number was very big could be helpful. * update readme.md: Fixed & added links * Update LevenshteinDistance.java * Now it's OK! * Update README.md * docs: update the whole repository * fix some bugs * delete duplicate files * format code * docs: update .gitignore * Delete .gitignore___jb_tmp___ * docs: delete duplicate files * docs: update AnyBaseToAnyBase and GenericTree * docs: rename files * Update README.md * Update HexaDecimalToDecimal.java * fix bugs in AES.java(TheAlgorithms#765) * fix bugs in ReverseString(TheAlgorithms#765) * fix bugs in MinimizingLateness(TheAlgorithms#765) * Update GenericArrayListQueue.java Documentations added * Fix for Issue TheAlgorithms#771. position=size causes NPE * Fix for Issue TheAlgorithms#773. Deleting an element that doesn't exist causes NPE * Revert "Fix for Issue TheAlgorithms#773. Deleting an element that doesn't exist causes NPE" This reverts commit 7eb0785. * Fix for Issue TheAlgorithms#773. Deleting an element that doesn't exist causes NPE * Integer To Roman * Rename GenericTree.Java to GenericTree.java * Update IntegerToRoman.java * Create FUNDING.yml * Using randomize partition to avoid the basically ordered sequences * Update QuickSort.java * Update BinaryToDecimal.java Updated some of the variable names for the ease of understanding the process. * Update BinaryToDecimal.java Changed bin_num and bin_copy to binNum and binCopy respectively. * Fix binary to octal conversion * Updated Dynamic Programming Links in Readme.md Links in the dynamic programming column were not pointing to the right files so I fixed it in the Readme file. * Updated Miscellaneous Links in README.md * Added Maths Folder & Absolute Value Program * Update AbsoluteValue.java * Added gitpod.io badge to the README * Updates README.md * Update README.md * Update README.md * Updates README.md * docs: remove FUNDING.yml and use default file See https://github.com/TheAlgorithms/.github * ignore non-alphanumeric * secondaryWordCount method added * Fix StackArray.java resize() * reduce code * code readable * fix memory leak * fix EmptyStackException * optimization * Update Knapsack.java Added check if the arrays are null * make code more readable * make code less * optimization * add more * Find max and min value by recursion * Update Queues.java * init with DEFAULT_CAPACITY * Correct the prime check algorithm There are no prime numbers smaller than 2 and numbers greater than and divisible by 2 are not prime. * The code was very verbose. Now it is simplified without sacrificing accuracy. * optimization * Improved grammar and whitespace for prompts * update * mergeSortedArrayList * Updated Readme * AbsoluteMax and AbsoluteMin * Update README.md * update gcd * toString * optimization and fix bug * Update Queues.java * Correction of iteration limit of fibOptimized * PalindromeNumber * perfect number * Result print * Size * update BalancedBrackets * clear list * update SinglyLinkedList * update StackOfLinkedList * DecimalToAnyUsingStack * parseInteger * LinkedQueue * add pow * Update FindMin.java Re-word the comments * Update CountWords.java Cleaning the code * using recursion * update LinkedQueue * fix: update Fibonacci and close TheAlgorithms#1008 * close TheAlgorithms#1008 * upate SinglyLinkedList * added license to the repository. * update AnyBaseToDecimal * make code readable * statistics optimization * qwe * add jump search algorithm * FibonacciNumber * Create CONTRIBUTING.md to avoid 404 for community guidelines. * fix: update FindMin and fix TheAlgorithms#1170 * Update BubbleSort.java Output from print(integers) returns [78, 231, 54, 23, 12, 9, 6, 4, 1] Correct output should be: [231, 78, 54, 23, 12, 9, 6, 4, 1] * Update README.md * Comment revisions * fix: removed warning for Sorts 'C-style array declaration of parameter 'array'' * optimization * Create update_directory_md.yml * updating DIRECTORY.md * optimization * Fix bug * Added Best/First/Worst Fit algorithm implementation * Change Done * Update update_directory_md.yml * updating DIRECTORY.md * Fixing packages. * Closing scanners. * Simple Substitution Cipher Algorithm added. * Update SimpleSubstitutionCipher.java * updating DIRECTORY.md * Delete Dijkshtra.java Duplicate and wrongly named. * updating DIRECTORY.md * bytesToHex function is changed beecause of required library is depracated on OpenJdk 11 * Using Try/catch and recursion Adding try/catch and recursion to optimize the code * Update DecimalToBinary.java Close ressource leak Scanner input * Update Cycles.java closing Scanner in * Update PrimMST.java removing unused import java.lang.* * Update Cycles.java removing unused member variable finalCycles * Update Main.java fixing bug Program is causing a NoSuchElementException * Update RedBlackBST.java closing Scanner scan * Update RomanToInteger.java declaring serialVersionUID * added type parameter * remove deprecated use of Character * remove unused variable * remove unused method * remove unused variable * remove unnecessary SuppressWarning * close Reader * close Reader * dynamic array data structure * Update LICENSE * change Sorts/ShellSort.java * Update ShellSort.java * added removeDuplicates function * updating DIRECTORY.md * Add a new sort algorithm, Sort/BitonicSort * updating DIRECTORY.md * Create PrimeFactorization.java * Finish both AmicableNumbers and VampireNumbers * Finish both AmicableNumbers and VampireNumbers * implement search with search helper * updating DIRECTORY.md * added scanner in factorail program * added comment in front of main method * Added indentation in the "main" function statement block * updating DIRECTORY.md * Update AVLTree.java * Update VampireNumber.java * Fixed Error:(6, 8) java: class algorithm is public, should be declared in a file named algorithm.java. Inside file PrimeFactorization, the name of public class was wrong. Co-authored-by: Egoscio <theiqboy@gmail.com> Co-authored-by: Libin Yang <contact@yanglibin.info> Co-authored-by: Bartosz Dąbek <elderaramka@gmail.com> Co-authored-by: Marcos <33052423+markettes@users.noreply.github.com> Co-authored-by: Ashmi Chheda <31774401+ashmichheda@users.noreply.github.com> Co-authored-by: bogdandv <bogdandv_14@yahoo.com> Co-authored-by: Anup Kumar Panwar <1anuppanwar@gmail.com> Co-authored-by: yanglbme <szuyanglb@outlook.com> Co-authored-by: ibahadiraltun <ibahadiraltun@gmail.com> Co-authored-by: Daher Daher <40135454+daher928@users.noreply.github.com> Co-authored-by: Abhijay Kumar <abhijaynsit@gmail.com> Co-authored-by: Abhijay Kumar <abhijay.kumar@centricconsulting.com> Co-authored-by: xemjas <51793139+xemjas@users.noreply.github.com> Co-authored-by: CN-GuoZiyang <guoziyang0033@gmail.com> Co-authored-by: Priyansh-Kedia <52661249+Priyansh-Kedia@users.noreply.github.com> Co-authored-by: obelisk0114 <obelisk0114@gmail.com> Co-authored-by: Nikit Singh <nikitskulhari@gmail.com> Co-authored-by: obelisk0114 <obelisk0114@yahoo.com.tw> Co-authored-by: PatOnTheBack <51241310+PatOnTheBack@users.noreply.github.com> Co-authored-by: nisarhassan12 <syednisarhassan12@gmail.com> Co-authored-by: Nisar Hassan Naqvi <46004116+nisarhassan12@users.noreply.github.com> Co-authored-by: Furaha Damién <furaha.damien@mail.mcgill.ca> Co-authored-by: yeongmo-j <yeongmoj94@gmail.com> Co-authored-by: shellhub <shellhub.me@gmail.com> Co-authored-by: qwerty50000a <37273442+qwerty50000a@users.noreply.github.com> Co-authored-by: Lucas <0Zeta@protonmail.com> Co-authored-by: Ayush Varshney <34279863+blast314@users.noreply.github.com> Co-authored-by: Jas <12792882+Spikatrix@users.noreply.github.com> Co-authored-by: Matheus Muriel <matheus.muriel@outlook.com> Co-authored-by: salonilakhotia <salonilakhotia242@gmail.com> Co-authored-by: UntouchedOdin0 <UntouchedOdin0@users.noreply.github.com> Co-authored-by: walter-ind <52423075+walter-ind@users.noreply.github.com> Co-authored-by: Nikita Naumov <ymqkanso@gmail.com> Co-authored-by: Hemant Kumar <hemantkadyan@gmail.com> Co-authored-by: Chase Ganey <11964615+cganey@users.noreply.github.com> Co-authored-by: BryanChan777 <43082778+BryanChan777@users.noreply.github.com> Co-authored-by: Arogon1 <40372809+Arogon1@users.noreply.github.com> Co-authored-by: valery noname <valerydec17@gmail.com> Co-authored-by: Christian Clauss <cclauss@me.com> Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Co-authored-by: Caesar <m18824909883@163.com> Co-authored-by: Dekas Dimitrios <dimitridekas@gmail.com> Co-authored-by: Hassan <hassan.elseoudy@gmail.com> Co-authored-by: nikhil kala <nikhilkala8@gmail.com> Co-authored-by: Hakan Arslan <hakan0arslan@gmail.com> Co-authored-by: Wendell Lucas <49886455+wendelllsc@users.noreply.github.com> Co-authored-by: Alexandra Englert <rubi_81@outlook.de> Co-authored-by: Wesllhey Holanda <wesllhey.holanda@gmail.com> Co-authored-by: markaster <61535772+markaster@users.noreply.github.com> Co-authored-by: LittleFoot <2059416370@qq.com> Co-authored-by: littleFoot1 <52392154+littleFoot1@users.noreply.github.com> Co-authored-by: Moetez Skouri <moetezskouri@Moetezs-MacBook.local> Co-authored-by: Alaa El Bouhdidi <alaa.el.bouhdidi@mni.thm.de> Co-authored-by: VTolas <64403418+vtolas@users.noreply.github.com> Co-authored-by: ben <ben.riegel@mni.thm.de> Co-authored-by: Vikrant Khedkar <vikrantkhedkar2720@gmail.com> Co-authored-by: Maria Lungeanu <Maria.Lungeanu@anritsu.com>

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

In the main method line 146,if you change myList.deleteNth(1) to myList.deleteNth(3),3 is the count of list[7 -> 5 -> 11],you will ses (Exception in thread "main" java.lang.NullPointerException),because the postion in the deleteNth() method should from zero to (the count of list minus 1).