Get the App
SLTechnology News&Howtos  ›  Development  › 

How to realize word search in C language

Shulou Source: shulou.com Published: 2022-05-31 21:35:39 10月04日 Update

The editor of this article introduces in detail "how to realize word search in c language". The content is detailed, the steps are clear, and the details are handled properly. I hope this article "how to realize word search in c language" can help you solve your doubts. Let's follow the editor's ideas to learn new knowledge.

Word search

Given a m x n 2D character grid board and a string word word. Returns true if word exists in the grid; otherwise, returns false.

Words must be formed alphabetically from letters in adjacent cells, where "adjacent" cells are those cells that are horizontally or vertically adjacent. Letters in the same cell are not allowed to be reused.

The code solves the problem as follows:

Int pi,pj;//static int r [100] [100]; void f (char** board,int n, int mrec int [x] [y]) {int a [4] [2] = {{0lagre 1}, {- 1jue 0}, {0jue 1}, {1jue 0}; / / printf ("% d", r [x] [y]); int nx,ny; int iJue; int cc=0; int linger0 Int zx,zy; / / printf ("% d", r); / / r [x] [y] = 1; / printf ("- p% d% d", pscorz); if (m > = 3) r [0] [3] = 0; / / printf ("% d% c", r [0] [3], word [p]); for

Tags: Words searches units languages letters articles content characters grids boxes propriety code strings ideas new knowledge more steps levels knowledge knowledge points Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi Microsoft Shulou Tech Info NVidia Shulou Technology