max and 蛋白markerr攻略wor...

您所在位置: &
 &  & 
自动化生产系统和计算-automation
production systems
and compute.pdf 867页
本文档一共被下载:
次 ,您可全文免费在线阅读后下载本文档。
下载提示
1.本站不保证该用户上传的文档完整性,不预览、不比对内容而直接下载产生的反悔问题本站不予受理。
2.该文档所得收入(下载+内容+预览三)归上传者、原创者。
3.登录后可充值,立即自动返金币,充值渠道很便利
自动化生产系统和计算-automation
production systems
and compute
你可能关注的文档:
??????????
??????????
opportunity time
discipline
industrial
engineering
is experiencing
a phenomenal
academia and
increased interests
utilization of
industrial
engineering
workplace.
utilization
these industrial engineering approaches in
workplace should result
increased productivity, quality
satisfaction and
profitability
cooperation.
suitable to junior
undergraduate
first year
in industry
solve problems
operation and
management of
industrial
Department
of Industrial Engineering,
University
of Industrial Engineering,
University
April, 2002
first edition of
lW;o under
Automation,
andComputer-A.ided
Manufacturing.
in 1981 with
a slightly
title:AutomarioR,
Production
Integrated
Manufacturing.
additional
res like industrial
正在加载中,请稍后...Android大法好!!
leetCode 79.Word Search (词搜索) 解题思路和方法
The word can be constructed from letters of sequentially adjacent cell, where "adjacent" cells are those horizontally or vertically neighboring. The same letter cell may not be used more than once.
For example,
Given board =
word = "ABCCED",
-& returns true,word = "SEE",
-& returns true,word = "ABCB",
-& returns false.
思路:此题意思是下个字符必须与上个字符相邻,且不能重复使用。代码上难度不大,最主要的是控制搜索的方向,分别向四个方向搜索即可。
代码如下:
public class Solution {
boolean[][]
public boolean exist(char[][] board, String word) {
if(word.length() == 0){
for(int i = 0; i & board.i++){
for(int j = 0; j & board[0]. j++){
if(board[i][j] == word.charAt(0)){
b = new boolean[board.length][board[0].length];
if(search(board,i,j,b,0,word)){
//根据首字母的i,j位置查找word
private boolean search(char[][] board,int i,int j,boolean[][] b,int index,String word){
if(board[i][j] != word.charAt(index)){//字符不相等。返回false
if(index == word.length() - 1){//如果到达最后一个,返回true
b[i][j] =//标记已使用
if(i & 0 && !b[i-1][j] && search(board,i-1,j,b,index+1,word)){//如果i&0,且i-1的值没有被使用,搜索
if(i & board.length-1 && !b[i+1][j] && search(board,i+1,j,b,index+1,word)){//如果没有边界,且i+1的值没有被使用,搜索
if(j & 0 && !b[i][j-1] && search(board,i,j-1,b,index+1,word)){//如果j&0,且j-1的值没有被使用,搜索
if(j & board[0].length-1 && !b[i][j+1] && search(board,i,j+1,b,index+1,word)){//如果没到边界,且j+1的值没有被使用,搜索
没有更多推荐了,

参考资料

 

随机推荐