Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize word search in C language

2025-04-08 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)05/31 Report--

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

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report