Question
Write a C program which produces auto-complete suggestions, similar to what Bash does when beginning to type a command and pressing . Your program will
Write a C program which produces auto-complete suggestions, similar to what Bash does when beginning to type a command and pressing . Your program will read all of the file names in a user-provided directory and store them in a data structure made up of an (at least) 26-element array of linked lists. You will need to implement a linked list in C. You will have one linked list for each letter of the alphabet, within which you will store the filenames which begin with that letter in alphabetical order. After reading the filenames into the array of linked lists, the user will be given a > prompt, at which they will enter the beginning of a filename they are interested in. When the user presses enter, all filenames which match that prefix will be printed (again, alphabetically). The program will continue to prompt for beginnings of filenames until an empty string is entered.
You may use any built-in C library functions in your program, but you must implement the linked list yourself. You may not use code found on the internet.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started