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...
icon
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
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
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
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Similar questions
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
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…
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)
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
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY