21. Given f () and main (), what is the output when main is called? () { local p=$2; q=1; r=$1; } main() { p=1; q=2; r=3; f $p $q $r; (b)1 12 (c)3 32 (d)3 11 function function (a)1 11 echo $p $q $r; } e)None of the above 22. When creating a tree of directories with depth d and breadth b, the directories that have yet to be explored are held (memorized) in (a) open (b) closed (c) temp (d) successors (e)none of the above 23. When creating a tree of directories with depth d and breadth b, how many nested loops do you have to have as we discussed in class? (a)1 (b)2 (c) 3 (d) 4 (e)none of the above with depth d and breadth b, the directories that have already been (c) temp (d) successors (e)none of the above 24. When creating a tree of directories explored are held (memorized) in (a) open (b) closed
21. Given f () and main (), what is the output when main is called? () { local p=$2; q=1; r=$1; } main() { p=1; q=2; r=3; f $p $q $r; (b)1 12 (c)3 32 (d)3 11 function function (a)1 11 echo $p $q $r; } e)None of the above 22. When creating a tree of directories with depth d and breadth b, the directories that have yet to be explored are held (memorized) in (a) open (b) closed (c) temp (d) successors (e)none of the above 23. When creating a tree of directories with depth d and breadth b, how many nested loops do you have to have as we discussed in class? (a)1 (b)2 (c) 3 (d) 4 (e)none of the above with depth d and breadth b, the directories that have already been (c) temp (d) successors (e)none of the above 24. When creating a tree of directories explored are held (memorized) in (a) open (b) closed
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
please asnwer right one do not use chatgpt please
![### Problem Set Questions
#### 21. Given `f()` and `main()`, what is the output when `main` is called?
```c
function f() { local p=$2; q=1; r=$1; }
function main() { p=1; q=2; r=3; f $p $q $r; echo $p $q $r; }
```
Options:
- (a) 1 1 1
- (b) 1 2 2
- (c) 3 3 2
- (d) 3 1 1
- (e) None of the above
#### 22. When creating a tree of directories with depth `d` and breadth `b`, the directories that have yet to be explored are held (memorized) in:
- (a) open
- (b) closed
- (c) temp
- (d) successors
- (e) none of the above
#### 23. When creating a tree of directories with depth `d` and breadth `b`, how many nested loops do you have to have as we discussed in class?
- (a) 1
- (b) 2
- (c) 3
- (d) 4
- (e) none of the above
#### 24. When creating a tree of directories with depth `d` and breadth `b`, the directories that have already been explored are held (memorized) in:
- (a) open
- (b) closed
- (c) temp
- (d) successors
- (e) none of the above
#### 25. Depth-first search creates directories in the following order for `d=3` and `b=3`, where numbers are directory names and `/`'s are subdirectories:
- (a) 0,1,2,/0,0,/1,0,/2,1/0,...
- (b) 0,0,/0,0,/0,1,/0,0/2,0/1,/0,...
- (c) 0,1,2,/0,0,/0,/0,/0,/0,/1,0,/0/2,...
- (d) 0,0,/0,0,/,0,1,/1,1/0,/1,1](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F5bad4e48-dad8-4710-a64b-b24b80d1efcf%2F1ae4921e-db39-4e2f-a132-ff0f1dfaa880%2Fktharzo_processed.png&w=3840&q=75)
Transcribed Image Text:### Problem Set Questions
#### 21. Given `f()` and `main()`, what is the output when `main` is called?
```c
function f() { local p=$2; q=1; r=$1; }
function main() { p=1; q=2; r=3; f $p $q $r; echo $p $q $r; }
```
Options:
- (a) 1 1 1
- (b) 1 2 2
- (c) 3 3 2
- (d) 3 1 1
- (e) None of the above
#### 22. When creating a tree of directories with depth `d` and breadth `b`, the directories that have yet to be explored are held (memorized) in:
- (a) open
- (b) closed
- (c) temp
- (d) successors
- (e) none of the above
#### 23. When creating a tree of directories with depth `d` and breadth `b`, how many nested loops do you have to have as we discussed in class?
- (a) 1
- (b) 2
- (c) 3
- (d) 4
- (e) none of the above
#### 24. When creating a tree of directories with depth `d` and breadth `b`, the directories that have already been explored are held (memorized) in:
- (a) open
- (b) closed
- (c) temp
- (d) successors
- (e) none of the above
#### 25. Depth-first search creates directories in the following order for `d=3` and `b=3`, where numbers are directory names and `/`'s are subdirectories:
- (a) 0,1,2,/0,0,/1,0,/2,1/0,...
- (b) 0,0,/0,0,/0,1,/0,0/2,0/1,/0,...
- (c) 0,1,2,/0,0,/0,/0,/0,/0,/1,0,/0/2,...
- (d) 0,0,/0,0,/,0,1,/1,1/0,/1,1
![## Bash Commands and Output Predictions: A Review
### Bash Command Permissions
6. **The Bash command to give everyone (user, group members, and the public) permission to read and execute is: `chmod`**
- (a) 444
- (b) 555
- (c) 666
- (d) 777
- (e) none of the above
7. **The Bash command to give the user and the group members permission to read and write is: `chmod`**
- (a) 444
- (b) 555
- (c) 666
- (d) 777
- (e) none of the above
### Bash Echo Command Outputs
8. **Given `lst=(1 2 3)`, `echo $lst` will print:**
- (a) 1
- (b) 1 2 3
- (c) (1 2 3)
- (d) 1 2 3 in 3 lines
- (e) None of the above
9. **Given `lst=(1 2 3)`, `echo ${lst[@]}` will print:**
- (a) 1
- (b) 1 2 3
- (c) (1 2 3)
- (d) 1 2 3 in 3 lines
- (e) none of the above
10. **Given `lst=(1 2 3)`, `echo ${#lst[@]}` will print:**
- (a) 1
- (b) 2
- (c) 3
- (d) 1 2 3
- (e) none of the above](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F5bad4e48-dad8-4710-a64b-b24b80d1efcf%2F1ae4921e-db39-4e2f-a132-ff0f1dfaa880%2Fpvdectf_processed.png&w=3840&q=75)
Transcribed Image Text:## Bash Commands and Output Predictions: A Review
### Bash Command Permissions
6. **The Bash command to give everyone (user, group members, and the public) permission to read and execute is: `chmod`**
- (a) 444
- (b) 555
- (c) 666
- (d) 777
- (e) none of the above
7. **The Bash command to give the user and the group members permission to read and write is: `chmod`**
- (a) 444
- (b) 555
- (c) 666
- (d) 777
- (e) none of the above
### Bash Echo Command Outputs
8. **Given `lst=(1 2 3)`, `echo $lst` will print:**
- (a) 1
- (b) 1 2 3
- (c) (1 2 3)
- (d) 1 2 3 in 3 lines
- (e) None of the above
9. **Given `lst=(1 2 3)`, `echo ${lst[@]}` will print:**
- (a) 1
- (b) 1 2 3
- (c) (1 2 3)
- (d) 1 2 3 in 3 lines
- (e) none of the above
10. **Given `lst=(1 2 3)`, `echo ${#lst[@]}` will print:**
- (a) 1
- (b) 2
- (c) 3
- (d) 1 2 3
- (e) none of the above
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 3 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Recommended textbooks for you
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY