Data structure and Algorithm Analysis Java Speech description (introduction)

Source: Internet
Author: User

1.1 Issues discussed in this book

public class Test {//Output crossword word public static void Outputlogogriph (String temp, string[] logogriph) {for (int k = 0; K < Logogriph.length; k++) {//returns the index of the first occurrence of the specified character in the temp string if (Temp.indexof (logogriph[k]) >= 0) {System.out.println (logogriph[k]);}}} Compare word in crossword public static void Getlogogriph (string[][] s, string[] logogriph) {String temp = "";//find words in horizontal direction, from left to right direction for (i NT i = 0; i < s.length; i++) {//Temp = "" For the positive order, and for (int j = 0; J < S[i].length; J + +) {temp + = S[i][j];} Compare and output words in crossword outputlogogriph (temp, logogriph);//Temp = "" in reverse order; for (int j = s[i].length-1; J >= 0; j--) {temp + = S[i][j];} Compare and output the words in the crossword outputlogogriph (temp, logogriph);} Find the word in the vertical direction, from the top down direction//Find the word in the vertical direction, from the bottom up to the direction of temp = ""; for (int i = 0; i < s[0].length; i++) {//Temp = "" in the upper and lower direction; for (int j = 0; J < S.length; J + +) {temp + = S[j][i];} Compare and output the word outputlogogriph (temp, logogriph) in the crossword, or//temp = "" in the upper direction; for (int j = s.length-1; J >= 0; j--) {temp + = S[j][i];} Compare and output the words in the crossword outputlogogriph (temp, logogriph);}Finds the word on the first diagonal line (from the top down diagonal), positive direction (for a two-dimensional array of rules) temp = ""; for (int i = 0; i < s.length; i++) {temp + = S[i][i];} Forward//comparison, and output word outputlogogriph (temp, logogriph);//Find the word on the diagonal, opposite to temp = ""; for (int i = s.length-1; I >= 0; i--) {temp + = S[i][i];} Compare and output the words in the crossword outputlogogriph (temp, logogriph);//Find the second diagonal line, from bottom to top diagonal temp = ""; for (int i = 0; i < s.length; i++) {temp + = s[s.length-i-1][i];} Forward (oblique upward)//compare and output word outputlogogriph (temp, logogriph) in the crossword; temp = ""; for (int i = 0; i < s.length; i++) {temp + = s[i][s.length-i-1];} Forward (oblique downward)//compare and output word outputlogogriph (temp, logogriph) in the crossword;} public static void Main (string[] args) {//Note that the method applies only to arrays of rules, that is, string[][]s = new string[4][] is not allowed to be an irregular array; String[][] s = new String[4][4];s[0][0] = "T"; s[0][1] = "h"; s[0][2] = "I"; s[0][3] = "s"; s[1][0] = "w"; s[1][1] = "a"; s[1][2 ] = "T"; s[1][3] = "s"; s[2][0] = "O"; s[2][1] = "a"; s[2][2] = "h"; s[2][3] = "G"; s[3][0] = "F"; s[3][1] = "G"; s[3][2] = "D"; s[ 3][3] = "T"; string[] Logogriph = new string[] {"This", "tWo "," fat "," that "};getlogogriph (s, logogriph);}} 

1.2 Review of mathematical knowledge

The base of the logarithm cannot be 1, equals 1, and constant is 1.

progression: 

Data structure and Algorithm Analysis Java Speech description (introduction)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.