Hello.
I have been asked to write a function which Return the minimum index of
the nodes with a lexigraphically larger name".
But I am confused that what is lexigraphically
eehyf
0
Newbie Poster
Recommended Answers
Jump to PostIf you use C's strcmp() function it will return an integer > 0 if string1 is lexicographically larger than string2. Example: "Z" is greater than "A" because A comes first in …
Jump to Postlexigraphically - I take that to mean strings sorted or compared. Is that how your nodes are named? Perhaps a bit more information would help.
Jump to PostBasically you will compare the strings character by character.
So start with comparing "A" to "J", since J is higher up than A, "John" is lexicographically larger.
All 9 Replies
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
vmanes
1,165
Posting Virtuoso
eehyf
0
Newbie Poster
stilllearning
148
Posting Whiz
eehyf
0
Newbie Poster
eehyf
0
Newbie Poster
Alex Edwards
321
Posting Shark
vmanes
1,165
Posting Virtuoso
grumpier
149
Posting Whiz in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.